{
  "openapi": "3.1.0",
  "info": {
    "title": "Rover API",
    "version": "1",
    "description": "Invoices, services, accounts and documents from waste and recycling hauler portals. Every operation here is also an MCP tool at `/v1/mcp` under the name in `x-mcp-tool`. Guides: https://rover.waste.dev/docs/"
  },
  "servers": [
    {
      "url": "https://rover.waste.dev/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Records",
      "description": "The records Rover read from a portal: the latest reading, the history of one record, what changed, and full-text search over records, documents and pages. Every answer says when the reading was taken (`asOf`) and how complete it was (`coverage`)."
    },
    {
      "name": "Accounts",
      "description": "Every vendor account across every one of your portals, with its locations, services, work orders, invoices, statements and payments nested under it. Reads across portals; the nine `/portals/:host/...` reads under Records do not."
    },
    {
      "name": "Portals",
      "description": "The hauler portals Rover knows, and what each one offers."
    },
    {
      "name": "Credentials",
      "description": "Portal logins, stored encrypted. A read never returns a password or a security answer."
    },
    {
      "name": "Runs",
      "description": "Start a run against a portal, follow it, answer it when it asks for a one-time code, or stop it."
    },
    {
      "name": "Schedules",
      "description": "Have Rover read a stored login on its own clock."
    },
    {
      "name": "Webhooks and events",
      "description": "Subscribe to a run or a portal and receive signed webhooks, or read a run's events."
    },
    {
      "name": "Documents",
      "description": "Stored invoice and statement files, addressed by the sha256 of their bytes."
    },
    {
      "name": "Catalog",
      "description": "The record types and fields Rover knows, and which portals offer which fields."
    },
    {
      "name": "Tokens",
      "description": "API tokens for your own team. A token is shown once, when it is created."
    },
    {
      "name": "Account",
      "description": "Who a token belongs to, which notice emails you get, and the apps you have connected with OAuth."
    },
    {
      "name": "Team",
      "description": "Invite people to your team and manage their roles."
    },
    {
      "name": "MCP and OAuth",
      "description": "The MCP endpoint and the OAuth 2.1 endpoints an MCP client uses to sign in."
    },
    {
      "name": "Deployment",
      "description": "The workers and settings of this Rover deployment."
    },
    {
      "name": "Administration",
      "description": "Rover staff operations. They need an admin token, which a customer token never is."
    }
  ],
  "paths": {
    "/accounts": {
      "get": {
        "operationId": "accounts_list",
        "tags": [
          "Accounts"
        ],
        "summary": "Every account across every one of this caller's portals: balance, open invoices, locations and next pickup, newest balance due first.",
        "description": "Every account across every one of this caller's portals: balance, open invoices, locations and next pickup, newest balance due first.",
        "x-mcp-tool": "accounts_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "portal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 400
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "Every account across every one of this caller's portals, newest balance due first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "portal": {
                            "type": "string"
                          },
                          "customerId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "accountNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "accountName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "balance": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "overdue": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "locationCount": {
                            "type": "integer"
                          },
                          "openInvoices": {
                            "type": "integer"
                          },
                          "amountDue": {
                            "type": "integer"
                          },
                          "nextPickup": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastInvoiceDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastRead": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastObservedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "key",
                          "portal",
                          "customerId",
                          "accountNumber",
                          "accountName",
                          "balance",
                          "overdue",
                          "status",
                          "locationCount",
                          "openInvoices",
                          "amountDue",
                          "nextPickup",
                          "lastInvoiceDate",
                          "lastRead",
                          "lastObservedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "amountDue": {
                          "type": "integer"
                        },
                        "openInvoices": {
                          "type": "integer"
                        },
                        "locationCount": {
                          "type": "integer"
                        },
                        "accountCount": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "amountDue",
                        "openInvoices",
                        "locationCount",
                        "accountCount"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "accounts",
                    "totals"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountKey}": {
      "get": {
        "operationId": "account_get",
        "tags": [
          "Accounts"
        ],
        "summary": "One account, fully nested: its locations (each with its own services and work orders), invoices, statements/documents and payments.",
        "description": "One account, fully nested: its locations (each with its own services and work orders), invoices, statements/documents and payments. The key comes from accounts_list.",
        "x-mcp-tool": "account_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "accountKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 400
            }
          },
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "One account, fully nested: its locations (each with its own services and work orders), invoices, statements/documents and payments.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "customerId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "accountNumber": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "accountName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "balance": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "overdue": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "billingAddress": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastObservedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "street": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "cityLine": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "landmark": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "coordinates": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "latitude": {
                                "type": "string"
                              },
                              "longitude": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "latitude",
                              "longitude"
                            ],
                            "additionalProperties": false
                          },
                          "services": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "identityKey": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "containerType": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "containerSize": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "containerQuantity": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "frequency": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "nextPickup": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "lastActivity": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "status": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "lastObservedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "carriedCount": {
                                  "type": "integer"
                                }
                              },
                              "required": [
                                "identityKey",
                                "description",
                                "containerType",
                                "containerSize",
                                "containerQuantity",
                                "frequency",
                                "nextPickup",
                                "lastActivity",
                                "status",
                                "lastObservedAt",
                                "carriedCount"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "workOrders": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "identityKey": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "status": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "requestDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "scheduledDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "completedDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "lastObservedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "carriedCount": {
                                  "type": "integer"
                                }
                              },
                              "required": [
                                "identityKey",
                                "type",
                                "status",
                                "requestDate",
                                "scheduledDate",
                                "completedDate",
                                "lastObservedAt",
                                "carriedCount"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "key",
                          "name",
                          "address",
                          "street",
                          "cityLine",
                          "landmark",
                          "coordinates",
                          "services",
                          "workOrders"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "unassignedServices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "identityKey": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "containerType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "containerSize": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "containerQuantity": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "frequency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "nextPickup": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastActivity": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastObservedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "carriedCount": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "identityKey",
                          "description",
                          "containerType",
                          "containerSize",
                          "containerQuantity",
                          "frequency",
                          "nextPickup",
                          "lastActivity",
                          "status",
                          "lastObservedAt",
                          "carriedCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "unassignedWorkOrders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "identityKey": {
                            "type": "string"
                          },
                          "type": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "requestDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "scheduledDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "completedDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastObservedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "carriedCount": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "identityKey",
                          "type",
                          "status",
                          "requestDate",
                          "scheduledDate",
                          "completedDate",
                          "lastObservedAt",
                          "carriedCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "invoices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "identityKey": {
                            "type": "string"
                          },
                          "number": {
                            "type": "string"
                          },
                          "invoiceDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "dueDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "total": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "amountDue": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "open",
                              "overdue",
                              "paid",
                              "credit"
                            ]
                          },
                          "documentSha256": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "kind": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastObservedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "carriedCount": {
                            "type": "integer"
                          },
                          "needsReview": {
                            "const": true,
                            "description": "Present when the reading or the row is doubted, so check the portal before acting on the amount."
                          },
                          "flags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "What this row lacks or why it is doubted, each `code` or `code:field`: document_missing, amount_zero, account_unproven, field_missing:<field>. Absent when there is nothing to say."
                          }
                        },
                        "required": [
                          "identityKey",
                          "number",
                          "invoiceDate",
                          "dueDate",
                          "total",
                          "amountDue",
                          "status",
                          "documentSha256",
                          "kind",
                          "lastObservedAt",
                          "carriedCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "payments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "identityKey": {
                            "type": "string"
                          },
                          "paymentDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "amount": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "method": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reference": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "invoiceRef": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastObservedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "carriedCount": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "identityKey",
                          "paymentDate",
                          "amount",
                          "method",
                          "reference",
                          "invoiceRef",
                          "status",
                          "lastObservedAt",
                          "carriedCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "documents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "identityKey": {
                            "type": "string"
                          },
                          "period": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "kind": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "documentSha256": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastObservedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "carriedCount": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "identityKey",
                          "period",
                          "kind",
                          "documentSha256",
                          "lastObservedAt",
                          "carriedCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "lastRead": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "amountDue": {
                      "type": "integer"
                    },
                    "openInvoices": {
                      "type": "integer"
                    },
                    "nextPickup": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastInvoiceDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "key",
                    "portal",
                    "customerId",
                    "accountNumber",
                    "accountName",
                    "balance",
                    "overdue",
                    "status",
                    "billingAddress",
                    "lastObservedAt",
                    "locations",
                    "unassignedServices",
                    "unassignedWorkOrders",
                    "invoices",
                    "payments",
                    "documents",
                    "lastRead",
                    "amountDue",
                    "openInvoices",
                    "nextPickup",
                    "lastInvoiceDate"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountKey}/ask": {
      "post": {
        "operationId": "account_ask",
        "tags": [
          "Accounts"
        ],
        "summary": "One question about one account, answered from its own records, linked pages/documents and changes through one OpenRouter call, with a citation on every claim.",
        "description": "One question about one account, answered from its own records, linked pages/documents and changes through one OpenRouter call, with a citation on every claim. The key comes from accounts_list.",
        "x-mcp-tool": "account_ask",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "accountKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 400
            }
          },
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "question": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 400
                  }
                },
                "required": [
                  "question"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One question about one account, answered from its own evidence, with a citation on every claim.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "answer": {
                      "type": "string"
                    },
                    "citations": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "const": "record"
                              },
                              "entity": {
                                "type": "string"
                              },
                              "identityKey": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind",
                              "entity",
                              "identityKey"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "const": "page"
                              },
                              "url": {
                                "type": "string"
                              },
                              "capturedAt": {
                                "type": "string"
                              },
                              "sha256": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind",
                              "url",
                              "capturedAt",
                              "sha256"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "const": "document"
                              },
                              "sha256": {
                                "type": "string"
                              },
                              "invoiceNumber": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "sha256",
                              "invoiceNumber"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "const": "change"
                              },
                              "entity": {
                                "type": "string"
                              },
                              "identityKey": {
                                "type": "string"
                              },
                              "detectedAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind",
                              "entity",
                              "identityKey",
                              "detectedAt"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "asOf": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "answer",
                    "citations",
                    "asOf"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/auth/me": {
      "get": {
        "operationId": "auth_me",
        "tags": [
          "Account"
        ],
        "summary": "Who this bearer authenticates as.",
        "description": "Who this bearer authenticates as.",
        "x-mcp-tool": "auth_me",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "responses": {
          "200": {
            "description": "Who the bearer is: a person, or a token.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "email": {
                              "type": "string"
                            },
                            "tenant": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "super_admin",
                                "tenant_admin",
                                "tenant_viewer"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "email",
                            "tenant",
                            "role"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "tenant": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "admin": {
                              "type": "boolean"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "token",
                                "basic",
                                "user"
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "tenant",
                            "admin",
                            "kind"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "required": [
                    "user"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/config": {
      "get": {
        "operationId": "config_get",
        "tags": [
          "Deployment"
        ],
        "summary": "This deployment's settings: which stores are configured, lanes, roles, contract revision.",
        "description": "This deployment's settings: which stores are configured, lanes, roles, contract revision. Never a secret.",
        "x-mcp-tool": "config_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "responses": {
          "200": {
            "description": "This deployment's settings. Never a secret.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "explorer": {
                      "type": "string"
                    },
                    "explorerAuth": {
                      "type": "string",
                      "enum": [
                        "api-key",
                        "session"
                      ]
                    },
                    "repairModel": {
                      "type": "object",
                      "properties": {
                        "configured": {
                          "type": "boolean"
                        },
                        "keyEnv": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "model": {
                          "type": "string"
                        },
                        "escalationModel": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "line": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "configured",
                        "keyEnv",
                        "model",
                        "escalationModel",
                        "line"
                      ],
                      "additionalProperties": false
                    },
                    "extractService": {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "enum": [
                            "not_configured",
                            "configured",
                            "invalid"
                          ]
                        },
                        "urlEnv": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "baseUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "line": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "state",
                        "urlEnv",
                        "baseUrl",
                        "line"
                      ],
                      "additionalProperties": false
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "runsWorker": {
                      "type": "boolean"
                    },
                    "lanes": {
                      "type": "object",
                      "properties": {
                        "replay": {
                          "type": "object",
                          "properties": {
                            "queue": {
                              "type": "string"
                            },
                            "concurrency": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "queue",
                            "concurrency"
                          ],
                          "additionalProperties": false
                        },
                        "explore": {
                          "type": "object",
                          "properties": {
                            "queue": {
                              "type": "string"
                            },
                            "concurrency": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "queue",
                            "concurrency"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "replay",
                        "explore"
                      ],
                      "additionalProperties": false
                    },
                    "rolesEnv": {
                      "type": "string"
                    },
                    "queueMaxWaiting": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "healBudget": {
                      "type": "object",
                      "properties": {
                        "maxRepairAttempts": {
                          "type": "integer"
                        },
                        "maxLocalRetries": {
                          "type": "integer"
                        },
                        "cloudEscalationApproved": {
                          "type": "boolean"
                        },
                        "hostedBrowserAvailable": {
                          "type": "boolean"
                        },
                        "configurable": {
                          "const": false
                        }
                      },
                      "required": [
                        "maxRepairAttempts",
                        "maxLocalRetries",
                        "cloudEscalationApproved",
                        "configurable"
                      ],
                      "additionalProperties": false
                    },
                    "contractRevision": {
                      "type": "string"
                    },
                    "publicUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "stores": {
                      "type": "object",
                      "properties": {
                        "records": {
                          "type": "boolean"
                        },
                        "state": {
                          "type": "boolean"
                        },
                        "portals": {
                          "type": "boolean"
                        },
                        "credentials": {
                          "type": "boolean"
                        },
                        "tenants": {
                          "type": "boolean"
                        },
                        "documents": {
                          "type": "boolean"
                        },
                        "schedules": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "records",
                        "state",
                        "portals",
                        "credentials",
                        "tenants",
                        "documents",
                        "schedules"
                      ],
                      "additionalProperties": false
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "explorer",
                    "explorerAuth",
                    "repairModel",
                    "extractService",
                    "roles",
                    "runsWorker",
                    "lanes",
                    "rolesEnv",
                    "queueMaxWaiting",
                    "healBudget",
                    "contractRevision",
                    "publicUrl",
                    "stores",
                    "notes"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/credentials": {
      "post": {
        "operationId": "credentials_push",
        "tags": [
          "Credentials"
        ],
        "summary": "Push (or replace) a login for a customer on a portal.",
        "description": "Push (or replace) a login for a customer on a portal. Upsert; the password never comes back on any read.",
        "x-mcp-tool": "credentials_push",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "portal": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "customer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "username": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 400
                  },
                  "password": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  },
                  "securityAnswers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 400
                        },
                        "answer": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 400
                        }
                      },
                      "required": [
                        "question",
                        "answer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "loginUrl": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "proxy": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "schedule": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "legacyCredentialId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "driver": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "driverOptions": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "vendorDetails": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "remoteBrowser": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "vendorDisplayName": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 80,
                    "description": "The hauler's name as the customer knows it; shown before any other name the login carries. Null clears it; left out, the stored one stays."
                  }
                },
                "required": [
                  "portal",
                  "customer",
                  "username",
                  "password"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stored login.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "tenant": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "account": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "portal": {
                      "type": "string"
                    },
                    "customer": {
                      "type": "string"
                    },
                    "username": {
                      "type": "string"
                    },
                    "loginFingerprint": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "initial",
                        "validating",
                        "valid",
                        "inactive",
                        "invalid_username_or_password",
                        "invalid_security_answer",
                        "account_locked",
                        "account_discovery_failed",
                        "portal_deprecated",
                        "authentication_failed_other"
                      ]
                    },
                    "securityAnswerCount": {
                      "type": "integer"
                    },
                    "errorHistory": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "at": {
                            "type": "string"
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "initial",
                              "validating",
                              "valid",
                              "inactive",
                              "invalid_username_or_password",
                              "invalid_security_answer",
                              "account_locked",
                              "account_discovery_failed",
                              "portal_deprecated",
                              "authentication_failed_other"
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "at",
                          "status",
                          "message"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "vendorDetails": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": {}
                    },
                    "vendorDisplayName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "loginUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "proxy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "schedule": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "legacyCredentialId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "driver": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "driverOptions": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": {}
                    },
                    "vendorKey": {
                      "type": "string",
                      "description": "The vendor this login belongs to. A login on a billing platform shared by many haulers is keyed by its host and first path segment."
                    },
                    "vendorName": {
                      "type": "string",
                      "description": "The vendor's name to show: the one a tenant admin set, else the tenant record's, else the directory's, else one read from the host."
                    },
                    "remoteBrowser": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "provider": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "provider"
                          ],
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastUsedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastValidatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "passwordUpdatedBySupportAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "portalKnown": {
                      "type": "boolean",
                      "description": "Whether Rover already knew this portal."
                    },
                    "portalStatus": {
                      "type": "string",
                      "enum": [
                        "approved",
                        "pending",
                        "rejected",
                        "suspended"
                      ],
                      "description": "DIS-2435: present only for a tenant-scoped caller whose portal is not approved. `pending` means a request was filed; no run was started."
                    }
                  },
                  "required": [
                    "id",
                    "tenant",
                    "account",
                    "portal",
                    "customer",
                    "username",
                    "loginFingerprint",
                    "status",
                    "securityAnswerCount",
                    "errorHistory",
                    "vendorDetails",
                    "vendorDisplayName",
                    "loginUrl",
                    "proxy",
                    "schedule",
                    "legacyCredentialId",
                    "driver",
                    "driverOptions",
                    "vendorKey",
                    "vendorName",
                    "remoteBrowser",
                    "lastUsedAt",
                    "lastValidatedAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false,
                  "description": "A stored login. Never the password or a security answer."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "get": {
        "operationId": "credentials_list",
        "tags": [
          "Credentials"
        ],
        "summary": "Stored login summaries.",
        "description": "Stored login summaries. Never a password or a security answer.",
        "x-mcp-tool": "credentials_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          },
          {
            "name": "portal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stored logins.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credentials": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "tenant": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "account": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "portal": {
                            "type": "string"
                          },
                          "customer": {
                            "type": "string"
                          },
                          "username": {
                            "type": "string"
                          },
                          "loginFingerprint": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "initial",
                              "validating",
                              "valid",
                              "inactive",
                              "invalid_username_or_password",
                              "invalid_security_answer",
                              "account_locked",
                              "account_discovery_failed",
                              "portal_deprecated",
                              "authentication_failed_other"
                            ]
                          },
                          "securityAnswerCount": {
                            "type": "integer"
                          },
                          "errorHistory": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "at": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "enum": [
                                    "initial",
                                    "validating",
                                    "valid",
                                    "inactive",
                                    "invalid_username_or_password",
                                    "invalid_security_answer",
                                    "account_locked",
                                    "account_discovery_failed",
                                    "portal_deprecated",
                                    "authentication_failed_other"
                                  ]
                                },
                                "message": {
                                  "type": "string"
                                },
                                "runId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "at",
                                "status",
                                "message"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "vendorDetails": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": {}
                          },
                          "vendorDisplayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "loginUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "proxy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "schedule": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "legacyCredentialId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "driver": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "driverOptions": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": {}
                          },
                          "vendorKey": {
                            "type": "string",
                            "description": "The vendor this login belongs to. A login on a billing platform shared by many haulers is keyed by its host and first path segment."
                          },
                          "vendorName": {
                            "type": "string",
                            "description": "The vendor's name to show: the one a tenant admin set, else the tenant record's, else the directory's, else one read from the host."
                          },
                          "remoteBrowser": {
                            "oneOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "provider": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "provider"
                                ],
                                "additionalProperties": true
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lastUsedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastValidatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "passwordUpdatedBySupportAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "tenant",
                          "account",
                          "portal",
                          "customer",
                          "username",
                          "loginFingerprint",
                          "status",
                          "securityAnswerCount",
                          "errorHistory",
                          "vendorDetails",
                          "vendorDisplayName",
                          "loginUrl",
                          "proxy",
                          "schedule",
                          "legacyCredentialId",
                          "driver",
                          "driverOptions",
                          "vendorKey",
                          "vendorName",
                          "remoteBrowser",
                          "lastUsedAt",
                          "lastValidatedAt",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false,
                        "description": "A stored login. Never the password or a security answer."
                      }
                    }
                  },
                  "required": [
                    "credentials"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "delete": {
        "operationId": "credentials_delete",
        "tags": [
          "Credentials"
        ],
        "summary": "Delete a stored login for good.",
        "description": "Delete a stored login for good.",
        "x-mcp-tool": "credentials_delete",
        "x-rover-role": "operator",
        "x-oauth-allowed": false,
        "x-destructive": true,
        "parameters": [
          {
            "name": "portal",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "const": true
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/credentials/deactivate": {
      "post": {
        "operationId": "credentials_deactivate",
        "tags": [
          "Credentials"
        ],
        "summary": "Mark a login inactive.",
        "description": "Mark a login inactive. It stays stored; a run will not use it until reactivated.",
        "x-mcp-tool": "credentials_deactivate",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "x-destructive": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "portal": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "customer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  }
                },
                "required": [
                  "portal",
                  "customer"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The login's new status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "initial",
                        "validating",
                        "valid",
                        "inactive",
                        "invalid_username_or_password",
                        "invalid_security_answer",
                        "account_locked",
                        "account_discovery_failed",
                        "portal_deprecated",
                        "authentication_failed_other"
                      ]
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/credentials/one": {
      "get": {
        "operationId": "credentials_get",
        "tags": [
          "Credentials"
        ],
        "summary": "One stored login by portal and customer.",
        "description": "One stored login by portal and customer.",
        "x-mcp-tool": "credentials_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "portal",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "The stored login.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "tenant": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "account": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "portal": {
                      "type": "string"
                    },
                    "customer": {
                      "type": "string"
                    },
                    "username": {
                      "type": "string"
                    },
                    "loginFingerprint": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "initial",
                        "validating",
                        "valid",
                        "inactive",
                        "invalid_username_or_password",
                        "invalid_security_answer",
                        "account_locked",
                        "account_discovery_failed",
                        "portal_deprecated",
                        "authentication_failed_other"
                      ]
                    },
                    "securityAnswerCount": {
                      "type": "integer"
                    },
                    "errorHistory": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "at": {
                            "type": "string"
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "initial",
                              "validating",
                              "valid",
                              "inactive",
                              "invalid_username_or_password",
                              "invalid_security_answer",
                              "account_locked",
                              "account_discovery_failed",
                              "portal_deprecated",
                              "authentication_failed_other"
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "at",
                          "status",
                          "message"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "vendorDetails": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": {}
                    },
                    "vendorDisplayName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "loginUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "proxy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "schedule": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "legacyCredentialId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "driver": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "driverOptions": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": {}
                    },
                    "vendorKey": {
                      "type": "string",
                      "description": "The vendor this login belongs to. A login on a billing platform shared by many haulers is keyed by its host and first path segment."
                    },
                    "vendorName": {
                      "type": "string",
                      "description": "The vendor's name to show: the one a tenant admin set, else the tenant record's, else the directory's, else one read from the host."
                    },
                    "remoteBrowser": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "provider": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "provider"
                          ],
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastUsedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastValidatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "passwordUpdatedBySupportAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "tenant",
                    "account",
                    "portal",
                    "customer",
                    "username",
                    "loginFingerprint",
                    "status",
                    "securityAnswerCount",
                    "errorHistory",
                    "vendorDetails",
                    "vendorDisplayName",
                    "loginUrl",
                    "proxy",
                    "schedule",
                    "legacyCredentialId",
                    "driver",
                    "driverOptions",
                    "vendorKey",
                    "vendorName",
                    "remoteBrowser",
                    "lastUsedAt",
                    "lastValidatedAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false,
                  "description": "A stored login. Never the password or a security answer."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/credentials/reactivate": {
      "post": {
        "operationId": "credentials_reactivate",
        "tags": [
          "Credentials"
        ],
        "summary": "Return a login to initial, so the next run tests it from scratch.",
        "description": "Return a login to initial, so the next run tests it from scratch.",
        "x-mcp-tool": "credentials_reactivate",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "portal": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "customer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  }
                },
                "required": [
                  "portal",
                  "customer"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The login's new status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "initial",
                        "validating",
                        "valid",
                        "inactive",
                        "invalid_username_or_password",
                        "invalid_security_answer",
                        "account_locked",
                        "account_discovery_failed",
                        "portal_deprecated",
                        "authentication_failed_other"
                      ]
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/credentials/revalidate": {
      "post": {
        "operationId": "credentials_revalidate",
        "tags": [
          "Credentials"
        ],
        "summary": "Queue a run that tests a login now, and sets its status from the result.",
        "description": "Queue a run that tests a login now, and sets its status from the result.",
        "x-mcp-tool": "credentials_revalidate",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "portal": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "customer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  },
                  "credentialId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "portal",
                  "customer"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A run on this login was already queued or running; that run is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "duplicate": {
                      "const": true
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "request_id",
                        "in_flight"
                      ]
                    },
                    "runId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "portal",
                    "duplicate",
                    "reason",
                    "runId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "A run that tests the login was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "state": {
                      "const": "queued"
                    },
                    "lane": {
                      "type": "string",
                      "enum": [
                        "replay",
                        "explore"
                      ]
                    },
                    "priority": {
                      "type": "number"
                    },
                    "waitingAhead": {
                      "type": "integer"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "portal",
                    "state",
                    "lane",
                    "priority"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/credentials/sharing": {
      "get": {
        "operationId": "credentials_sharing",
        "tags": [
          "Credentials"
        ],
        "summary": "Where else this same login is stored, across this tenant’s own accounts only.",
        "description": "Where else this same login is stored, across this tenant’s own accounts only.",
        "x-mcp-tool": "credentials_sharing",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "portal",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "The same login stored elsewhere in your team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credentials": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "tenant": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "account": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "portal": {
                            "type": "string"
                          },
                          "customer": {
                            "type": "string"
                          },
                          "username": {
                            "type": "string"
                          },
                          "loginFingerprint": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "initial",
                              "validating",
                              "valid",
                              "inactive",
                              "invalid_username_or_password",
                              "invalid_security_answer",
                              "account_locked",
                              "account_discovery_failed",
                              "portal_deprecated",
                              "authentication_failed_other"
                            ]
                          },
                          "securityAnswerCount": {
                            "type": "integer"
                          },
                          "errorHistory": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "at": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "enum": [
                                    "initial",
                                    "validating",
                                    "valid",
                                    "inactive",
                                    "invalid_username_or_password",
                                    "invalid_security_answer",
                                    "account_locked",
                                    "account_discovery_failed",
                                    "portal_deprecated",
                                    "authentication_failed_other"
                                  ]
                                },
                                "message": {
                                  "type": "string"
                                },
                                "runId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "at",
                                "status",
                                "message"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "vendorDetails": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": {}
                          },
                          "vendorDisplayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "loginUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "proxy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "schedule": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "legacyCredentialId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "driver": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "driverOptions": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": {}
                          },
                          "vendorKey": {
                            "type": "string",
                            "description": "The vendor this login belongs to. A login on a billing platform shared by many haulers is keyed by its host and first path segment."
                          },
                          "vendorName": {
                            "type": "string",
                            "description": "The vendor's name to show: the one a tenant admin set, else the tenant record's, else the directory's, else one read from the host."
                          },
                          "remoteBrowser": {
                            "oneOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "provider": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "provider"
                                ],
                                "additionalProperties": true
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lastUsedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastValidatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "passwordUpdatedBySupportAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "tenant",
                          "account",
                          "portal",
                          "customer",
                          "username",
                          "loginFingerprint",
                          "status",
                          "securityAnswerCount",
                          "errorHistory",
                          "vendorDetails",
                          "vendorDisplayName",
                          "loginUrl",
                          "proxy",
                          "schedule",
                          "legacyCredentialId",
                          "driver",
                          "driverOptions",
                          "vendorKey",
                          "vendorName",
                          "remoteBrowser",
                          "lastUsedAt",
                          "lastValidatedAt",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false,
                        "description": "A stored login. Never the password or a security answer."
                      }
                    }
                  },
                  "required": [
                    "credentials"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/credentials/{id}/vendor-name": {
      "patch": {
        "operationId": "credentials_vendor_name_set",
        "tags": [
          "Credentials"
        ],
        "summary": "Name the hauler behind one of your logins.",
        "description": "Name the hauler behind one of your logins. Send `{ \"name\": \"Waste Advantage\" }` (1 to 80 characters, trimmed), or `{ \"name\": null }` to clear it. A tenant admin only; the name beats any other the login carries.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The login, with its vendorKey and the vendorName now shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/documents/{sha256}": {
      "get": {
        "operationId": "documents_get",
        "tags": [
          "Documents"
        ],
        "summary": "The bytes of one stored document.",
        "description": "The bytes of one stored document. Send a token, or use the signed link documents_link returns, which needs none.",
        "parameters": [
          {
            "name": "sha256",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/documents/{sha256}/link": {
      "get": {
        "operationId": "documents_link",
        "tags": [
          "Documents"
        ],
        "summary": "Mint a signed, time-limited URL for one stored document.",
        "description": "Mint a signed, time-limited URL for one stored document. Stateless: nothing is stored by minting it.",
        "x-mcp-tool": "documents_link",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "sha256",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          },
          {
            "name": "ttl",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A signed link to the document. It needs no token and expires.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/events": {
      "get": {
        "operationId": "events_get",
        "tags": [
          "Webhooks and events"
        ],
        "summary": "The raw stored event stream for one run.",
        "description": "The raw stored event stream for one run.",
        "x-mcp-tool": "events_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "run",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "The run's stored events, in order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "run": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "at": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "portal": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "at",
                          "runId",
                          "portal"
                        ],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "run",
                    "events"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/fields": {
      "get": {
        "operationId": "fields_catalog",
        "tags": [
          "Catalog"
        ],
        "summary": "Every record type and field the runtime knows, its meaning, type, and whether each coverage profile requires it.",
        "description": "Every record type and field the runtime knows, its meaning, type, and whether each coverage profile requires it.",
        "x-mcp-tool": "fields_catalog",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "responses": {
          "200": {
            "description": "Every record type and field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "purpose": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "purpose"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "entities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entity": {
                            "type": "string"
                          },
                          "discovery": {
                            "type": "object",
                            "properties": {
                              "entity": {
                                "type": "string"
                              },
                              "notes": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "entity",
                              "notes"
                            ],
                            "additionalProperties": false
                          },
                          "identity": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "fields": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "required": {
                                  "type": "boolean"
                                },
                                "enumValues": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "discoveryField": {
                                  "type": "string"
                                },
                                "profiles": {
                                  "type": "object",
                                  "additionalProperties": {
                                    "type": "string",
                                    "enum": [
                                      "required",
                                      "optional"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "name",
                                "type",
                                "description",
                                "required",
                                "profiles"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "entity",
                          "discovery",
                          "identity",
                          "fields"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "profiles",
                    "entities"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/health/alerts": {
      "get": {
        "operationId": "health_alerts_list",
        "tags": [
          "Administration"
        ],
        "summary": "Operator alerts Rover raised for itself (OperatorAlerts.ts): portal, since when, why, and when cleared.",
        "description": "Operator alerts Rover raised for itself (OperatorAlerts.ts): portal, since when, why, and when cleared. Super admin only.",
        "x-mcp-tool": "health_alerts_list",
        "x-rover-role": "admin",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operator alerts, open ones first, then recently cleared.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "alerts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "host": {
                            "type": "string"
                          },
                          "tenant": {
                            "type": "string"
                          },
                          "customer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "raisedAt": {
                            "type": "string"
                          },
                          "clearedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "key",
                          "host",
                          "tenant",
                          "customer",
                          "reason",
                          "raisedAt",
                          "clearedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "alerts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/health/fleet": {
      "get": {
        "operationId": "health_fleet_get",
        "tags": [
          "Deployment"
        ],
        "summary": "Outcomes, timings and open reviews rolled up across every worker pod for a window, in place of one process's own always-zero counters.",
        "description": "Outcomes, timings and open reviews rolled up across every worker pod for a window, in place of one process's own always-zero counters. view=portals answers each portal's scheduled-run reliability instead.",
        "x-mcp-tool": "health_fleet_get",
        "x-rover-role": "user_admin",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1h",
                "24h",
                "7d",
                "28d"
              ]
            }
          },
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "portals"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Outcomes, timings and open reviews rolled up across every worker pod for a window, or with view=portals each portal's scheduled-run reliability.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "window": {
                          "type": "string",
                          "enum": [
                            "1h",
                            "24h",
                            "7d",
                            "28d"
                          ]
                        },
                        "since": {
                          "type": "string"
                        },
                        "until": {
                          "type": "string"
                        },
                        "tenant": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "outcomes": {
                          "type": "object",
                          "properties": {
                            "started": {
                              "type": "integer"
                            },
                            "finished": {
                              "type": "integer"
                            },
                            "succeeded": {
                              "type": "integer"
                            },
                            "partial": {
                              "type": "integer"
                            },
                            "held": {
                              "type": "integer"
                            },
                            "blocked": {
                              "type": "integer"
                            },
                            "failed": {
                              "type": "integer"
                            },
                            "cancelled": {
                              "type": "integer"
                            },
                            "noVerdict": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "started",
                            "finished",
                            "succeeded",
                            "partial",
                            "held",
                            "blocked",
                            "failed",
                            "cancelled",
                            "noVerdict"
                          ],
                          "additionalProperties": false
                        },
                        "timings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "lane": {
                                "type": "string",
                                "enum": [
                                  "replay",
                                  "explore"
                                ]
                              },
                              "count": {
                                "type": "integer"
                              },
                              "averageSeconds": {
                                "type": "number"
                              },
                              "p90Seconds": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "lane",
                              "count",
                              "averageSeconds",
                              "p90Seconds"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "reviewsWaiting": {
                          "type": "integer"
                        },
                        "retries": {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": "integer"
                            },
                            "sampled": {
                              "type": "integer"
                            },
                            "truncated": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "count",
                            "sampled",
                            "truncated"
                          ],
                          "additionalProperties": false
                        },
                        "lanes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "lane": {
                                "type": "string",
                                "enum": [
                                  "replay",
                                  "explore"
                                ]
                              },
                              "depth": {
                                "type": "integer"
                              },
                              "waitingByPriority": {
                                "type": "object",
                                "properties": {
                                  "1": {
                                    "type": "integer"
                                  },
                                  "5": {
                                    "type": "integer"
                                  },
                                  "10": {
                                    "type": "integer"
                                  }
                                },
                                "required": [
                                  "1",
                                  "5",
                                  "10"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "lane",
                              "depth",
                              "waitingByPriority"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "window",
                        "since",
                        "until",
                        "tenant",
                        "outcomes",
                        "timings",
                        "reviewsWaiting",
                        "retries",
                        "lanes"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "view": {
                          "const": "portals"
                        },
                        "window": {
                          "type": "string",
                          "enum": [
                            "1h",
                            "24h",
                            "7d",
                            "28d"
                          ]
                        },
                        "since": {
                          "type": "string"
                        },
                        "until": {
                          "type": "string"
                        },
                        "tenant": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "portals": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "portal": {
                                "type": "string"
                              },
                              "runs": {
                                "type": "integer"
                              },
                              "withVerdict": {
                                "type": "integer"
                              },
                              "verdictCoverage": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "complete": {
                                "type": "integer"
                              },
                              "misses": {
                                "type": "integer"
                              },
                              "completeRate": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "recovery": {
                                "type": "object",
                                "properties": {
                                  "recovered": {
                                    "type": "integer"
                                  },
                                  "unrecovered": {
                                    "type": "integer"
                                  },
                                  "medianSeconds": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "p90Seconds": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "recovered",
                                  "unrecovered",
                                  "medianSeconds",
                                  "p90Seconds"
                                ],
                                "additionalProperties": false
                              },
                              "openHolds": {
                                "type": "object",
                                "properties": {
                                  "count": {
                                    "type": "integer"
                                  },
                                  "oldestAgeSeconds": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "count",
                                  "oldestAgeSeconds"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "portal",
                              "runs",
                              "withVerdict",
                              "verdictCoverage",
                              "complete",
                              "misses",
                              "completeRate",
                              "recovery",
                              "openHolds"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "view",
                        "window",
                        "since",
                        "until",
                        "tenant",
                        "portals"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/invites/{id}": {
      "delete": {
        "operationId": "invites_revoke",
        "tags": [
          "Team"
        ],
        "summary": "Withdraw an open invite.",
        "description": "Withdraw an open invite. Its link stops working.",
        "x-mcp-tool": "invites_revoke",
        "x-rover-role": "user_admin",
        "x-oauth-allowed": false,
        "x-destructive": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The invite was withdrawn."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/invites/{id}/resend": {
      "post": {
        "operationId": "invites_resend",
        "tags": [
          "Team"
        ],
        "summary": "Mail an open invite again with a fresh link; the old link stops working.",
        "description": "Mail an open invite again with a fresh link; the old link stops working.",
        "x-mcp-tool": "invites_resend",
        "x-rover-role": "user_admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A new invite link was mailed; the old one stopped working.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invite": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "tenant": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "super_admin",
                            "tenant_admin",
                            "tenant_viewer"
                          ]
                        },
                        "inviter": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "invitedBy": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "expired",
                            "accepted",
                            "declined",
                            "revoked"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "tenant",
                        "role",
                        "inviter",
                        "invitedBy",
                        "createdAt",
                        "expiresAt",
                        "status"
                      ],
                      "additionalProperties": false
                    },
                    "inviteSent": {
                      "const": true
                    }
                  },
                  "required": [
                    "invite",
                    "inviteSent"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/invoices": {
      "get": {
        "operationId": "invoices_list",
        "tags": [
          "Accounts"
        ],
        "summary": "Every invoice across every one of this caller's portals, flattened out of the same read accounts_list builds, filtered and paginated.",
        "description": "Every invoice across every one of this caller's portals, flattened out of the same read accounts_list builds, filtered and paginated. `vendor_account` is an account_get key or a bare account number, never this token's own `account` partition.",
        "x-mcp-tool": "invoices_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          },
          {
            "name": "portal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendor_account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 400
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "overdue",
                "paid",
                "credit"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "due_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of invoices across every one of this caller's portals, newest invoice date first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "identityKey": {
                            "type": "string"
                          },
                          "number": {
                            "type": "string"
                          },
                          "invoiceDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "dueDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "total": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "amountDue": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "open",
                              "overdue",
                              "paid",
                              "credit"
                            ]
                          },
                          "documentSha256": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "kind": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastObservedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "carriedCount": {
                            "type": "integer"
                          },
                          "needsReview": {
                            "const": true,
                            "description": "Present when the reading or the row is doubted, so check the portal before acting on the amount."
                          },
                          "flags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "What this row lacks or why it is doubted, each `code` or `code:field`: document_missing, amount_zero, account_unproven, field_missing:<field>. Absent when there is nothing to say."
                          },
                          "portal": {
                            "type": "string"
                          },
                          "customerId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "accountKey": {
                            "type": "string"
                          },
                          "accountNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "accountName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "identityKey",
                          "number",
                          "invoiceDate",
                          "dueDate",
                          "total",
                          "amountDue",
                          "status",
                          "documentSha256",
                          "kind",
                          "lastObservedAt",
                          "carriedCount",
                          "portal",
                          "customerId",
                          "accountKey",
                          "accountNumber",
                          "accountName"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "rows",
                    "total",
                    "limit",
                    "offset"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp_endpoint",
        "tags": [
          "MCP and OAuth"
        ],
        "summary": "The MCP endpoint (Streamable HTTP, JSON-RPC).",
        "description": "The MCP endpoint (Streamable HTTP, JSON-RPC). Accepts an OAuth access token or an API token.",
        "security": [
          {
            "oauth2": []
          },
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON-RPC response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/me/notifications": {
      "get": {
        "operationId": "my_notifications_get",
        "tags": [
          "Account"
        ],
        "summary": "Which notice emails the signed-in person gets, each on or off: portal_read, portal_failed, portal_review, billing, new_invoices, invoice_changed, balance_due and weekly_summary.",
        "description": "Which notice emails the signed-in person gets, each on or off: portal_read, portal_failed, portal_review, billing, new_invoices, invoice_changed, balance_due and weekly_summary.",
        "x-mcp-tool": "my_notifications_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "responses": {
          "200": {
            "description": "The notice kinds, and whether the signed-in person gets each.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kinds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "portal_read",
                          "portal_failed",
                          "portal_review",
                          "billing",
                          "new_invoices",
                          "invoice_changed",
                          "balance_due",
                          "weekly_summary"
                        ]
                      }
                    },
                    "preferences": {
                      "type": "object",
                      "properties": {
                        "portal_read": {
                          "type": "boolean"
                        },
                        "portal_failed": {
                          "type": "boolean"
                        },
                        "portal_review": {
                          "type": "boolean"
                        },
                        "billing": {
                          "type": "boolean"
                        },
                        "new_invoices": {
                          "type": "boolean"
                        },
                        "invoice_changed": {
                          "type": "boolean"
                        },
                        "balance_due": {
                          "type": "boolean"
                        },
                        "weekly_summary": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "portal_read",
                        "portal_failed",
                        "portal_review",
                        "billing",
                        "new_invoices",
                        "invoice_changed",
                        "balance_due",
                        "weekly_summary"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "kinds",
                    "preferences"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "put": {
        "operationId": "my_notifications_set",
        "tags": [
          "Account"
        ],
        "summary": "Turn the signed-in person's notice emails on or off, by kind.",
        "description": "Turn the signed-in person's notice emails on or off, by kind. Sign-in links and invites are always sent.",
        "x-mcp-tool": "my_notifications_set",
        "x-rover-role": "viewer",
        "x-oauth-allowed": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "portal_read": {
                    "type": "boolean"
                  },
                  "portal_failed": {
                    "type": "boolean"
                  },
                  "portal_review": {
                    "type": "boolean"
                  },
                  "billing": {
                    "type": "boolean"
                  },
                  "new_invoices": {
                    "type": "boolean"
                  },
                  "invoice_changed": {
                    "type": "boolean"
                  },
                  "balance_due": {
                    "type": "boolean"
                  },
                  "weekly_summary": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The notice preferences after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kinds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "portal_read",
                          "portal_failed",
                          "portal_review",
                          "billing",
                          "new_invoices",
                          "invoice_changed",
                          "balance_due",
                          "weekly_summary"
                        ]
                      }
                    },
                    "preferences": {
                      "type": "object",
                      "properties": {
                        "portal_read": {
                          "type": "boolean"
                        },
                        "portal_failed": {
                          "type": "boolean"
                        },
                        "portal_review": {
                          "type": "boolean"
                        },
                        "billing": {
                          "type": "boolean"
                        },
                        "new_invoices": {
                          "type": "boolean"
                        },
                        "invoice_changed": {
                          "type": "boolean"
                        },
                        "balance_due": {
                          "type": "boolean"
                        },
                        "weekly_summary": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "portal_read",
                        "portal_failed",
                        "portal_review",
                        "billing",
                        "new_invoices",
                        "invoice_changed",
                        "balance_due",
                        "weekly_summary"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "kinds",
                    "preferences"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/oauth/authorize": {
      "get": {
        "operationId": "oauth_authorize",
        "tags": [
          "MCP and OAuth"
        ],
        "summary": "OAuth authorization endpoint.",
        "description": "OAuth authorization endpoint. Sends the person to the Rover console to approve the app. PKCE with S256 is required.",
        "security": [],
        "responses": {
          "302": {
            "description": "A redirect to the consent page, or back to the client with an error."
          }
        }
      }
    },
    "/oauth/grants": {
      "get": {
        "operationId": "connected_apps_list",
        "tags": [
          "Account"
        ],
        "summary": "The apps this signed-in person has connected to Rover with OAuth: client name, tenant, when connected and last used.",
        "description": "The apps this signed-in person has connected to Rover with OAuth: client name, tenant, when connected and last used. A service token has none.",
        "x-mcp-tool": "connected_apps_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "responses": {
          "200": {
            "description": "Apps connected with OAuth.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "clientId": {
                            "type": "string"
                          },
                          "clientName": {
                            "type": "string"
                          },
                          "tenant": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "super_admin",
                              "tenant_admin",
                              "tenant_viewer"
                            ]
                          },
                          "resource": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "lastUsedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "clientId",
                          "clientName",
                          "tenant",
                          "role",
                          "resource",
                          "createdAt",
                          "lastUsedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "apps"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/oauth/grants/{id}": {
      "delete": {
        "operationId": "connected_apps_revoke",
        "tags": [
          "Account"
        ],
        "summary": "Disconnect one of this person's connected apps.",
        "description": "Disconnect one of this person's connected apps. Its tokens stop working at once.",
        "x-mcp-tool": "connected_apps_revoke",
        "x-rover-role": "viewer",
        "x-oauth-allowed": false,
        "x-destructive": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Disconnected."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/oauth/register": {
      "post": {
        "operationId": "oauth_register",
        "tags": [
          "MCP and OAuth"
        ],
        "summary": "OAuth dynamic client registration (RFC 7591).",
        "description": "OAuth dynamic client registration (RFC 7591). MCP clients call this themselves.",
        "security": [],
        "responses": {
          "201": {
            "description": "The registered client.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/revoke": {
      "post": {
        "operationId": "oauth_revoke",
        "tags": [
          "MCP and OAuth"
        ],
        "summary": "OAuth token revocation (RFC 7009), called by the client that holds the token.",
        "description": "OAuth token revocation (RFC 7009), called by the client that holds the token.",
        "security": [],
        "responses": {
          "200": {
            "description": "Revoked, or already unknown."
          }
        }
      }
    },
    "/oauth/token": {
      "post": {
        "operationId": "oauth_token",
        "tags": [
          "MCP and OAuth"
        ],
        "summary": "OAuth token endpoint: exchanges an authorization code (with its PKCE verifier) or a refresh token for an access token.",
        "description": "OAuth token endpoint: exchanges an authorization code (with its PKCE verifier) or a refresh token for an access token.",
        "security": [],
        "responses": {
          "200": {
            "description": "An access token, valid for one hour, and a refresh token.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/offers": {
      "get": {
        "operationId": "offers_matrix",
        "tags": [
          "Catalog"
        ],
        "summary": "Portal × record-type × offered status across every portal this caller can see.",
        "description": "Portal × record-type × offered status across every portal this caller can see. Filter with entity and/or field, e.g. 'which portals give me due_date'.",
        "x-mcp-tool": "offers_matrix",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "field",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            }
          },
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "Portals with the record types they offer, narrowed by `entity` and `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entity": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "field": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "portals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "host": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "offers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "entity": {
                                  "type": "string"
                                },
                                "offered": {
                                  "type": "string",
                                  "enum": [
                                    "yes",
                                    "maybe",
                                    "no",
                                    "unknown"
                                  ]
                                },
                                "evidence": {
                                  "type": "string",
                                  "enum": [
                                    "records",
                                    "recipe",
                                    "map",
                                    "none"
                                  ]
                                },
                                "where": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "note": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "fields": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string"
                                      },
                                      "filled": {
                                        "type": "integer"
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "filled"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "fieldNames": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "records": {
                                  "type": "integer"
                                },
                                "replayable": {
                                  "type": "boolean"
                                },
                                "coverage": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "enum": [
                                    "supported",
                                    "unsupported",
                                    "unresolved"
                                  ]
                                }
                              },
                              "required": [
                                "entity",
                                "offered",
                                "evidence",
                                "where",
                                "note",
                                "fields",
                                "fieldNames",
                                "records",
                                "replayable",
                                "coverage"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "host",
                          "label",
                          "offers"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "entity",
                    "field",
                    "portals"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/operations": {
      "get": {
        "operationId": "operations_list",
        "tags": [
          "MCP and OAuth"
        ],
        "summary": "Every operation and MCP tool this token is offered, from the same registry the MCP endpoint lists its tools from.",
        "description": "Every operation and MCP tool this token is offered, from the same registry the MCP endpoint lists its tools from.",
        "responses": {
          "200": {
            "description": "The question tools and operations this caller may use.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/payments": {
      "get": {
        "operationId": "payments_list",
        "tags": [
          "Accounts"
        ],
        "summary": "Every payment across every one of this caller's portals, the same shape of read as invoices_list.",
        "description": "Every payment across every one of this caller's portals, the same shape of read as invoices_list.",
        "x-mcp-tool": "payments_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          },
          {
            "name": "portal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendor_account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 400
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of payments across every one of this caller's portals, newest payment date first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "identityKey": {
                            "type": "string"
                          },
                          "paymentDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "amount": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "method": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reference": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "invoiceRef": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastObservedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "carriedCount": {
                            "type": "integer"
                          },
                          "portal": {
                            "type": "string"
                          },
                          "customerId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "accountKey": {
                            "type": "string"
                          },
                          "accountNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "accountName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "identityKey",
                          "paymentDate",
                          "amount",
                          "method",
                          "reference",
                          "invoiceRef",
                          "status",
                          "lastObservedAt",
                          "carriedCount",
                          "portal",
                          "customerId",
                          "accountKey",
                          "accountNumber",
                          "accountName"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "rows",
                    "total",
                    "limit",
                    "offset"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/platforms": {
      "get": {
        "operationId": "platforms_list",
        "tags": [
          "Deployment"
        ],
        "summary": "Every driver platform Rover knows.",
        "description": "Every driver platform Rover knows.",
        "x-mcp-tool": "platforms_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "enabled",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeDeprecated",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Platforms.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "platforms": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "driver": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "driverOptions": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "remoteBrowser": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": {}
                          },
                          "defaultQueue": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "deprecated": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "driver",
                          "label",
                          "driverOptions",
                          "remoteBrowser",
                          "defaultQueue",
                          "enabled",
                          "deprecated",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "platforms"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "post": {
        "operationId": "platforms_create",
        "tags": [
          "Administration"
        ],
        "summary": "Register a new driver platform.",
        "description": "Register a new driver platform. The driver name must be unique.",
        "x-mcp-tool": "platforms_create",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "driver": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "driverOptions": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "remoteBrowser": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "defaultQueue": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "deprecated": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "driver",
                  "label"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new platform.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "driver": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "driverOptions": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "remoteBrowser": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": {}
                    },
                    "defaultQueue": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "deprecated": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "driver",
                    "label",
                    "driverOptions",
                    "remoteBrowser",
                    "defaultQueue",
                    "enabled",
                    "deprecated",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/platforms/{id}": {
      "get": {
        "operationId": "platforms_get",
        "tags": [
          "Deployment"
        ],
        "summary": "One platform by its directory id.",
        "description": "One platform by its directory id.",
        "x-mcp-tool": "platforms_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The platform.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "driver": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "driverOptions": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "remoteBrowser": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": {}
                    },
                    "defaultQueue": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "deprecated": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "driver",
                    "label",
                    "driverOptions",
                    "remoteBrowser",
                    "defaultQueue",
                    "enabled",
                    "deprecated",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "put": {
        "operationId": "platforms_update",
        "tags": [
          "Administration"
        ],
        "summary": "Patch a platform.",
        "description": "Patch a platform. Every field optional; only the ones given change.",
        "x-mcp-tool": "platforms_update",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "driver": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "driverOptions": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "remoteBrowser": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "defaultQueue": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "deprecated": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The platform after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "driver": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "driverOptions": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "remoteBrowser": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": {}
                    },
                    "defaultQueue": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "deprecated": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "driver",
                    "label",
                    "driverOptions",
                    "remoteBrowser",
                    "defaultQueue",
                    "enabled",
                    "deprecated",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portal-directory": {
      "get": {
        "operationId": "portal_directory_list",
        "tags": [
          "Administration"
        ],
        "summary": "Every host in the directory's approval state (approved, pending, rejected, suspended) with its open requests.",
        "description": "Every host in the directory's approval state (approved, pending, rejected, suspended) with its open requests.",
        "x-mcp-tool": "portal_directory_list",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "approved",
                "pending",
                "rejected",
                "suspended"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every host's approval state, with its open requests.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "portals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "host": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "approved",
                              "pending",
                              "rejected",
                              "suspended"
                            ]
                          },
                          "note": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "decidedBy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "decidedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "openRequests": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "tenantId": {
                                  "type": "string"
                                },
                                "account": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "host": {
                                  "type": "string"
                                },
                                "loginUrl": {
                                  "type": "string"
                                },
                                "credentialId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "approved",
                                    "pending",
                                    "rejected"
                                  ]
                                },
                                "prescreen": {
                                  "type": [
                                    "object",
                                    "null"
                                  ],
                                  "additionalProperties": {}
                                },
                                "reason": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "requestedAt": {
                                  "type": "string"
                                },
                                "decidedBy": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "decidedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "account",
                                "host",
                                "loginUrl",
                                "credentialId",
                                "status",
                                "prescreen",
                                "reason",
                                "requestedAt",
                                "decidedBy",
                                "decidedAt"
                              ],
                              "additionalProperties": false,
                              "description": "A tenant's own request that a host be reviewed (DIS-2435). No secret is on this shape."
                            }
                          }
                        },
                        "required": [
                          "host",
                          "status",
                          "note",
                          "decidedBy",
                          "decidedAt",
                          "createdAt",
                          "updatedAt",
                          "openRequests"
                        ],
                        "additionalProperties": false,
                        "description": "One host's approval state in the central portal directory (DIS-2435)."
                      }
                    }
                  },
                  "required": [
                    "portals"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portal-directory/{host}/approve": {
      "post": {
        "operationId": "portal_directory_approve",
        "tags": [
          "Administration"
        ],
        "summary": "Approve a host.",
        "description": "Approve a host. Starts the first learning run for every tenant request this resolves.",
        "x-mcp-tool": "portal_directory_approve",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The host's new approval state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "host": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "approved",
                        "pending",
                        "rejected",
                        "suspended"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decidedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decidedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "startedRuns": {
                      "type": "integer",
                      "description": "How many resolved requests' first run was started."
                    }
                  },
                  "required": [
                    "host",
                    "status",
                    "note",
                    "decidedBy",
                    "decidedAt",
                    "createdAt",
                    "updatedAt",
                    "startedRuns"
                  ],
                  "additionalProperties": false,
                  "description": "One host's approval state in the central portal directory (DIS-2435)."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portal-directory/{host}/reject": {
      "post": {
        "operationId": "portal_directory_reject",
        "tags": [
          "Administration"
        ],
        "summary": "Reject a host.",
        "description": "Reject a host. Every tenant with a pending request for it sees the reason.",
        "x-mcp-tool": "portal_directory_reject",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The host's new approval state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "host": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "approved",
                        "pending",
                        "rejected",
                        "suspended"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decidedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decidedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "host",
                    "status",
                    "note",
                    "decidedBy",
                    "decidedAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false,
                  "description": "One host's approval state in the central portal directory (DIS-2435)."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portal-directory/{host}/suspend": {
      "post": {
        "operationId": "portal_directory_suspend",
        "tags": [
          "Administration"
        ],
        "summary": "Pause a previously approved host for every tenant, without deciding any open request against it.",
        "description": "Pause a previously approved host for every tenant, without deciding any open request against it.",
        "x-mcp-tool": "portal_directory_suspend",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The host's new approval state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "host": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "approved",
                        "pending",
                        "rejected",
                        "suspended"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decidedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decidedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "host",
                    "status",
                    "note",
                    "decidedBy",
                    "decidedAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false,
                  "description": "One host's approval state in the central portal directory (DIS-2435)."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portal-requests": {
      "post": {
        "operationId": "portal_requests_create",
        "tags": [
          "Portals"
        ],
        "summary": "Ask that a host be reviewed.",
        "description": "Ask that a host be reviewed. Mainly for re-asking after a rejection. POST /v1/credentials already files one for a new, unapproved host.",
        "x-mcp-tool": "portal_requests_create",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "portal": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "portal"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The filed or reopened request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "tenantId": {
                      "type": "string"
                    },
                    "account": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "host": {
                      "type": "string"
                    },
                    "loginUrl": {
                      "type": "string"
                    },
                    "credentialId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "approved",
                        "pending",
                        "rejected"
                      ]
                    },
                    "prescreen": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": {}
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "requestedAt": {
                      "type": "string"
                    },
                    "decidedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decidedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "tenantId",
                    "account",
                    "host",
                    "loginUrl",
                    "credentialId",
                    "status",
                    "prescreen",
                    "reason",
                    "requestedAt",
                    "decidedBy",
                    "decidedAt"
                  ],
                  "additionalProperties": false,
                  "description": "A tenant's own request that a host be reviewed (DIS-2435). No secret is on this shape."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "get": {
        "operationId": "portal_requests_list",
        "tags": [
          "Portals"
        ],
        "summary": "The caller's own portal requests, or every tenant's for an admin-scoped token (narrow with tenant).",
        "description": "The caller's own portal requests, or every tenant's for an admin-scoped token (narrow with tenant).",
        "x-mcp-tool": "portal_requests_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The caller's own portal requests, or every tenant's for an admin-scoped token.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requests": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "tenantId": {
                            "type": "string"
                          },
                          "account": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "host": {
                            "type": "string"
                          },
                          "loginUrl": {
                            "type": "string"
                          },
                          "credentialId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "approved",
                              "pending",
                              "rejected"
                            ]
                          },
                          "prescreen": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": {}
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "requestedAt": {
                            "type": "string"
                          },
                          "decidedBy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "decidedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "tenantId",
                          "account",
                          "host",
                          "loginUrl",
                          "credentialId",
                          "status",
                          "prescreen",
                          "reason",
                          "requestedAt",
                          "decidedBy",
                          "decidedAt"
                        ],
                        "additionalProperties": false,
                        "description": "A tenant's own request that a host be reviewed (DIS-2435). No secret is on this shape."
                      }
                    }
                  },
                  "required": [
                    "requests"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portals": {
      "get": {
        "operationId": "portals_list",
        "tags": [
          "Portals"
        ],
        "summary": "Every portal Rover knows, filterable by host, driver and enabled state.",
        "description": "Every portal Rover knows, filterable by host, driver and enabled state.",
        "x-mcp-tool": "portals_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "driver",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "enabled",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeDeprecated",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Portals.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "portals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "platformId": {
                            "type": "string"
                          },
                          "driver": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "host": {
                            "type": "string"
                          },
                          "loginUrl": {
                            "type": "string"
                          },
                          "driverOptions": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "effectiveDriverOptions": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "driverOptionsVersion": {
                            "type": "integer"
                          },
                          "features": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "deprecated": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "platformId",
                          "driver",
                          "label",
                          "host",
                          "loginUrl",
                          "driverOptions",
                          "effectiveDriverOptions",
                          "driverOptionsVersion",
                          "features",
                          "enabled",
                          "deprecated",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "portals"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "post": {
        "operationId": "portals_create",
        "tags": [
          "Administration"
        ],
        "summary": "Register a new portal against a platform (by platformId, platform label, or driver name).",
        "description": "Register a new portal against a platform (by platformId, platform label, or driver name).",
        "x-mcp-tool": "portals_create",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "loginUrl": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "platformId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "platform": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "driver": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "driverOptions": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "features": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "deprecated": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "label",
                  "loginUrl"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new portal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "platformId": {
                      "type": "string"
                    },
                    "driver": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "host": {
                      "type": "string"
                    },
                    "loginUrl": {
                      "type": "string"
                    },
                    "driverOptions": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "effectiveDriverOptions": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "driverOptionsVersion": {
                      "type": "integer"
                    },
                    "features": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "deprecated": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "platformId",
                    "driver",
                    "label",
                    "host",
                    "loginUrl",
                    "driverOptions",
                    "effectiveDriverOptions",
                    "driverOptionsVersion",
                    "features",
                    "enabled",
                    "deprecated",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portals/{host}/candidates": {
      "get": {
        "operationId": "healing_candidates_list",
        "tags": [
          "Administration"
        ],
        "summary": "Filed recipe candidates for a portal, not yet promoted, with why each was filed.",
        "description": "Filed recipe candidates for a portal, not yet promoted, with why each was filed.",
        "x-mcp-tool": "healing_candidates_list",
        "x-rover-role": "admin",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Filed candidates, not yet promoted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "host": {
                      "type": "string"
                    },
                    "candidates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "digest": {
                            "type": "string"
                          },
                          "filedAt": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "sourceRunId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "customer": {
                            "type": "string"
                          },
                          "account": {
                            "type": "string"
                          },
                          "promotable": {
                            "type": "boolean"
                          },
                          "reason": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "digest",
                          "filedAt",
                          "source",
                          "sourceRunId",
                          "promotable"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "host",
                    "candidates"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portals/{host}/candidates/{digest}/promote": {
      "post": {
        "operationId": "healing_promote",
        "tags": [
          "Administration"
        ],
        "summary": "Pin a filed candidate recipe by queuing a run against it.",
        "description": "Pin a filed candidate recipe by queuing a run against it. The candidate must already be filed.",
        "x-mcp-tool": "healing_promote",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "digest",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "credentialId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "requestId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  },
                  "options": {
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A run for this portal and login was already queued or running, or this requestId was seen; that run is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    },
                    "duplicate": {
                      "const": true
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "request_id",
                        "in_flight"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "prioritized",
                        "delayed",
                        "active",
                        "completed",
                        "failed",
                        "stalled",
                        "unknown"
                      ]
                    },
                    "startedAt": {
                      "type": "string"
                    },
                    "runId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "resolvedType": {
                      "type": "string"
                    },
                    "firstTouch": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "requestId",
                    "duplicate",
                    "reason",
                    "state",
                    "startedAt",
                    "runId",
                    "type",
                    "portal"
                  ],
                  "additionalProperties": false,
                  "description": "The run already doing this work."
                }
              }
            }
          },
          "202": {
            "description": "A new run was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "duplicate": {
                      "const": false
                    },
                    "type": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "state": {
                      "const": "queued"
                    },
                    "lane": {
                      "type": "string",
                      "enum": [
                        "replay",
                        "explore"
                      ]
                    },
                    "priority": {
                      "type": "number"
                    },
                    "waitingAhead": {
                      "type": "integer"
                    },
                    "resolvedType": {
                      "type": "string"
                    },
                    "firstTouch": {
                      "type": "boolean"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "requestId",
                    "duplicate",
                    "type",
                    "portal",
                    "state",
                    "lane",
                    "priority"
                  ],
                  "additionalProperties": false,
                  "description": "A new run, queued."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portals/{host}/changes": {
      "get": {
        "operationId": "changes",
        "tags": [
          "Records"
        ],
        "summary": "What moved between readings: records added or removed, and fields whose value changed.",
        "description": "What moved between readings: records added or removed, and fields whose value changed. Severity notable means money, a status, or an account or service appearing or going away. Answers about one portal. There is no view across vendors here; pass customer to narrow to one customer of that portal.",
        "x-mcp-tool": "changes",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "description": "The portal host, for example `portal.example-hauler.test`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows to one customer of that portal. Optional."
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows within authorized account access. Null selects readings without an account."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "ISO 8601, inclusive."
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "ISO 8601, inclusive."
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "notable",
                "minor"
              ]
            }
          },
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer, with a one-line `says` caveat naming when the reading was taken.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "tool": {
                      "const": "changes"
                    },
                    "says": {
                      "type": "string"
                    },
                    "answer": {
                      "$ref": "#/components/schemas/ChangesAnswer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/QuestionError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/QuestionError"
          },
          "503": {
            "$ref": "#/components/responses/QuestionError"
          }
        }
      }
    },
    "/portals/{host}/coverage": {
      "get": {
        "operationId": "coverage",
        "tags": [
          "Records"
        ],
        "summary": "The completeness score of the newest reading, and the scores before it, oldest first.",
        "description": "The completeness score of the newest reading, and the scores before it, oldest first. Answers about one portal. There is no view across vendors here; pass customer to narrow to one customer of that portal.",
        "x-mcp-tool": "coverage",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "description": "The portal host, for example `portal.example-hauler.test`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows to one customer of that portal. Optional."
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows within authorized account access. Null selects readings without an account."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer, with a one-line `says` caveat naming when the reading was taken.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "tool": {
                      "const": "coverage"
                    },
                    "says": {
                      "type": "string"
                    },
                    "answer": {
                      "$ref": "#/components/schemas/CoverageAnswer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/QuestionError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/QuestionError"
          },
          "503": {
            "$ref": "#/components/responses/QuestionError"
          }
        }
      }
    },
    "/portals/{host}/documents/{sha256}/text": {
      "get": {
        "operationId": "invoice_text",
        "tags": [
          "Records"
        ],
        "summary": "The text layer of one stored document, by the sha256 of its bytes, with the records that cite it.",
        "description": "The text layer of one stored document, by the sha256 of its bytes, with the records that cite it. The document is readable only where a record on that portal cites it, so a digest from one customer's invoice reads nothing under another's. The answer carries asOf and coverage.",
        "x-mcp-tool": "invoice_text",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "description": "The portal host, for example `portal.example-hauler.test`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows to one customer of that portal. Optional."
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows within authorized account access. Null selects readings without an account."
          },
          {
            "name": "sha256",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer, with a one-line `says` caveat naming when the reading was taken.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "tool": {
                      "const": "invoice_text"
                    },
                    "says": {
                      "type": "string"
                    },
                    "answer": {
                      "$ref": "#/components/schemas/InvoiceTextAnswer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/QuestionError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/QuestionError"
          },
          "503": {
            "$ref": "#/components/responses/QuestionError"
          }
        }
      }
    },
    "/portals/{host}/health": {
      "get": {
        "operationId": "portal_health",
        "tags": [
          "Records"
        ],
        "summary": "Whether a portal is still being read: last run, how it ended, coverage, the recipe digest it replayed, and the most recent change.",
        "description": "Whether a portal is still being read: last run, how it ended, coverage, the recipe digest it replayed, and the most recent change. A portal whose last run is weeks old has records that are weeks old.",
        "x-mcp-tool": "portal_health",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "description": "The portal host, for example `portal.example-hauler.test`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer, with a one-line `says` caveat naming when the reading was taken.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "tool": {
                      "const": "portal_health"
                    },
                    "says": {
                      "type": "string"
                    },
                    "answer": {
                      "$ref": "#/components/schemas/PortalHealthAnswer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/QuestionError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/QuestionError"
          },
          "503": {
            "$ref": "#/components/responses/QuestionError"
          }
        }
      }
    },
    "/portals/{host}/hints": {
      "get": {
        "operationId": "portal_hints_get",
        "tags": [
          "Portals"
        ],
        "summary": "This tenant's own durable \"Teach Rover\" hints for a portal host: where each entity or field lives, saved by a person and reused by every learning run since.",
        "description": "This tenant's own durable \"Teach Rover\" hints for a portal host: where each entity or field lives, saved by a person and reused by every learning run since.",
        "x-mcp-tool": "portal_hints_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "This tenant's saved hints for the portal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hints": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "tenantId": {
                            "type": "string"
                          },
                          "host": {
                            "type": "string"
                          },
                          "entity": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "field": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "note": {
                            "type": "string"
                          },
                          "path": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "steps": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "repeat": {
                                  "const": "each_row"
                                }
                              },
                              "required": [
                                "label"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "createdBy": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "tenantId",
                          "host",
                          "entity",
                          "field",
                          "note",
                          "path",
                          "steps",
                          "createdBy",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "hints"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "put": {
        "operationId": "portal_hints_set",
        "tags": [
          "Portals"
        ],
        "summary": "Save this tenant's hint for one entity (or field) on a portal host, replacing whatever it saved there before.",
        "description": "Save this tenant's hint for one entity (or field) on a portal host, replacing whatever it saved there before. Every learning run on this host from now on. Explore, coverage and repair. Merges it in.",
        "x-mcp-tool": "portal_hints_set",
        "x-rover-role": "user_admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entity": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "field": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  "path": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "repeat": {
                          "const": "each_row"
                        }
                      },
                      "required": [
                        "label"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "note"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved hint.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "tenantId": {
                      "type": "string"
                    },
                    "host": {
                      "type": "string"
                    },
                    "entity": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "field": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "type": "string"
                    },
                    "path": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string"
                          },
                          "repeat": {
                            "const": "each_row"
                          }
                        },
                        "required": [
                          "label"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "tenantId",
                    "host",
                    "entity",
                    "field",
                    "note",
                    "path",
                    "steps",
                    "createdBy",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "delete": {
        "operationId": "portal_hints_delete",
        "tags": [
          "Portals"
        ],
        "summary": "Retire this tenant's hint for one entity (or field) on a portal host.",
        "description": "Retire this tenant's hint for one entity (or field) on a portal host. Not in the agreed MCP surface for this feature.",
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Retired.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/portals/{host}/history": {
      "get": {
        "operationId": "record_history",
        "tags": [
          "Records"
        ],
        "summary": "Every stored version of one record, oldest first, with the fields that moved between them.",
        "description": "Every stored version of one record, oldest first, with the fields that moved between them. goneFromLatest is true when the newest reading no longer carries it. Answers about one portal. There is no view across vendors here; pass customer to narrow to one customer of that portal.",
        "x-mcp-tool": "record_history",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "description": "The portal host, for example `portal.example-hauler.test`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows to one customer of that portal. Optional."
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows within authorized account access. Null selects readings without an account."
          },
          {
            "name": "entity",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "identity",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "The record identity key, as latest_records reports it."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer, with a one-line `says` caveat naming when the reading was taken.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "tool": {
                      "const": "record_history"
                    },
                    "says": {
                      "type": "string"
                    },
                    "answer": {
                      "$ref": "#/components/schemas/RecordHistoryAnswer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/QuestionError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/QuestionError"
          },
          "503": {
            "$ref": "#/components/responses/QuestionError"
          }
        }
      }
    },
    "/portals/{host}/learning": {
      "get": {
        "operationId": "portal_learning",
        "tags": [
          "Portals"
        ],
        "summary": "Read current fresh discovery status for stored logins in the selected tenant scope.",
        "description": "Read current fresh discovery status for stored logins in the selected tenant scope.",
        "x-mcp-tool": "portal_learning",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "allTenants",
            "in": "query",
            "required": false,
            "schema": {
              "const": "true"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current reset discovery per login.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "logins": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "credentialId": {
                            "type": "string"
                          },
                          "tenant": {
                            "type": "string"
                          },
                          "account": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "customer": {
                            "type": "string"
                          },
                          "generation": {
                            "type": "integer",
                            "exclusiveMinimum": 0
                          },
                          "runId": {
                            "type": "string"
                          },
                          "jobId": {
                            "type": "string"
                          },
                          "lifecycle": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "credentialId",
                          "tenant",
                          "account",
                          "customer",
                          "generation",
                          "runId",
                          "jobId",
                          "lifecycle"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "logins"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portals/{host}/offers": {
      "get": {
        "operationId": "portals_offers",
        "tags": [
          "Portals"
        ],
        "summary": "What one portal offers, per record type, with field fill counts.",
        "description": "What one portal offers, per record type, with field fill counts. Tenant-scoped.",
        "x-mcp-tool": "portals_offers",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "What the portal offers, per record type.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "host": {
                      "type": "string"
                    },
                    "asOf": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pinDigest": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "offers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entity": {
                            "type": "string"
                          },
                          "offered": {
                            "type": "string",
                            "enum": [
                              "yes",
                              "maybe",
                              "no",
                              "unknown"
                            ]
                          },
                          "evidence": {
                            "type": "string",
                            "enum": [
                              "records",
                              "recipe",
                              "map",
                              "none"
                            ]
                          },
                          "where": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "note": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "fields": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "filled": {
                                  "type": "integer"
                                }
                              },
                              "required": [
                                "name",
                                "filled"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "fieldNames": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "records": {
                            "type": "integer"
                          },
                          "replayable": {
                            "type": "boolean"
                          },
                          "coverage": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "supported",
                              "unsupported",
                              "unresolved"
                            ]
                          }
                        },
                        "required": [
                          "entity",
                          "offered",
                          "evidence",
                          "where",
                          "note",
                          "fields",
                          "fieldNames",
                          "records",
                          "replayable",
                          "coverage"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "host",
                    "asOf",
                    "pinDigest",
                    "offers"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portals/{host}/page": {
      "get": {
        "operationId": "page_text",
        "tags": [
          "Records"
        ],
        "summary": "One archived page as Markdown, by url or by the sha256 page_search reported.",
        "description": "One archived page as Markdown, by url or by the sha256 page_search reported. It is what the page said when it was last read, tables included, not what it says now: capturedAt is when it was read and asOf and coverage describe the run that read it.",
        "x-mcp-tool": "page_text",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "description": "The portal host, for example `portal.example-hauler.test`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows to one customer of that portal. Optional."
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows within authorized account access. Null selects readings without an account."
          },
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            },
            "description": "The page url, without a query or fragment. Give this or sha256."
          },
          {
            "name": "sha256",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "description": "The digest of the page text, as page_search reports it."
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer, with a one-line `says` caveat naming when the reading was taken.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "tool": {
                      "const": "page_text"
                    },
                    "says": {
                      "type": "string"
                    },
                    "answer": {
                      "$ref": "#/components/schemas/PageTextAnswer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/QuestionError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/QuestionError"
          },
          "503": {
            "$ref": "#/components/responses/QuestionError"
          }
        }
      }
    },
    "/portals/{host}/pages": {
      "get": {
        "operationId": "page_search",
        "tags": [
          "Records"
        ],
        "summary": "Full text over the pages a run read, kept as Markdown.",
        "description": "Full text over the pages a run read, kept as Markdown. Use it for anything the record fields do not have a column for: a service label, a note under a table, a surcharge, a line of small print. Returns the url, the title, when that text was last seen and the matching line -- call page_text for the page itself. The answer carries asOf and coverage like every other, and capturedAt on each hit is when that page was last read. Answers about one portal. There is no view across vendors here; pass customer to narrow to one customer of that portal.",
        "x-mcp-tool": "page_search",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "description": "The portal host, for example `portal.example-hauler.test`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows to one customer of that portal. Optional."
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows within authorized account access. Null selects readings without an account."
          },
          {
            "name": "text",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 400
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "ISO 8601. Only readings taken at or after this moment."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer, with a one-line `says` caveat naming when the reading was taken.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "tool": {
                      "const": "page_search"
                    },
                    "says": {
                      "type": "string"
                    },
                    "answer": {
                      "$ref": "#/components/schemas/PageSearchAnswer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/QuestionError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/QuestionError"
          },
          "503": {
            "$ref": "#/components/responses/QuestionError"
          }
        }
      }
    },
    "/portals/{host}/pin": {
      "get": {
        "operationId": "portals_pin",
        "tags": [
          "Portals"
        ],
        "summary": "The recipe currently pinned for a portal host.",
        "description": "The recipe currently pinned for a portal host.",
        "x-mcp-tool": "portals_pin",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The pin.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "host": {
                      "type": "string"
                    },
                    "recipeDigest": {
                      "type": "string"
                    },
                    "recipePath": {
                      "type": "string"
                    },
                    "credentialHandle": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "credentialId": {
                      "type": "string"
                    },
                    "entities": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "coverage": {
                      "description": "What the pinned recipe did not read, measured when it was pinned."
                    },
                    "fallback": {
                      "type": "object",
                      "properties": {
                        "recipeDigest": {
                          "type": "string"
                        },
                        "recipePath": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "recipeDigest",
                        "recipePath"
                      ],
                      "additionalProperties": false
                    },
                    "probation": {
                      "type": "object",
                      "properties": {
                        "since": {
                          "type": "string"
                        },
                        "floor": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "number"
                          }
                        },
                        "disagreements": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "entity": {
                                "type": "string"
                              },
                              "field": {
                                "type": "string"
                              },
                              "rows": {
                                "type": "integer"
                              }
                            },
                            "required": [
                              "entity",
                              "field",
                              "rows"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "notes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "judged": {
                          "type": "object",
                          "properties": {
                            "verdict": {
                              "const": "benign"
                            },
                            "reason": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "verdict",
                            "reason"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "since",
                        "floor",
                        "disagreements",
                        "notes"
                      ],
                      "additionalProperties": false,
                      "description": "Present while the pin is on probation: it read everything the pin before it read, and its graded replays disagreed only on field values. A clean scheduled read ends it; a read with fewer records puts the previous pin back."
                    },
                    "gaps": {
                      "type": "object",
                      "properties": {
                        "recipeDigest": {
                          "type": "string"
                        },
                        "gaps": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "entity": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "detail": {
                                "type": "string"
                              },
                              "missing": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "code",
                              "entity",
                              "detail",
                              "missing"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "recipeDigest",
                        "gaps"
                      ],
                      "additionalProperties": false,
                      "description": "The gaps the recipe was pinned with, and the recipe they were measured on: open work, such as invoices without a PDF or a stated total the reading misses. A later repair that is no worse on each of them may replace the pin."
                    }
                  },
                  "required": [
                    "host",
                    "recipeDigest",
                    "recipePath",
                    "updatedAt"
                  ],
                  "additionalProperties": false,
                  "description": "The pinned recipe. The login it was pinned with is shown only to a caller that holds that login."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portals/{host}/recipe": {
      "get": {
        "operationId": "portals_recipe",
        "tags": [
          "Portals"
        ],
        "summary": "What the pinned (or a named superseded) recipe does, selector-free.",
        "description": "What the pinned (or a named superseded) recipe does, selector-free.",
        "x-mcp-tool": "portals_recipe",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "digest",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What the recipe reads, per record type.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "contractRevision": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "stepCount": {
                      "type": "integer"
                    },
                    "entities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entity": {
                            "type": "string"
                          },
                          "route": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reader": {
                            "type": "string",
                            "enum": [
                              "endpoint",
                              "table"
                            ]
                          },
                          "loops": {
                            "type": "boolean"
                          },
                          "steps": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "entity",
                          "route",
                          "reader",
                          "loops",
                          "steps"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "host": {
                      "type": "string"
                    },
                    "digest": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "contractRevision",
                    "stepCount",
                    "entities",
                    "host",
                    "digest"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portals/{host}/recipe.ts": {
      "get": {
        "operationId": "portal_recipe_typescript",
        "tags": [
          "Portals"
        ],
        "summary": "A portal's pinned recipe as a readable TypeScript file: a standalone Playwright script, or a driver skeleton shaped for the older `main`-branch Rover.",
        "description": "A portal's pinned recipe as a readable TypeScript file: a standalone Playwright script, or a driver skeleton shaped for the older `main`-branch Rover. Super admin only. `target` is `standalone` (default) or `legacy-driver`; `digest` reads an earlier recipe instead of the pin's current one.",
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The generated file.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "The caller is not a super admin."
          },
          "404": {
            "description": "That portal is not pinned, or no recipe is stored under the given digest."
          }
        }
      }
    },
    "/portals/{host}/records": {
      "get": {
        "operationId": "latest_records",
        "tags": [
          "Records"
        ],
        "summary": "The newest stored reading of a portal, optionally one entity and filtered by field value.",
        "description": "The newest stored reading of a portal, optionally one entity and filtered by field value. Every answer carries asOf (when the reading was taken) and coverage (0-100, how complete it was). Answers about one portal. There is no view across vendors here; pass customer to narrow to one customer of that portal.",
        "x-mcp-tool": "latest_records",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "description": "The portal host, for example `portal.example-hauler.test`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows to one customer of that portal. Optional."
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows within authorized account access. Null selects readings without an account."
          },
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "description": "locations, services, vendor_accounts, vendor_invoices, vendor_payments, work_orders, pickups or documents."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "string",
                "maxLength": 400
              }
            },
            "description": "Field name to value, matched exactly and case-insensitively against the printed value. Send as `filters[status]=open`.",
            "style": "deepObject",
            "explode": true
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "asOf",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "ISO 8601. Answers from the last reading at or before this moment."
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer, with a one-line `says` caveat naming when the reading was taken.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "tool": {
                      "const": "latest_records"
                    },
                    "says": {
                      "type": "string"
                    },
                    "answer": {
                      "$ref": "#/components/schemas/LatestRecordsAnswer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/QuestionError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/QuestionError"
          },
          "503": {
            "$ref": "#/components/responses/QuestionError"
          }
        }
      }
    },
    "/portals/{host}/reset": {
      "post": {
        "operationId": "portal_reset",
        "tags": [
          "Portals"
        ],
        "summary": "Discard learned portal state for all stored logins in the chosen tenant scope and queue fresh discovery.",
        "description": "Discard learned portal state for all stored logins in the chosen tenant scope and queue fresh discovery. Stored logins and history are preserved.",
        "x-mcp-tool": "portal_reset",
        "x-rover-role": "user_admin",
        "x-oauth-allowed": false,
        "x-destructive": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "requestId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "tenant": {
                    "type": "string"
                  },
                  "allTenants": {
                    "const": true
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "requestId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Fresh discovery was admitted for every stored login in scope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reset": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "state": {
                          "const": "queued"
                        },
                        "loginCount": {
                          "type": "integer",
                          "exclusiveMinimum": 0
                        }
                      },
                      "required": [
                        "id",
                        "state",
                        "loginCount"
                      ],
                      "additionalProperties": false
                    },
                    "runs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "queued": {
                            "const": true
                          },
                          "lane": {
                            "const": "explore"
                          },
                          "type": {
                            "const": "run"
                          },
                          "portal": {
                            "type": "string"
                          },
                          "state": {
                            "const": "queued"
                          },
                          "tenant": {
                            "type": "string"
                          },
                          "account": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "credentialId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "customer": {
                            "type": "string"
                          },
                          "reset": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "generation": {
                                "type": "integer",
                                "exclusiveMinimum": 0
                              },
                              "state": {
                                "const": "queued"
                              }
                            },
                            "required": [
                              "id",
                              "generation",
                              "state"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "id",
                          "runId",
                          "queued",
                          "lane",
                          "type",
                          "portal",
                          "state",
                          "tenant",
                          "account",
                          "credentialId",
                          "customer",
                          "reset"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "reset",
                    "runs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portals/{host}/search": {
      "get": {
        "operationId": "search",
        "tags": [
          "Records"
        ],
        "summary": "Full text over the stored record fields and over the text layer of the documents those records point at.",
        "description": "Full text over the stored record fields and over the text layer of the documents those records point at. Use it when the invoice number is known, or when only a line from the PDF is. The answer carries asOf and coverage like every other. Answers about one portal. There is no view across vendors here; pass customer to narrow to one customer of that portal.",
        "x-mcp-tool": "search",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "description": "The portal host, for example `portal.example-hauler.test`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows to one customer of that portal. Optional."
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Narrows within authorized account access. Null selects readings without an account."
          },
          {
            "name": "text",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 400
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer, with a one-line `says` caveat naming when the reading was taken.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "tool": {
                      "const": "search"
                    },
                    "says": {
                      "type": "string"
                    },
                    "answer": {
                      "$ref": "#/components/schemas/SearchAnswer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/QuestionError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/QuestionError"
          },
          "503": {
            "$ref": "#/components/responses/QuestionError"
          }
        }
      }
    },
    "/portals/{host}/teach": {
      "post": {
        "operationId": "portal_teach",
        "tags": [
          "Portals"
        ],
        "summary": "Save any hints given, then start the one run that fits: a learning run for a portal with no pin yet, or a coverage round against the existing pin, guided by every saved hint.",
        "description": "Save any hints given, then start the one run that fits: a learning run for a portal with no pin yet, or a coverage round against the existing pin, guided by every saved hint. The caller never chooses the job type.",
        "x-mcp-tool": "portal_teach",
        "x-rover-role": "user_admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tenant": {
                    "type": "string"
                  },
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  },
                  "customer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "credentialId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "hints": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "entity": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "field": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "note": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1000
                        },
                        "path": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "steps": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 120
                              },
                              "repeat": {
                                "const": "each_row"
                              }
                            },
                            "required": [
                              "label"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "note"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A run for this portal and login was already queued or running, or this requestId was seen; that run is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    },
                    "duplicate": {
                      "const": true
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "request_id",
                        "in_flight"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "prioritized",
                        "delayed",
                        "active",
                        "completed",
                        "failed",
                        "stalled",
                        "unknown"
                      ]
                    },
                    "startedAt": {
                      "type": "string"
                    },
                    "runId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "resolvedType": {
                      "type": "string"
                    },
                    "firstTouch": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "requestId",
                    "duplicate",
                    "reason",
                    "state",
                    "startedAt",
                    "runId",
                    "type",
                    "portal"
                  ],
                  "additionalProperties": false,
                  "description": "The run already doing this work."
                }
              }
            }
          },
          "202": {
            "description": "A new run was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "duplicate": {
                      "const": false
                    },
                    "type": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "state": {
                      "const": "queued"
                    },
                    "lane": {
                      "type": "string",
                      "enum": [
                        "replay",
                        "explore"
                      ]
                    },
                    "priority": {
                      "type": "number"
                    },
                    "waitingAhead": {
                      "type": "integer"
                    },
                    "resolvedType": {
                      "type": "string"
                    },
                    "firstTouch": {
                      "type": "boolean"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "requestId",
                    "duplicate",
                    "type",
                    "portal",
                    "state",
                    "lane",
                    "priority"
                  ],
                  "additionalProperties": false,
                  "description": "A new run, queued."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portals/{id}": {
      "get": {
        "operationId": "portals_get",
        "tags": [
          "Portals"
        ],
        "summary": "One portal by its directory id.",
        "description": "One portal by its directory id.",
        "x-mcp-tool": "portals_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The portal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "platformId": {
                      "type": "string"
                    },
                    "driver": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "host": {
                      "type": "string"
                    },
                    "loginUrl": {
                      "type": "string"
                    },
                    "driverOptions": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "effectiveDriverOptions": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "driverOptionsVersion": {
                      "type": "integer"
                    },
                    "features": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "deprecated": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "platformId",
                    "driver",
                    "label",
                    "host",
                    "loginUrl",
                    "driverOptions",
                    "effectiveDriverOptions",
                    "driverOptionsVersion",
                    "features",
                    "enabled",
                    "deprecated",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "put": {
        "operationId": "portals_update",
        "tags": [
          "Administration"
        ],
        "summary": "Patch a portal.",
        "description": "Patch a portal. Every field optional; only the ones given change.",
        "x-mcp-tool": "portals_update",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "loginUrl": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "platformId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "platform": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "driver": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "driverOptions": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "features": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "deprecated": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The portal after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "platformId": {
                      "type": "string"
                    },
                    "driver": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "host": {
                      "type": "string"
                    },
                    "loginUrl": {
                      "type": "string"
                    },
                    "driverOptions": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "effectiveDriverOptions": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "driverOptionsVersion": {
                      "type": "integer"
                    },
                    "features": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "deprecated": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "platformId",
                    "driver",
                    "label",
                    "host",
                    "loginUrl",
                    "driverOptions",
                    "effectiveDriverOptions",
                    "driverOptionsVersion",
                    "features",
                    "enabled",
                    "deprecated",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/portals/{id}/recompute-schedule": {
      "post": {
        "operationId": "portals_recompute_schedule",
        "tags": [
          "Administration"
        ],
        "summary": "Recompute a portal's invoice-arrival calendar from its own fetched-invoice history.",
        "description": "Recompute a portal's invoice-arrival calendar from its own fetched-invoice history.",
        "x-mcp-tool": "portals_recompute_schedule",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The recomputed calendar.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "portal": {
                      "type": "string"
                    },
                    "host": {
                      "type": "string"
                    },
                    "calendar": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      }
                    },
                    "updated": {
                      "type": "integer"
                    },
                    "sampled": {
                      "type": "integer"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "portal",
                    "host",
                    "calendar",
                    "updated",
                    "sampled"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/records/documents/withdraw": {
      "post": {
        "operationId": "documents_withdraw",
        "tags": [
          "Administration"
        ],
        "summary": "Hide a wrongly-linked document from the latest view.",
        "description": "Hide a wrongly-linked document from the latest view. Append-only: this never deletes a stored file.",
        "x-mcp-tool": "documents_withdraw",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "x-destructive": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "portal": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "customer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "sha256": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  },
                  "recipeDigest": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  }
                },
                "required": [
                  "portal"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was withdrawn.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "portal": {
                      "type": "string"
                    },
                    "withdrawn": {
                      "type": "integer"
                    },
                    "digests": {
                      "type": "integer"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "portal",
                    "withdrawn",
                    "digests",
                    "reason"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/runs": {
      "post": {
        "operationId": "runs_start",
        "tags": [
          "Runs"
        ],
        "summary": "Start a run against a portal, or fold into the run already doing this work.",
        "description": "Start a run against a portal, or fold into the run already doing this work. An admin may pass tenant to start it as a named tenant instead of its own.",
        "x-mcp-tool": "runs_start",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "run",
                      "explore",
                      "scope-navigation",
                      "replay",
                      "grade"
                    ]
                  },
                  "refresh": {
                    "type": "boolean"
                  },
                  "portal": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "customer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "credentialId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "requestId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  },
                  "options": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "tenant": {
                    "type": "string"
                  },
                  "browser": {
                    "type": "string",
                    "enum": [
                      "local",
                      "hosted"
                    ],
                    "description": "local (default) runs on a Chromium in the worker; hosted signs in there, then moves the session (cookies only) to the hosted browser for the rest of a run or replay"
                  },
                  "accountNumber": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60,
                    "description": "read only this vendor account number of the portal's account list (a run or replay of the pinned recipe)"
                  }
                },
                "required": [
                  "portal"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A run for this portal and login was already queued or running, or this requestId was seen; that run is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    },
                    "duplicate": {
                      "const": true
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "request_id",
                        "in_flight"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "prioritized",
                        "delayed",
                        "active",
                        "completed",
                        "failed",
                        "stalled",
                        "unknown"
                      ]
                    },
                    "startedAt": {
                      "type": "string"
                    },
                    "runId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "resolvedType": {
                      "type": "string"
                    },
                    "firstTouch": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "requestId",
                    "duplicate",
                    "reason",
                    "state",
                    "startedAt",
                    "runId",
                    "type",
                    "portal"
                  ],
                  "additionalProperties": false,
                  "description": "The run already doing this work."
                }
              }
            }
          },
          "202": {
            "description": "A new run was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "duplicate": {
                      "const": false
                    },
                    "type": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "state": {
                      "const": "queued"
                    },
                    "lane": {
                      "type": "string",
                      "enum": [
                        "replay",
                        "explore"
                      ]
                    },
                    "priority": {
                      "type": "number"
                    },
                    "waitingAhead": {
                      "type": "integer"
                    },
                    "resolvedType": {
                      "type": "string"
                    },
                    "firstTouch": {
                      "type": "boolean"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "requestId",
                    "duplicate",
                    "type",
                    "portal",
                    "state",
                    "lane",
                    "priority"
                  ],
                  "additionalProperties": false,
                  "description": "A new run, queued."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "get": {
        "operationId": "runs_list",
        "tags": [
          "Runs"
        ],
        "summary": "This caller's own runs, newest first, filterable by state, type, portal, customer and time.",
        "description": "This caller's own runs, newest first, filterable by state, type, portal, customer and time.",
        "x-mcp-tool": "runs_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "portal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Runs, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "runs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "runId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "type": {
                            "type": "string"
                          },
                          "refresh": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True for a re-learn: a `run` that refreshes how Rover reads the portal. Null once the queue has forgotten the job."
                          },
                          "lane": {
                            "type": "string",
                            "enum": [
                              "replay",
                              "explore"
                            ]
                          },
                          "portal": {
                            "type": "string"
                          },
                          "host": {
                            "type": "string"
                          },
                          "customer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "tenant": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "account": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "waiting",
                              "prioritized",
                              "delayed",
                              "active",
                              "completed",
                              "failed",
                              "stalled",
                              "unknown"
                            ]
                          },
                          "attempts": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "disposition": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "exitCode": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "failure": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "phase": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "disposition": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string"
                              },
                              "nextStep": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "phase",
                              "disposition",
                              "reason",
                              "nextStep"
                            ],
                            "additionalProperties": false,
                            "description": "Why the run ended badly, in plain English."
                          },
                          "startedAt": {
                            "type": "string"
                          },
                          "enqueuedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "finishedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "startedBy": {
                            "anyOf": [
                              {
                                "const": "support"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "\"support\" when Rover support started it on your login."
                          }
                        },
                        "required": [
                          "id",
                          "runId",
                          "type",
                          "refresh",
                          "lane",
                          "portal",
                          "host",
                          "customer",
                          "tenant",
                          "account",
                          "state",
                          "attempts",
                          "disposition",
                          "exitCode",
                          "failure",
                          "startedAt",
                          "enqueuedAt",
                          "finishedAt",
                          "startedBy"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as `cursor` for the next page. Null on the last page."
                    }
                  },
                  "required": [
                    "runs",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/runs/{id}": {
      "get": {
        "operationId": "runs_get",
        "tags": [
          "Runs"
        ],
        "summary": "One run by id.",
        "description": "One run by id. 404 for a run this caller may not see, same as one that does not exist.",
        "x-mcp-tool": "runs_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "The run.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "prioritized",
                        "delayed",
                        "active",
                        "completed",
                        "failed",
                        "stalled",
                        "unknown"
                      ]
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "refresh": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "True for a re-learn: a `run` that refreshes how Rover reads the portal. Null once the queue has forgotten the job."
                    },
                    "portal": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tenant": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "account": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "attempts": {
                      "type": "integer"
                    },
                    "disposition": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "exitCode": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "runId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "failure": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "phase": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "disposition": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        },
                        "nextStep": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "phase",
                        "disposition",
                        "reason",
                        "nextStep"
                      ],
                      "additionalProperties": false,
                      "description": "Why the run ended badly, in plain English."
                    },
                    "ledger": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "entity": {
                            "type": "string"
                          },
                          "crawl": {
                            "type": "integer"
                          },
                          "api": {
                            "type": "integer"
                          },
                          "recipe": {
                            "type": "integer"
                          },
                          "stored": {
                            "type": "integer"
                          },
                          "seen": {
                            "type": "integer"
                          },
                          "explained": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "entity",
                          "crawl",
                          "api",
                          "recipe",
                          "stored",
                          "seen",
                          "explained"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Rows per entity the run saw (crawl, classified API responses, recipe read steps) against the rows it stored. Counts only. Null for a run that recorded none."
                    },
                    "checkFailed": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "stepPath": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "reason": {
                          "type": "string"
                        },
                        "recipeDigest": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "stepPath",
                        "reason",
                        "recipeDigest"
                      ],
                      "additionalProperties": false,
                      "description": "The explorer's own check replay that refused its recipe: the step, why, and the digest of the candidate recipe the run kept. Null when the check passed or never ran."
                    },
                    "enqueuedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "finishedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "startedBy": {
                      "anyOf": [
                        {
                          "const": "support"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "\"support\" when Rover support started it on your login."
                    }
                  },
                  "required": [
                    "id",
                    "state",
                    "type",
                    "refresh",
                    "portal",
                    "tenant",
                    "account",
                    "attempts",
                    "disposition",
                    "exitCode",
                    "runId",
                    "failure",
                    "ledger",
                    "checkFailed",
                    "enqueuedAt",
                    "finishedAt",
                    "startedBy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/runs/{id}/answer": {
      "post": {
        "operationId": "runs_answer",
        "tags": [
          "Runs"
        ],
        "summary": "Answer a run that is waiting on a one-time code or a typed value.",
        "description": "Answer a run that is waiting on a one-time code or a typed value. The value is never echoed back or logged.",
        "x-mcp-tool": "runs_answer",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "otp",
                      "text"
                    ]
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The answer is recorded; the run collects it at its next check.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "runId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "accepted": {
                      "const": true
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "otp",
                        "text"
                      ]
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "jobId",
                    "runId",
                    "accepted",
                    "kind",
                    "note"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/runs/{id}/cancel": {
      "post": {
        "operationId": "runs_cancel",
        "tags": [
          "Runs"
        ],
        "summary": "Ask a run to stop.",
        "description": "Ask a run to stop. 409 where it has already finished.",
        "x-mcp-tool": "runs_cancel",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "x-destructive": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The cancel is recorded; the run stops at its next check.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "runId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cancelRequested": {
                      "const": true
                    },
                    "requestedBy": {
                      "type": "string"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "jobId",
                    "runId",
                    "cancelRequested",
                    "requestedBy",
                    "note"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/runs/{id}/events/stream": {
      "get": {
        "operationId": "runs_events_stream",
        "tags": [
          "Runs"
        ],
        "summary": "A run's events as a Server-Sent Events stream, live while it runs.",
        "description": "A run's events as a Server-Sent Events stream, live while it runs.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An event stream. Each `data:` line is one run event as JSON.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/runs/{id}/live/stream": {
      "get": {
        "operationId": "runs_live_stream",
        "tags": [
          "Runs"
        ],
        "summary": "What a running run's browser shows, about once a second, as a Server-Sent Events stream.",
        "description": "What a running run's browser shows, about once a second, as a Server-Sent Events stream. The run is cast only while a stream is open.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An event stream of `frame` events, each `{ at, jpeg }` with the JPEG in base64.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "The run has not started, or has finished."
          },
          "503": {
            "description": "This deployment has no live view."
          }
        }
      }
    },
    "/runs/{id}/resolve": {
      "post": {
        "operationId": "runs_resolve",
        "tags": [
          "Runs"
        ],
        "summary": "Steer a run Rover is holding for a person: keep what it found, point it at a hint or a URL, explain a reconciliation mismatch, or try again.",
        "description": "Steer a run Rover is holding for a person: keep what it found, point it at a hint or a URL, explain a reconciliation mismatch, or try again. 409 where the run is not actually waiting on a person, or where `choice` is not one this run offers.",
        "x-mcp-tool": "runs_resolve",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  },
                  "choice": {
                    "type": "string",
                    "enum": [
                      "keep",
                      "point",
                      "explain",
                      "retry"
                    ]
                  },
                  "explanation": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  "hint": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "url": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "choice"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`retry`/`point` only: a run for this portal and login was already queued or running; that run is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    },
                    "duplicate": {
                      "const": true
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "request_id",
                        "in_flight"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "prioritized",
                        "delayed",
                        "active",
                        "completed",
                        "failed",
                        "stalled",
                        "unknown"
                      ]
                    },
                    "startedAt": {
                      "type": "string"
                    },
                    "runId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "resolvedType": {
                      "type": "string"
                    },
                    "firstTouch": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "requestId",
                    "duplicate",
                    "reason",
                    "state",
                    "startedAt",
                    "runId",
                    "type",
                    "portal"
                  ],
                  "additionalProperties": false,
                  "description": "The run already doing this work."
                }
              }
            }
          },
          "202": {
            "description": "`keep`/`explain`: the choice was recorded against the run's reconciliation control. `retry`/`point`: a new run was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "jobId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "runId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "choice": {
                          "type": "string",
                          "enum": [
                            "keep",
                            "explain"
                          ]
                        },
                        "accepted": {
                          "const": true
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "jobId",
                        "runId",
                        "choice",
                        "accepted",
                        "note"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "duplicate": {
                          "const": false
                        },
                        "type": {
                          "type": "string"
                        },
                        "portal": {
                          "type": "string"
                        },
                        "state": {
                          "const": "queued"
                        },
                        "lane": {
                          "type": "string",
                          "enum": [
                            "replay",
                            "explore"
                          ]
                        },
                        "priority": {
                          "type": "number"
                        },
                        "waitingAhead": {
                          "type": "integer"
                        },
                        "resolvedType": {
                          "type": "string"
                        },
                        "firstTouch": {
                          "type": "boolean"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "requestId",
                        "duplicate",
                        "type",
                        "portal",
                        "state",
                        "lane",
                        "priority"
                      ],
                      "additionalProperties": false,
                      "description": "A new run, queued."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/runs/{id}/status": {
      "get": {
        "operationId": "runs_status",
        "tags": [
          "Runs"
        ],
        "summary": "A run reduced to a phase, a fraction done, a sentence, and whether it needs an answer.",
        "description": "A run reduced to a phase, a fraction done, a sentence, and whether it needs an answer.",
        "x-mcp-tool": "runs_status",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "The run as a person reads it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "runId": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "phase": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "checking_session",
                        "logging_in",
                        "surveying",
                        "crawling",
                        "reading",
                        "writing_recipe",
                        "verifying",
                        "grading_replays",
                        "confirming",
                        "pinning",
                        "healing",
                        "exporting",
                        "done",
                        "held",
                        "blocked",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "progress": {
                      "type": "number"
                    },
                    "elapsedMs": {
                      "type": "number"
                    },
                    "etaMs": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "headline": {
                      "type": "string"
                    },
                    "next": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "needsYou": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "records": {
                      "type": "integer"
                    },
                    "lastEventAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "terminal": {
                      "type": "boolean"
                    },
                    "disposition": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "exitCode": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "attempt": {
                      "type": "integer"
                    },
                    "retrying": {
                      "type": "boolean"
                    },
                    "held": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "class": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        },
                        "evidence": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "have": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "entity": {
                                "type": "string"
                              },
                              "count": {
                                "type": "integer"
                              }
                            },
                            "required": [
                              "entity",
                              "count"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "choices": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "keep",
                              "point",
                              "explain",
                              "retry"
                            ]
                          }
                        }
                      },
                      "required": [
                        "class",
                        "reason",
                        "evidence",
                        "have",
                        "choices"
                      ],
                      "additionalProperties": false,
                      "description": "Set only on a run a `held` event stopped, with what a person can do about it (see `POST /v1/runs/:id/resolve`)."
                    },
                    "ledger": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entity": {
                            "type": "string"
                          },
                          "crawl": {
                            "type": "integer"
                          },
                          "api": {
                            "type": "integer"
                          },
                          "recipe": {
                            "type": "integer"
                          },
                          "stored": {
                            "type": "integer"
                          },
                          "seen": {
                            "type": "integer"
                          },
                          "explained": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "entity",
                          "crawl",
                          "api",
                          "recipe",
                          "stored",
                          "seen",
                          "explained"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "storedFrom": {
                      "type": "string",
                      "enum": [
                        "crawl",
                        "replay"
                      ]
                    },
                    "workflow": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "version": {
                          "type": "integer"
                        },
                        "phase": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "pendingTask": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "version": {
                              "type": "integer"
                            },
                            "owner": {
                              "type": "string",
                              "enum": [
                                "tenant",
                                "operator"
                              ]
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "otp",
                                "text",
                                "credential",
                                "guidance"
                              ]
                            },
                            "reason": {
                              "type": "string"
                            },
                            "deadline": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "version",
                            "owner",
                            "kind",
                            "reason",
                            "deadline"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "id",
                        "version",
                        "phase",
                        "status",
                        "pendingTask"
                      ],
                      "additionalProperties": false,
                      "description": "Authoritative scoped workflow and pending task; a completed queue delivery may still own a nonterminal wait."
                    }
                  },
                  "required": [
                    "runId",
                    "portal",
                    "phase",
                    "progress",
                    "elapsedMs",
                    "etaMs",
                    "headline",
                    "next",
                    "needsYou",
                    "records",
                    "lastEventAt",
                    "terminal",
                    "disposition",
                    "exitCode",
                    "attempt",
                    "retrying",
                    "held"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/runs/{id}/trace": {
      "get": {
        "operationId": "run_trace_get",
        "tags": [
          "Webhooks and events"
        ],
        "summary": "One run's durable trace: what it saw, what it decided and why, and what it missed.",
        "description": "One run's durable trace: what it saw, what it decided and why, and what it missed. Paginated with after_seq.",
        "x-mcp-tool": "run_trace_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          },
          {
            "name": "after_seq",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One run's durable trace, in order: what it saw, what it decided and why, and what it missed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "run": {
                      "type": "string"
                    },
                    "spans": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "runId": {
                            "type": "string"
                          },
                          "seq": {
                            "type": "integer"
                          },
                          "at": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "parentSeq": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "portal": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "tenantId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "model": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "inputTokens": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "outputTokens": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "costUsd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "ms": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "outcome": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "input": {
                            "anyOf": [
                              {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "const": "inline"
                                      },
                                      "value": {}
                                    },
                                    "required": [
                                      "kind",
                                      "value"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "const": "blob"
                                      },
                                      "sha256": {
                                        "type": "string"
                                      },
                                      "bytes": {
                                        "type": "integer"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "sha256",
                                      "bytes"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "const": "omitted"
                                      },
                                      "reason": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "reason"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "output": {
                            "anyOf": [
                              {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "const": "inline"
                                      },
                                      "value": {}
                                    },
                                    "required": [
                                      "kind",
                                      "value"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "const": "blob"
                                      },
                                      "sha256": {
                                        "type": "string"
                                      },
                                      "bytes": {
                                        "type": "integer"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "sha256",
                                      "bytes"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "const": "omitted"
                                      },
                                      "reason": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "reason"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "truncated": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "runId",
                          "seq",
                          "at",
                          "kind",
                          "parentSeq",
                          "portal",
                          "tenantId",
                          "model",
                          "inputTokens",
                          "outputTokens",
                          "costUsd",
                          "ms",
                          "outcome",
                          "reason",
                          "input",
                          "output",
                          "truncated"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "run",
                    "spans"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/runs/{id}/trace/blobs/{sha256}": {
      "get": {
        "operationId": "run_trace_blob_get",
        "tags": [
          "Webhooks and events"
        ],
        "summary": "One payload a span of this run stored by digest (a span whose input or output is {kind:\"blob\"}), such as a scope step's page HTML and model request.",
        "description": "One payload a span of this run stored by digest (a span whose input or output is {kind:\"blob\"}), such as a scope step's page HTML and model request.",
        "x-mcp-tool": "run_trace_blob_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "sha256",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "The stored payload, as the text the trace kept (JSON for a span input or output).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "run": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "run",
                    "sha256",
                    "text"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/runs/{id}/workflow": {
      "get": {
        "operationId": "runs_workflow",
        "tags": [
          "Runs"
        ],
        "summary": "The durable workflow for a run, including its current lifecycle and pending human task.",
        "description": "The durable workflow for a run, including its current lifecycle and pending human task. Tenant and account access are checked by the run route.",
        "x-mcp-tool": "runs_workflow",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "2XX": {
            "description": "Success. The shape is not published yet: the durable workflow metadata projection is versioned independently; workflow is null for legacy runs and never contains submitted human response values.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/schedules": {
      "post": {
        "operationId": "schedules_create",
        "tags": [
          "Schedules"
        ],
        "summary": "Subscribe a stored login to Rover’s own crawl clock.",
        "description": "Subscribe a stored login to Rover’s own crawl clock. Upsert; the login must already be pushed.",
        "x-mcp-tool": "schedules_create",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "portal": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "customer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  },
                  "documentOrigins": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "intervalMinutes": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "cron": {
                    "type": "string"
                  },
                  "calendar": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "autoRepin": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "portal",
                  "customer"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The schedule.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "portal": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "driver": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "preferLegacy": {
                      "type": "boolean"
                    },
                    "customerId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "credentialId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tenantId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "account": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "documentOrigins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "intervalMinutes": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "cron": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "calendar": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "integer"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "autoRepin": {
                      "type": "boolean"
                    },
                    "auto": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subscribedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastEnqueuedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSkipReason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "legacy_row",
                        "login_resting",
                        "needs_customer",
                        "login_lookup_failed",
                        "not_a_job",
                        "not_pinned",
                        "pin_lookup_failed",
                        "billing_read_only",
                        "portal_not_approved",
                        "plan_pace",
                        "explore_limit",
                        "auto_schedule_off",
                        "auto_schedule_lookup_failed",
                        "enqueue_failed",
                        "already_running"
                      ]
                    },
                    "lastSkippedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "nextDueAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "portal",
                    "kind",
                    "driver",
                    "preferLegacy",
                    "customerId",
                    "credentialId",
                    "tenantId",
                    "account",
                    "documentOrigins",
                    "intervalMinutes",
                    "cron",
                    "calendar",
                    "enabled",
                    "autoRepin",
                    "auto",
                    "reason",
                    "subscribedAt",
                    "lastEnqueuedAt",
                    "lastSkipReason",
                    "lastSkippedAt",
                    "nextDueAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "delete": {
        "operationId": "schedules_delete",
        "tags": [
          "Schedules"
        ],
        "summary": "Unsubscribe a login from Rover's crawl clock.",
        "description": "Unsubscribe a login from Rover's crawl clock. Soft: the row, its history and its pin stay.",
        "x-mcp-tool": "schedules_delete",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "x-destructive": true,
        "parameters": [
          {
            "name": "portal",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "Unsubscribed. The row and its history stay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "unsubscribed": {
                      "const": true
                    }
                  },
                  "required": [
                    "unsubscribed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "get": {
        "operationId": "schedules_list",
        "tags": [
          "Schedules"
        ],
        "summary": "Schedules this caller owns.",
        "description": "Schedules this caller owns.",
        "x-mcp-tool": "schedules_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "Your schedules.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schedules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "portal": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "driver": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "preferLegacy": {
                            "type": "boolean"
                          },
                          "customerId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "credentialId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "tenantId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "account": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "documentOrigins": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "intervalMinutes": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "cron": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "calendar": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "integer"
                            }
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "autoRepin": {
                            "type": "boolean"
                          },
                          "auto": {
                            "type": "boolean"
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "subscribedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastEnqueuedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastSkipReason": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "legacy_row",
                              "login_resting",
                              "needs_customer",
                              "login_lookup_failed",
                              "not_a_job",
                              "not_pinned",
                              "pin_lookup_failed",
                              "billing_read_only",
                              "portal_not_approved",
                              "plan_pace",
                              "explore_limit",
                              "auto_schedule_off",
                              "auto_schedule_lookup_failed",
                              "enqueue_failed",
                              "already_running"
                            ]
                          },
                          "lastSkippedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "nextDueAt": {
                            "type": "string"
                          },
                          "overdueSeconds": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Seconds past due with no enqueue and no skip recorded since, once that is more than a few scheduler polls; else null. A non-null value is a scheduler defect, not a wait."
                          }
                        },
                        "required": [
                          "id",
                          "portal",
                          "kind",
                          "driver",
                          "preferLegacy",
                          "customerId",
                          "credentialId",
                          "tenantId",
                          "account",
                          "documentOrigins",
                          "intervalMinutes",
                          "cron",
                          "calendar",
                          "enabled",
                          "autoRepin",
                          "auto",
                          "reason",
                          "subscribedAt",
                          "lastEnqueuedAt",
                          "lastSkipReason",
                          "lastSkippedAt",
                          "nextDueAt",
                          "overdueSeconds"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "schedules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/schedules/calendar": {
      "put": {
        "operationId": "schedules_set_calendar",
        "tags": [
          "Administration"
        ],
        "summary": "Push the crawl calendar for a whole portal, across every tenant subscribed to it.",
        "description": "Push the crawl calendar for a whole portal, across every tenant subscribed to it.",
        "x-mcp-tool": "schedules_set_calendar",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "portal": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "calendar": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 365
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "portal",
                  "calendar"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many schedule rows took the calendar.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "portal": {
                      "type": "string"
                    },
                    "updated": {
                      "type": "integer"
                    },
                    "calendar": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      }
                    }
                  },
                  "required": [
                    "portal",
                    "updated",
                    "calendar"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/staff-actions": {
      "get": {
        "operationId": "staff_actions_list",
        "tags": [
          "Credentials"
        ],
        "summary": "What Rover support did with your logins and runs, newest first: the act, the login by id, the run and the reason given.",
        "description": "What Rover support did with your logins and runs, newest first: the act, the login by id, the run and the reason given. Never a password.",
        "responses": {
          "200": {
            "description": "The actions, and a cursor (`before`) for the next page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions": {
      "get": {
        "operationId": "subscriptions_list",
        "tags": [
          "Webhooks and events"
        ],
        "summary": "This caller's subscriptions to run outcomes.",
        "description": "This caller's subscriptions to run outcomes.",
        "x-mcp-tool": "subscriptions_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "Your subscriptions, live and ended. A webhook shows only its host.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "subscriptions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "portal": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "target": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "const": "webhook"
                                  },
                                  "host": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "host"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "const": "sse"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "deliveredSeq": {
                            "type": "integer"
                          },
                          "failures": {
                            "type": "integer"
                          },
                          "endedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "endedReason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "blocked": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "portal",
                          "target",
                          "deliveredSeq",
                          "failures",
                          "endedAt",
                          "endedReason",
                          "blocked"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "subscriptions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "post": {
        "operationId": "subscriptions_create",
        "tags": [
          "Webhooks and events"
        ],
        "summary": "Subscribe to a run or a portal, delivered over the SSE stream or a webhook.",
        "description": "Subscribe to a run or a portal, delivered over the SSE stream or a webhook. A webhook gets a generated signing secret, returned once.",
        "x-mcp-tool": "subscriptions_create",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "runId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "portal": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "customer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "account": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
                    "maxLength": 200,
                    "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
                  },
                  "subscriber": {
                    "type": "object",
                    "properties": {
                      "userId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "tenantId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      }
                    },
                    "required": [
                      "userId",
                      "tenantId"
                    ],
                    "additionalProperties": false
                  },
                  "channel": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "const": "sse"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "const": "webhook"
                          },
                          "url": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          },
                          "secretEnv": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          }
                        },
                        "required": [
                          "kind",
                          "url"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "subscriber",
                  "channel"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The subscription. A webhook's signing secret is in `secret`, shown this once.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "runId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "portal": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subscriber": {
                      "type": "object",
                      "properties": {
                        "userId": {
                          "type": "string"
                        },
                        "tenantId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "userId",
                        "tenantId"
                      ],
                      "additionalProperties": false
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "sse",
                        "webhook"
                      ]
                    },
                    "secret": {
                      "type": "string"
                    },
                    "note": {
                      "type": "string"
                    },
                    "stream": {
                      "type": "string",
                      "description": "For an SSE subscription, the stream to open."
                    }
                  },
                  "required": [
                    "id",
                    "runId",
                    "portal",
                    "subscriber",
                    "channel"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/subscriptions/{id}": {
      "delete": {
        "operationId": "subscriptions_delete",
        "tags": [
          "Webhooks and events"
        ],
        "summary": "End a subscription.",
        "description": "End a subscription. Only this caller’s own tenant may end it.",
        "x-mcp-tool": "subscriptions_delete",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "x-destructive": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The subscription ended."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/tenant/summary": {
      "get": {
        "operationId": "tenant_summary_get",
        "tags": [
          "Accounts"
        ],
        "summary": "What is owed across every one of this caller's portals: the total, the aging buckets, the next invoice due date and a per-portal breakdown.",
        "description": "What is owed across every one of this caller's portals: the total, the aging buckets, the next invoice due date and a per-portal breakdown.",
        "x-mcp-tool": "tenant_summary_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          },
          {
            "name": "portal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What is owed across every one of this caller's portals: the total, the aging buckets, the next invoice due date and a per-portal breakdown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accountCount": {
                      "type": "integer"
                    },
                    "locationCount": {
                      "type": "integer"
                    },
                    "openInvoices": {
                      "type": "integer"
                    },
                    "amountDue": {
                      "type": "integer"
                    },
                    "nextDue": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastInvoiceDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "asOf": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "aging": {
                      "type": "object",
                      "properties": {
                        "overdue": {
                          "type": "object",
                          "properties": {
                            "cents": {
                              "type": "integer"
                            },
                            "count": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "cents",
                            "count"
                          ],
                          "additionalProperties": false
                        },
                        "dueSoon": {
                          "type": "object",
                          "properties": {
                            "cents": {
                              "type": "integer"
                            },
                            "count": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "cents",
                            "count"
                          ],
                          "additionalProperties": false
                        },
                        "later": {
                          "type": "object",
                          "properties": {
                            "cents": {
                              "type": "integer"
                            },
                            "count": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "cents",
                            "count"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "overdue",
                        "dueSoon",
                        "later"
                      ],
                      "additionalProperties": false
                    },
                    "portals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "portal": {
                            "type": "string"
                          },
                          "amountDue": {
                            "type": "integer"
                          },
                          "openInvoices": {
                            "type": "integer"
                          },
                          "accountCount": {
                            "type": "integer"
                          },
                          "nextDue": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "aging": {
                            "type": "object",
                            "properties": {
                              "overdue": {
                                "type": "object",
                                "properties": {
                                  "cents": {
                                    "type": "integer"
                                  },
                                  "count": {
                                    "type": "integer"
                                  }
                                },
                                "required": [
                                  "cents",
                                  "count"
                                ],
                                "additionalProperties": false
                              },
                              "dueSoon": {
                                "type": "object",
                                "properties": {
                                  "cents": {
                                    "type": "integer"
                                  },
                                  "count": {
                                    "type": "integer"
                                  }
                                },
                                "required": [
                                  "cents",
                                  "count"
                                ],
                                "additionalProperties": false
                              },
                              "later": {
                                "type": "object",
                                "properties": {
                                  "cents": {
                                    "type": "integer"
                                  },
                                  "count": {
                                    "type": "integer"
                                  }
                                },
                                "required": [
                                  "cents",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "overdue",
                              "dueSoon",
                              "later"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "portal",
                          "amountDue",
                          "openInvoices",
                          "accountCount",
                          "nextDue",
                          "aging"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "accountCount",
                    "locationCount",
                    "openInvoices",
                    "amountDue",
                    "nextDue",
                    "lastInvoiceDate",
                    "asOf",
                    "aging",
                    "portals"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/tenant/vendors": {
      "get": {
        "operationId": "tenant_vendors_get",
        "tags": [
          "Accounts"
        ],
        "summary": "How each of this caller's vendors stands: a status for every login (Up to date, Password needed, We're fixing this and the rest) and the worst of them for the vendor.",
        "description": "How each of this caller's vendors stands: a status for every login (Up to date, Password needed, We're fixing this and the rest) and the worst of them for the vendor.",
        "x-mcp-tool": "tenant_vendors_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "200": {
            "description": "Each vendor with its status and the status of every login behind it. A vendor reads as its worst login.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "vendors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "portal": {
                            "type": "string"
                          },
                          "host": {
                            "type": "string"
                          },
                          "status": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "needs",
                                  "problem",
                                  "warning",
                                  "progress",
                                  "done",
                                  "quiet"
                                ]
                              },
                              "code": {
                                "type": "string",
                                "enum": [
                                  "paused",
                                  "password_needed",
                                  "security_answer_needed",
                                  "account_locked",
                                  "fixing",
                                  "site_unavailable",
                                  "checking",
                                  "first_check",
                                  "pdfs_missing",
                                  "data_missing",
                                  "never_checked",
                                  "no_new_invoices",
                                  "not_checked_recently",
                                  "up_to_date"
                                ]
                              },
                              "label": {
                                "type": "string"
                              },
                              "since": {
                                "type": "string"
                              },
                              "detail": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind",
                              "code",
                              "label"
                            ],
                            "additionalProperties": false
                          },
                          "lastReadAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "logins": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "credentialId": {
                                  "type": "string"
                                },
                                "customer": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "needs",
                                        "problem",
                                        "warning",
                                        "progress",
                                        "done",
                                        "quiet"
                                      ]
                                    },
                                    "code": {
                                      "type": "string",
                                      "enum": [
                                        "paused",
                                        "password_needed",
                                        "security_answer_needed",
                                        "account_locked",
                                        "fixing",
                                        "site_unavailable",
                                        "checking",
                                        "first_check",
                                        "pdfs_missing",
                                        "data_missing",
                                        "never_checked",
                                        "no_new_invoices",
                                        "not_checked_recently",
                                        "up_to_date"
                                      ]
                                    },
                                    "label": {
                                      "type": "string"
                                    },
                                    "since": {
                                      "type": "string"
                                    },
                                    "detail": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "code",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                },
                                "lastReadAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "signedInAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "credentialId",
                                "customer",
                                "status",
                                "lastReadAt",
                                "signedInAt"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "key",
                          "name",
                          "portal",
                          "host",
                          "status",
                          "lastReadAt",
                          "logins"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "vendors"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/tenants": {
      "post": {
        "operationId": "tenants_create",
        "tags": [
          "Administration"
        ],
        "summary": "Create a tenant and mint its first token.",
        "description": "Create a tenant and mint its first token. The token is returned once, in the response, and never again.",
        "x-mcp-tool": "tenants_create",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tenant": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "dials": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "tokenName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "admin": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "tenant"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The tenant and its first token, shown this once.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "object",
                      "properties": {
                        "tenant": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "dials": {
                          "type": "object",
                          "additionalProperties": {}
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "plan": {
                          "type": "string"
                        },
                        "billingStatus": {
                          "type": "string"
                        },
                        "stripeCustomerId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "stripeSubscriptionId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "billingExempt": {
                          "type": "boolean"
                        },
                        "billingPeriodStart": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "billingPeriodEnd": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "cancelAtPeriodEnd": {
                          "type": "boolean"
                        },
                        "graceUntil": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "planLimits": {
                          "type": "object",
                          "additionalProperties": {}
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tenant",
                        "displayName",
                        "dials",
                        "enabled",
                        "plan",
                        "billingStatus",
                        "stripeCustomerId",
                        "stripeSubscriptionId",
                        "billingExempt",
                        "billingPeriodStart",
                        "billingPeriodEnd",
                        "cancelAtPeriodEnd",
                        "graceUntil",
                        "planLimits",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "token": {
                      "type": "string"
                    },
                    "tokenSha256": {
                      "type": "string"
                    },
                    "tokenName": {
                      "type": "string"
                    },
                    "admin": {
                      "type": "boolean"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "tenant",
                    "token",
                    "tokenSha256",
                    "tokenName",
                    "admin",
                    "note"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "get": {
        "operationId": "tenants_list",
        "tags": [
          "Administration"
        ],
        "summary": "Every tenant and its dials.",
        "description": "Every tenant and its dials. Never a token.",
        "x-mcp-tool": "tenants_list",
        "x-rover-role": "admin",
        "x-oauth-allowed": true,
        "responses": {
          "200": {
            "description": "Every tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenant": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "dials": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "plan": {
                            "type": "string"
                          },
                          "billingStatus": {
                            "type": "string"
                          },
                          "stripeCustomerId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "stripeSubscriptionId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingExempt": {
                            "type": "boolean"
                          },
                          "billingPeriodStart": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billingPeriodEnd": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "cancelAtPeriodEnd": {
                            "type": "boolean"
                          },
                          "graceUntil": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "planLimits": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenant",
                          "displayName",
                          "dials",
                          "enabled",
                          "plan",
                          "billingStatus",
                          "stripeCustomerId",
                          "stripeSubscriptionId",
                          "billingExempt",
                          "billingPeriodStart",
                          "billingPeriodEnd",
                          "cancelAtPeriodEnd",
                          "graceUntil",
                          "planLimits",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/tenants/mine/tokens": {
      "get": {
        "operationId": "tenant_tokens_list_mine",
        "tags": [
          "Tokens"
        ],
        "summary": "This caller's own tenant's tokens: hashes and labels only, never the token itself.",
        "description": "This caller's own tenant's tokens: hashes and labels only, never the token itself.",
        "x-mcp-tool": "tenant_tokens_list_mine",
        "x-rover-role": "operator",
        "x-oauth-allowed": true,
        "responses": {
          "200": {
            "description": "Your team's tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tokenSha256": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "tenant": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "admin": {
                            "type": "boolean"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "expiresAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastUsedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "mintedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "\"Rover support\" when Rover support made it for your team; null for your own."
                          }
                        },
                        "required": [
                          "tokenSha256",
                          "name",
                          "tenant",
                          "admin",
                          "enabled",
                          "createdAt",
                          "expiresAt",
                          "lastUsedAt",
                          "mintedBy"
                        ],
                        "additionalProperties": false,
                        "description": "A token's hash and label. Never the token."
                      }
                    }
                  },
                  "required": [
                    "tokens"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "post": {
        "operationId": "tenant_tokens_create_mine",
        "tags": [
          "Tokens"
        ],
        "summary": "Mint a token for this caller's own tenant.",
        "description": "Mint a token for this caller's own tenant. Always non-admin, regardless of what is asked for. Returned once, and never again.",
        "x-mcp-tool": "tenant_tokens_create_mine",
        "x-rover-role": "operator",
        "x-oauth-allowed": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new token, shown this once.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "token": {
                      "type": "string"
                    },
                    "tokenSha256": {
                      "type": "string"
                    },
                    "tokenName": {
                      "type": "string"
                    },
                    "admin": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "tenant",
                    "token",
                    "tokenSha256",
                    "tokenName",
                    "admin",
                    "expiresAt",
                    "note"
                  ],
                  "additionalProperties": false,
                  "description": "The new token, shown this once."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/tenants/mine/tokens/{token_sha256}": {
      "delete": {
        "operationId": "tenant_tokens_revoke_mine",
        "tags": [
          "Tokens"
        ],
        "summary": "Revoke one of this caller's own tenant's tokens by its hash.",
        "description": "Revoke one of this caller's own tenant's tokens by its hash. It stops working at once.",
        "x-mcp-tool": "tenant_tokens_revoke_mine",
        "x-rover-role": "operator",
        "x-oauth-allowed": false,
        "x-destructive": true,
        "parameters": [
          {
            "name": "token_sha256",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The token is revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tokenSha256": {
                      "type": "string"
                    },
                    "enabled": {
                      "const": false
                    }
                  },
                  "required": [
                    "tokenSha256",
                    "enabled"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/tenants/{tenant}": {
      "delete": {
        "operationId": "tenants_disable",
        "tags": [
          "Administration"
        ],
        "summary": "Disable a tenant.",
        "description": "Disable a tenant. Soft: its tokens stop authenticating and its history stays.",
        "x-mcp-tool": "tenants_disable",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "x-destructive": true,
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tenant is disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "enabled": {
                      "const": false
                    }
                  },
                  "required": [
                    "tenant",
                    "enabled"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/tenants/{tenant}/dials": {
      "put": {
        "operationId": "tenants_set_dials",
        "tags": [
          "Administration"
        ],
        "summary": "Replace or merge a tenant's dials.",
        "description": "Replace or merge a tenant's dials.",
        "x-mcp-tool": "tenants_set_dials",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dials": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "merge": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tenant after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "object",
                      "properties": {
                        "tenant": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "dials": {
                          "type": "object",
                          "additionalProperties": {}
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "plan": {
                          "type": "string"
                        },
                        "billingStatus": {
                          "type": "string"
                        },
                        "stripeCustomerId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "stripeSubscriptionId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "billingExempt": {
                          "type": "boolean"
                        },
                        "billingPeriodStart": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "billingPeriodEnd": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "cancelAtPeriodEnd": {
                          "type": "boolean"
                        },
                        "graceUntil": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "planLimits": {
                          "type": "object",
                          "additionalProperties": {}
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tenant",
                        "displayName",
                        "dials",
                        "enabled",
                        "plan",
                        "billingStatus",
                        "stripeCustomerId",
                        "stripeSubscriptionId",
                        "billingExempt",
                        "billingPeriodStart",
                        "billingPeriodEnd",
                        "cancelAtPeriodEnd",
                        "graceUntil",
                        "planLimits",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "merged": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "tenant",
                    "merged"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/tenants/{tenant}/tokens": {
      "get": {
        "operationId": "tenants_tokens_list",
        "tags": [
          "Administration"
        ],
        "summary": "A tenant's tokens: hashes and labels only, never the token itself.",
        "description": "A tenant's tokens: hashes and labels only, never the token itself.",
        "x-mcp-tool": "tenants_tokens_list",
        "x-rover-role": "admin",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tenant's tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tokenSha256": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "tenant": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "admin": {
                            "type": "boolean"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "expiresAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastUsedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "mintedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "\"Rover support\" when Rover support made it for your team; null for your own."
                          }
                        },
                        "required": [
                          "tokenSha256",
                          "name",
                          "tenant",
                          "admin",
                          "enabled",
                          "createdAt",
                          "expiresAt",
                          "lastUsedAt",
                          "mintedBy"
                        ],
                        "additionalProperties": false,
                        "description": "A token's hash and label. Never the token."
                      }
                    }
                  },
                  "required": [
                    "tokens"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "post": {
        "operationId": "tenants_tokens_mint",
        "tags": [
          "Administration"
        ],
        "summary": "Mint an additional token for a tenant.",
        "description": "Mint an additional token for a tenant. Returned once, in the response, and never again.",
        "x-mcp-tool": "tenants_tokens_mint",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "admin": {
                    "type": "boolean"
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new token, shown this once.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "token": {
                      "type": "string"
                    },
                    "tokenSha256": {
                      "type": "string"
                    },
                    "tokenName": {
                      "type": "string"
                    },
                    "admin": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "tenant",
                    "token",
                    "tokenSha256",
                    "tokenName",
                    "admin",
                    "expiresAt",
                    "note"
                  ],
                  "additionalProperties": false,
                  "description": "The new token, shown this once."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/tenants/{tenant}/tokens/{token_sha256}": {
      "delete": {
        "operationId": "tenants_tokens_revoke",
        "tags": [
          "Administration"
        ],
        "summary": "Revoke one tenant token by its hash.",
        "description": "Revoke one tenant token by its hash.",
        "x-mcp-tool": "tenants_tokens_revoke",
        "x-rover-role": "admin",
        "x-oauth-allowed": false,
        "x-destructive": true,
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "token_sha256",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The token is revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tokenSha256": {
                      "type": "string"
                    },
                    "enabled": {
                      "const": false
                    }
                  },
                  "required": [
                    "tokenSha256",
                    "enabled"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/users": {
      "get": {
        "operationId": "users_list",
        "tags": [
          "Team"
        ],
        "summary": "Users and open invites in scope.",
        "description": "Users and open invites in scope. A tenant_admin sees only its own tenant; a tenant_viewer sees none, even though this is a read. role narrows to one role; scope=all asks for every tenant and is refused to anyone but a super_admin. setByDeployment marks an address on ROVER_SUPER_ADMIN_EMAILS.",
        "x-mcp-tool": "users_list",
        "x-rover-role": "user_admin",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "super_admin",
                "tenant_admin",
                "tenant_viewer"
              ]
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "const": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "People and open invites.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "tenant": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "super_admin",
                              "tenant_admin",
                              "tenant_viewer"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "lastLoginAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pending": {
                            "type": "boolean"
                          },
                          "setByDeployment": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "email",
                          "tenant",
                          "role",
                          "enabled",
                          "createdAt",
                          "lastLoginAt",
                          "pending",
                          "setByDeployment"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "invites": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "tenant": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "super_admin",
                              "tenant_admin",
                              "tenant_viewer"
                            ]
                          },
                          "inviter": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "invitedBy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "expiresAt": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "expired",
                              "accepted",
                              "declined",
                              "revoked"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "email",
                          "tenant",
                          "role",
                          "inviter",
                          "invitedBy",
                          "createdAt",
                          "expiresAt",
                          "status"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "users",
                    "invites"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/users/invite": {
      "post": {
        "operationId": "users_invite",
        "tags": [
          "Team"
        ],
        "summary": "Invite a person by email into a tenant with a role.",
        "description": "Invite a person by email into a tenant with a role. Nothing is created until they accept. A tenant_admin may only invite into its own tenant.",
        "x-mcp-tool": "users_invite",
        "x-rover-role": "user_admin",
        "x-oauth-allowed": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 320
                  },
                  "tenant": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "super_admin",
                      "tenant_admin",
                      "tenant_viewer"
                    ]
                  }
                },
                "required": [
                  "email",
                  "tenant",
                  "role"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The invite, mailed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invite": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "tenant": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "super_admin",
                            "tenant_admin",
                            "tenant_viewer"
                          ]
                        },
                        "inviter": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "invitedBy": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "expired",
                            "accepted",
                            "declined",
                            "revoked"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "tenant",
                        "role",
                        "inviter",
                        "invitedBy",
                        "createdAt",
                        "expiresAt",
                        "status"
                      ],
                      "additionalProperties": false
                    },
                    "inviteSent": {
                      "const": true
                    }
                  },
                  "required": [
                    "invite",
                    "inviteSent"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/users/{id}": {
      "patch": {
        "operationId": "users_patch",
        "tags": [
          "Team"
        ],
        "summary": "Change a user's role and/or enabled flag.",
        "description": "Change a user's role and/or enabled flag. A tenant_admin may not touch a super_admin row or grant super_admin.",
        "x-mcp-tool": "users_patch",
        "x-rover-role": "user_admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "super_admin",
                      "tenant_admin",
                      "tenant_viewer"
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The person after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "tenant": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "super_admin",
                            "tenant_admin",
                            "tenant_viewer"
                          ]
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "lastLoginAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "tenant",
                        "role",
                        "enabled",
                        "createdAt",
                        "lastLoginAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "user"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/users/{id}/resend-invite": {
      "post": {
        "operationId": "users_resend_invite",
        "tags": [
          "Team"
        ],
        "summary": "Send another invite link to a user who has not yet accepted.",
        "description": "Send another invite link to a user who has not yet accepted.",
        "x-mcp-tool": "users_resend_invite",
        "x-rover-role": "user_admin",
        "x-oauth-allowed": false,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A new invite link was mailed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inviteSent": {
                      "const": true
                    }
                  },
                  "required": [
                    "inviteSent"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/users/{id}/revoke-sessions": {
      "post": {
        "operationId": "users_revoke_sessions",
        "tags": [
          "Team"
        ],
        "summary": "Kill a user's live sessions and OAuth grants immediately.",
        "description": "Kill a user's live sessions and OAuth grants immediately.",
        "x-mcp-tool": "users_revoke_sessions",
        "x-rover-role": "user_admin",
        "x-oauth-allowed": false,
        "x-destructive": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "How many sessions and OAuth grants ended.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "revoked": {
                      "type": "integer"
                    },
                    "grantsRevoked": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "revoked",
                    "grantsRevoked"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/workers": {
      "get": {
        "operationId": "workers_list",
        "tags": [
          "Deployment"
        ],
        "summary": "Which worker pods are alive, their lanes, and what each is running right now.",
        "description": "Which worker pods are alive, their lanes, and what each is running right now.",
        "x-mcp-tool": "workers_list",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "responses": {
          "200": {
            "description": "Live workers and what each is running.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "retentionMinutes": {
                      "type": "integer"
                    },
                    "workers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "workerId": {
                            "type": "string"
                          },
                          "startedAt": {
                            "type": "string"
                          },
                          "lastBeatAt": {
                            "type": "string"
                          },
                          "ageSeconds": {
                            "type": "integer"
                          },
                          "stale": {
                            "type": "boolean"
                          },
                          "lanes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "inFlightCount": {
                            "type": "integer"
                          },
                          "inFlight": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                },
                                "lane": {
                                  "type": "string",
                                  "enum": [
                                    "replay",
                                    "explore"
                                  ]
                                },
                                "startedAt": {
                                  "type": "string"
                                },
                                "portal": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "type",
                                "lane",
                                "startedAt"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "workerId",
                          "startedAt",
                          "lastBeatAt",
                          "ageSeconds",
                          "stale",
                          "lanes",
                          "inFlightCount",
                          "inFlight"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "retentionMinutes",
                    "workers"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/workflows/{id}": {
      "get": {
        "operationId": "workflows_get",
        "tags": [
          "Runs"
        ],
        "summary": "Inspect one durable workflow and its current human task in the exact tenant and account scope.",
        "description": "Inspect one durable workflow and its current human task in the exact tenant and account scope. Answers never include submitted human response values.",
        "x-mcp-tool": "workflows_get",
        "x-rover-role": "viewer",
        "x-oauth-allowed": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]{1,200}$",
              "maxLength": 200
            },
            "description": "Your own label for a group of logins, such as one of your customers. A token must send it on any call that stores, changes or reads one login. Rover never answers for one account with another's data."
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "2XX": {
            "description": "Success. The shape is not published yet: the durable workflow detail includes a task-specific scoped descriptor; protected human response values are omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API token from the console (API & MCP). Tokens expire: 90 days by default, a year at most."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "For MCP clients on `/v1/mcp` only. PKCE (S256) is required and clients register themselves. An access token lasts an hour.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://rover.waste.dev/v1/oauth/authorize",
            "tokenUrl": "https://rover.waste.dev/v1/oauth/token",
            "refreshUrl": "https://rover.waste.dev/v1/oauth/token",
            "scopes": {}
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, in a sentence or a short code."
          }
        }
      },
      "QuestionError": {
        "type": "object",
        "properties": {
          "ok": {
            "const": false
          },
          "tool": {
            "type": "string"
          },
          "error": {
            "type": "string",
            "enum": [
              "invalid_arguments",
              "forbidden",
              "unavailable",
              "unknown_tool"
            ]
          },
          "paths": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "An argument that failed validation. Never its value."
            }
          }
        }
      },
      "Record": {
        "type": "object",
        "description": "One record as Rover read it.",
        "properties": {
          "entity": {
            "type": "string",
            "enum": [
              "locations",
              "services",
              "vendor_accounts",
              "vendor_invoices",
              "work_orders",
              "pickups",
              "documents",
              "vendor_payments"
            ]
          },
          "identityKey": {
            "type": "string",
            "description": "The record's key, stable across readings. For an invoice, its printed invoice number."
          },
          "identity": {
            "type": "string",
            "enum": [
              "vendor",
              "composite"
            ],
            "description": "`vendor` when the portal assigned the key, `composite` when Rover built it from fields."
          },
          "key_aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "values": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Field name to value, as printed."
          },
          "fromDocument": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A field filled from a document rather than the page."
            }
          },
          "calculated": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A field Rover calculated from other values the portal gave, such as an amount due from the amount less the payments made."
            }
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                }
              }
            }
          },
          "documentSha256": {
            "type": [
              "string",
              "null"
            ],
            "description": "The document this record cites, if any."
          },
          "accountRefId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The durable account (recon_vendor_accounts) this record resolved to, or null where it names none."
          },
          "locationRefId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The durable location (recon_vendor_locations) this record resolved to, or null where it names none."
          },
          "lastObservedAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "When this record was last actually read, as opposed to carried forward from an earlier reading."
          },
          "carriedCount": {
            "type": "integer",
            "description": "How many readings in a row have carried this record forward with no fresh read."
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "What this row lacks or why it is doubted. Absent when there is nothing to say.",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "document_missing",
                    "amount_zero",
                    "account_unproven",
                    "field_missing"
                  ]
                },
                "severity": {
                  "type": "string",
                  "enum": [
                    "note",
                    "warn",
                    "suspect"
                  ]
                },
                "field": {
                  "type": "string",
                  "description": "The missing field, for field_missing."
                }
              }
            }
          }
        }
      },
      "LatestRecordsAnswer": {
        "type": "object",
        "properties": {
          "asOf": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the reading was taken, ISO 8601. Null when no reading is stored for this scope."
          },
          "coverage": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "How complete the reading was, 0 to 100."
          },
          "coverageProfile": {
            "type": [
              "string",
              "null"
            ]
          },
          "portal": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "runId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run that took the reading."
          },
          "recipeDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "clean",
              "flagged",
              "suspect"
            ],
            "description": "`suspect` when the reading itself is doubted (such as every amount reading 0.00): check the portal before relying on it. `flagged` when it is incomplete. Absent before a reading is stored."
          },
          "entity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "locations",
              "services",
              "vendor_accounts",
              "vendor_invoices",
              "work_orders",
              "pickups",
              "documents",
              "vendor_payments"
            ]
          },
          "filters": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "string"
            }
          },
          "count": {
            "type": "integer"
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          }
        }
      },
      "RecordHistoryAnswer": {
        "type": "object",
        "properties": {
          "asOf": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the reading was taken, ISO 8601. Null when no reading is stored for this scope."
          },
          "coverage": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "How complete the reading was, 0 to 100."
          },
          "coverageProfile": {
            "type": [
              "string",
              "null"
            ]
          },
          "portal": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "runId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run that took the reading."
          },
          "recipeDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "clean",
              "flagged",
              "suspect"
            ],
            "description": "`suspect` when the reading itself is doubted (such as every amount reading 0.00): check the portal before relying on it. `flagged` when it is incomplete. Absent before a reading is stored."
          },
          "entity": {
            "type": "string",
            "enum": [
              "locations",
              "services",
              "vendor_accounts",
              "vendor_invoices",
              "work_orders",
              "pickups",
              "documents",
              "vendor_payments"
            ]
          },
          "identityKey": {
            "type": "string"
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "takenAt": {
                  "type": "string"
                },
                "runId": {
                  "type": "string"
                },
                "values": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "changedFields": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "goneFromLatest": {
            "type": "boolean",
            "description": "True when the newest reading no longer has this record."
          }
        }
      },
      "ChangesAnswer": {
        "type": "object",
        "properties": {
          "asOf": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the reading was taken, ISO 8601. Null when no reading is stored for this scope."
          },
          "coverage": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "How complete the reading was, 0 to 100."
          },
          "coverageProfile": {
            "type": [
              "string",
              "null"
            ]
          },
          "portal": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "runId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run that took the reading."
          },
          "recipeDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "clean",
              "flagged",
              "suspect"
            ],
            "description": "`suspect` when the reading itself is doubted (such as every amount reading 0.00): check the portal before relying on it. `flagged` when it is incomplete. Absent before a reading is stored."
          },
          "since": {
            "type": [
              "string",
              "null"
            ]
          },
          "until": {
            "type": [
              "string",
              "null"
            ]
          },
          "severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "notable",
              "minor"
            ]
          },
          "counts": {
            "type": "object",
            "properties": {
              "added": {
                "type": "integer"
              },
              "removed": {
                "type": "integer"
              },
              "changed": {
                "type": "integer"
              },
              "notable": {
                "type": "integer"
              },
              "minor": {
                "type": "integer"
              }
            }
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One added or removed record, or one field whose value changed."
            }
          }
        }
      },
      "InvoiceTextAnswer": {
        "type": "object",
        "properties": {
          "asOf": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the reading was taken, ISO 8601. Null when no reading is stored for this scope."
          },
          "coverage": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "How complete the reading was, 0 to 100."
          },
          "coverageProfile": {
            "type": [
              "string",
              "null"
            ]
          },
          "portal": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "runId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run that took the reading."
          },
          "recipeDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "clean",
              "flagged",
              "suspect"
            ],
            "description": "`suspect` when the reading itself is doubted (such as every amount reading 0.00): check the portal before relying on it. `flagged` when it is incomplete. Absent before a reading is stored."
          },
          "sha256": {
            "type": "string"
          },
          "found": {
            "type": "boolean"
          },
          "extractor": {
            "type": [
              "string",
              "null"
            ]
          },
          "extractorVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "text": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          },
          "cited": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entity": {
                  "type": "string",
                  "enum": [
                    "locations",
                    "services",
                    "vendor_accounts",
                    "vendor_invoices",
                    "work_orders",
                    "pickups",
                    "documents",
                    "vendor_payments"
                  ]
                },
                "identityKey": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "PortalHealthAnswer": {
        "type": "object",
        "properties": {
          "asOf": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the reading was taken, ISO 8601. Null when no reading is stored for this scope."
          },
          "coverage": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "How complete the reading was, 0 to 100."
          },
          "coverageProfile": {
            "type": [
              "string",
              "null"
            ]
          },
          "portal": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "runId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run that took the reading."
          },
          "recipeDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "clean",
              "flagged",
              "suspect"
            ],
            "description": "`suspect` when the reading itself is doubted (such as every amount reading 0.00): check the portal before relying on it. `flagged` when it is incomplete. Absent before a reading is stored."
          },
          "known": {
            "type": "boolean"
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "recordCount": {
            "type": "integer"
          },
          "snapshots": {
            "type": "integer"
          },
          "pinDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastChange": {
            "type": [
              "object",
              "null"
            ]
          },
          "notableChanges": {
            "type": "integer"
          },
          "lastFailure": {
            "type": [
              "object",
              "null"
            ],
            "description": "Why the portal is not reading cleanly, from its most recent failed run: a reason and a next step in plain English."
          },
          "latestVerdict": {
            "type": [
              "object",
              "null"
            ],
            "description": "The newest run verdict for this portal (kind, retry, reason, records, a count and the distinct reasons of its gaps), from any run, accepted or not. A held or partial run after the last snapshot shows here while status keeps the snapshot's."
          },
          "staleCarryGaps": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One entry per entity with a record carried forward repeatedly with no fresh read."
            }
          },
          "reconciliation": {
            "type": [
              "object",
              "null"
            ],
            "description": "The checksum against the portal's own stated facts, as the latest snapshot's own run left it: how many controls it checked and matched, and the open gaps behind whatever did not. Null where that run checked nothing."
          }
        }
      },
      "CoverageAnswer": {
        "type": "object",
        "properties": {
          "asOf": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the reading was taken, ISO 8601. Null when no reading is stored for this scope."
          },
          "coverage": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "How complete the reading was, 0 to 100."
          },
          "coverageProfile": {
            "type": [
              "string",
              "null"
            ]
          },
          "portal": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "runId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run that took the reading."
          },
          "recipeDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "clean",
              "flagged",
              "suspect"
            ],
            "description": "`suspect` when the reading itself is doubted (such as every amount reading 0.00): check the portal before relying on it. `flagged` when it is incomplete. Absent before a reading is stored."
          },
          "score": {
            "type": [
              "integer",
              "null"
            ]
          },
          "profile": {
            "type": [
              "string",
              "null"
            ]
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "takenAt": {
                  "type": "string"
                },
                "runId": {
                  "type": "string"
                },
                "score": {
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              }
            }
          },
          "delta": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "SearchAnswer": {
        "type": "object",
        "properties": {
          "asOf": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the reading was taken, ISO 8601. Null when no reading is stored for this scope."
          },
          "coverage": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "How complete the reading was, 0 to 100."
          },
          "coverageProfile": {
            "type": [
              "string",
              "null"
            ]
          },
          "portal": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "runId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run that took the reading."
          },
          "recipeDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "clean",
              "flagged",
              "suspect"
            ],
            "description": "`suspect` when the reading itself is doubted (such as every amount reading 0.00): check the portal before relying on it. `flagged` when it is incomplete. Absent before a reading is stored."
          },
          "text": {
            "type": "string"
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sha256": {
                  "type": "string"
                },
                "extractor": {
                  "type": "string"
                },
                "entity": {
                  "type": "string",
                  "enum": [
                    "locations",
                    "services",
                    "vendor_accounts",
                    "vendor_invoices",
                    "work_orders",
                    "pickups",
                    "documents",
                    "vendor_payments"
                  ]
                },
                "identityKey": {
                  "type": "string"
                },
                "snippet": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "PageSearchAnswer": {
        "type": "object",
        "properties": {
          "asOf": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the reading was taken, ISO 8601. Null when no reading is stored for this scope."
          },
          "coverage": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "How complete the reading was, 0 to 100."
          },
          "coverageProfile": {
            "type": [
              "string",
              "null"
            ]
          },
          "portal": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "runId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run that took the reading."
          },
          "recipeDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "clean",
              "flagged",
              "suspect"
            ],
            "description": "`suspect` when the reading itself is doubted (such as every amount reading 0.00): check the portal before relying on it. `flagged` when it is incomplete. Absent before a reading is stored."
          },
          "text": {
            "type": "string"
          },
          "since": {
            "type": [
              "string",
              "null"
            ]
          },
          "count": {
            "type": "integer"
          },
          "pages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "capturedAt": {
                  "type": "string"
                },
                "sha256": {
                  "type": "string"
                },
                "snippet": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "PageTextAnswer": {
        "type": "object",
        "properties": {
          "asOf": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the reading was taken, ISO 8601. Null when no reading is stored for this scope."
          },
          "coverage": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "How complete the reading was, 0 to 100."
          },
          "coverageProfile": {
            "type": [
              "string",
              "null"
            ]
          },
          "portal": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "runId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run that took the reading."
          },
          "recipeDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "clean",
              "flagged",
              "suspect"
            ],
            "description": "`suspect` when the reading itself is doubted (such as every amount reading 0.00): check the portal before relying on it. `flagged` when it is incomplete. Absent before a reading is stored."
          },
          "found": {
            "type": "boolean"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "sha256": {
            "type": [
              "string",
              "null"
            ]
          },
          "capturedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "stepPath": {
            "type": [
              "string",
              "null"
            ]
          },
          "markdown": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          },
          "bytes": {
            "type": "integer"
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request was malformed or failed validation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "No token, or a token that is unknown, expired or revoked. The `WWW-Authenticate` header says which scheme to use.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The token is valid but may not do this.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Nothing by that name that this token may see. Rover answers 404 for both.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "This team needs billing set up before it can start runs.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "const": "payment_required"
                },
                "next": {
                  "type": "string",
                  "description": "Where to set up billing."
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "A limit was reached: `explore_limit` (explorations per day before billing) or `queue_full`. Wait for `Retry-After` seconds.",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            },
            "description": "Seconds to wait before trying again."
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unavailable": {
        "description": "A store Rover needs is unreachable. Retry; some answers carry `Retry-After`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "QuestionError": {
        "description": "A question tool refused or failed. `error` is one of four codes.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/QuestionError"
            }
          }
        }
      }
    }
  }
}
