{
  "openapi": "3.1.1",
  "info": {
    "title": "Shared Review Room API",
    "version": "1.0.0",
    "summary": "Discuss one fixed reference with shared pinned comments in an expiring private room.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://pageboardreviewroom.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Discuss one fixed reference with shared pinned comments in an expiring private room.",
        "description": "Create an expiring room for text or a small PNG/JPEG reference, invite participants, resolve pinned comments and export the discussion. The owner can revoke the room.\n\nMethodology:\n- Rooms retain one fixed text or PNG/JPEG reference, up to 200 comments and 100 participant identities for 1–24 hours. Anyone with the room access link can join and comment.\n- A private participant key controls editing or resolving your own comments. The owner key additionally allows moderation and revocation. Display names are not verified identities.\n- Participant and owner keys are separate from the invitation. Keys are stored as hashes. Expiry is enforced on every operation; pointer positions expire after 45 seconds.\n- A repeated comment request with the same non-empty idempotency key does not append a second comment. This is review of a fixed reference, not simultaneous project editing.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "pageboard_review_room",
        "x-owner-app": "pageboard",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PageboardReviewRoomInput"
              },
              "examples": {
                "example1": {
                  "summary": "Try an example",
                  "value": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageboardReviewRoomResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "PageboardReviewRoomInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operation": {
            "title": "Action",
            "type": "string",
            "enum": [
              "create",
              "read",
              "join",
              "comment",
              "presence",
              "edit",
              "resolve",
              "reopen",
              "delete",
              "revoke"
            ],
            "default": "create"
          },
          "title": {
            "title": "Room title",
            "type": "string",
            "maxLength": 100,
            "default": "Design review"
          },
          "reference": {
            "title": "Reference text or PNG/JPEG data URL",
            "type": "string",
            "maxLength": 350000,
            "default": "Review this layout together."
          },
          "hours": {
            "title": "Room lifetime (hours)",
            "type": "number",
            "minimum": 1,
            "maximum": 24,
            "default": 2
          },
          "roomId": {
            "title": "Room ID",
            "type": "string",
            "maxLength": 64,
            "default": ""
          },
          "peer": {
            "title": "Participant ID",
            "type": "string",
            "maxLength": 32,
            "default": ""
          },
          "accessKey": {
            "title": "Room access key",
            "type": "string",
            "maxLength": 64,
            "default": ""
          },
          "ownerKey": {
            "title": "Owner key",
            "type": "string",
            "maxLength": 64,
            "default": ""
          },
          "participantKey": {
            "title": "Private participant key",
            "type": "string",
            "maxLength": 64,
            "default": ""
          },
          "name": {
            "title": "Your display name",
            "type": "string",
            "maxLength": 50,
            "default": "Guest"
          },
          "comment": {
            "title": "Comment",
            "type": "string",
            "maxLength": 1000,
            "default": ""
          },
          "commentId": {
            "title": "Comment ID",
            "type": "string",
            "maxLength": 32,
            "default": ""
          },
          "requestId": {
            "title": "Idempotency key",
            "type": "string",
            "maxLength": 32,
            "default": ""
          },
          "x": {
            "title": "Pin X (%)",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 50
          },
          "y": {
            "title": "Pin Y (%)",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 50
          }
        },
        "required": []
      },
      "PageboardReviewRoomResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "roomId",
              "accessKey",
              "ownerKey",
              "participantKey",
              "peer",
              "canModerate",
              "title",
              "reference",
              "expiresAt",
              "revision",
              "comments",
              "presence",
              "revoked"
            ],
            "properties": {
              "roomId": {
                "type": "string"
              },
              "accessKey": {
                "type": "string"
              },
              "ownerKey": {
                "type": "string"
              },
              "participantKey": {
                "type": "string"
              },
              "peer": {
                "type": "string"
              },
              "canModerate": {
                "type": "boolean"
              },
              "title": {
                "type": "string"
              },
              "reference": {
                "type": "string"
              },
              "expiresAt": {
                "type": "string"
              },
              "revision": {
                "type": "number"
              },
              "comments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "author",
                    "name",
                    "text",
                    "x",
                    "y",
                    "at",
                    "updatedAt",
                    "resolved",
                    "requestId"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "author": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    },
                    "at": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "resolved": {
                      "type": "boolean"
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              },
              "presence": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "peer",
                    "name",
                    "x",
                    "y",
                    "seenAt"
                  ],
                  "properties": {
                    "peer": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    },
                    "seenAt": {
                      "type": "string"
                    }
                  }
                }
              },
              "revoked": {
                "type": "boolean"
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}