{
    "openapi": "3.0.0",
    "info": {
        "title": "Boxli Public API",
        "description": "Read-only public API for B2B partners. Use it to pull\n *                  scans, properties, floors, rooms, and photos by UUID\n *                  into your own systems.\n *\n *                  All endpoints require an API key sent in the\n *                  `X-API-Key` header. API keys are provisioned by\n *                  Boxli staff — contact help@boxli.ai to request one\n *                  for a new integration.",
        "contact": {
            "name": "Boxli Support",
            "email": "help@boxli.ai"
        },
        "version": "2.1.0"
    },
    "servers": [
        {
            "url": "https://api.boxli.ai",
            "description": "Boxli Public API"
        }
    ],
    "paths": {
        "/api/v2/public/auth/me": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Current authenticated user",
                "description": "Returns the identity associated with the API key on the request. Use this to confirm a key is wired up correctly and to display the partner's own name/email in your UI.",
                "operationId": "8ead64f78855b75ea0445ba5f715b983",
                "responses": {
                    "200": {
                        "description": "The user record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "first_name": {
                                                    "type": "string"
                                                },
                                                "last_name": {
                                                    "type": "string"
                                                },
                                                "role": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid X-API-Key.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/auth/me/activity": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "List your recent API requests",
                "description": "Returns the most-recent requests YOUR API key has made to the public API, newest first. Useful for confirming an integration is hitting the right endpoints and for debugging failures — every request includes its `request_id` (matches the `X-Request-Id` response header you would have received). Scoped to your user only; you cannot see other partners' traffic.",
                "operationId": "f2607b4c0b7cf9f55270db67321c23c8",
                "parameters": [
                    {
                        "name": "status_code",
                        "in": "query",
                        "description": "Filter to a single HTTP status code (e.g. 200, 401, 404).",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "method",
                        "in": "query",
                        "description": "Filter by HTTP method.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "GET",
                                "POST",
                                "PUT",
                                "PATCH",
                                "DELETE"
                            ]
                        }
                    },
                    {
                        "name": "path_contains",
                        "in": "query",
                        "description": "Substring match against the request path (e.g. `scans`).",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 80
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "description": "ISO 8601 — only return requests with `created_at >= after`.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "before",
                        "in": "query",
                        "description": "ISO 8601 — only return requests with `created_at <= before`.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Page of your activity.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ApiActivityEntry"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/properties": {
            "get": {
                "tags": [
                    "Properties"
                ],
                "summary": "List mobile-scanned properties",
                "operationId": "a7e03de6090ab8083fafc00b27a285fd",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 15,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "uuids",
                        "in": "query",
                        "description": "Bulk fetch: comma-separated UUID list (max 100). Malformed UUIDs are silently dropped.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "property_type",
                        "in": "query",
                        "description": "Filter by property_type. Empty/'string' placeholder ignored.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "scan_complete",
                        "in": "query",
                        "description": "Filter to only complete (or only incomplete) properties.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "created_after",
                        "in": "query",
                        "description": "ISO-8601. Only properties created at or after this time.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "created_before",
                        "in": "query",
                        "description": "ISO-8601. Only properties created at or before this time.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated property list.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Property"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/properties/{uuid}": {
            "get": {
                "tags": [
                    "Properties"
                ],
                "summary": "Get a single property with count aggregates",
                "operationId": "019159c818b043b13b479f7d0d0a76ac",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The property.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PropertyDetail"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Property not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/properties/{uuid}/floors": {
            "get": {
                "tags": [
                    "Floors"
                ],
                "summary": "List floors of a property",
                "operationId": "858127236b820af939e273b1d1f23bc8",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Floors (ordered by floor_number).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/PropertyFloor"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Property not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/properties/{uuid}/floorplan.json": {
            "get": {
                "tags": [
                    "Floors"
                ],
                "summary": "Get programmatic floor geometry (walls, doors, rooms, labels) for a property",
                "description": "Returns the same canonical floor-plan JSON shape the boxli dashboard uses internally. Partners can use it to render their own floor diagrams without parsing scan binaries.",
                "operationId": "2f0baf0b466f6a25d3a0bd8d127b4a1f",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Floor plan geometry. Shape follows boxli's internal floorplan.json schema.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "Open-shape JSON. See dashboard docs for the field list.",
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Property not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/properties/{uuid}/photos": {
            "get": {
                "tags": [
                    "Photos"
                ],
                "summary": "List photos of a property",
                "description": "Paginated photos with presigned download + thumbnail URLs.",
                "operationId": "8f7e7029ff6506dbc01d79a566501de2",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "room_uuid",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    },
                    {
                        "name": "floor_uuid",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    },
                    {
                        "name": "photo_code",
                        "in": "query",
                        "description": "UPD code (e.g. STRUCTURE_REAR).",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated photo list.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/PropertyPhoto"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Property not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/photos/{uuid}": {
            "get": {
                "tags": [
                    "Photos"
                ],
                "summary": "Get a single photo with presigned URLs",
                "operationId": "156cb0b8ed0f484720183579fdea302d",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The photo.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PropertyPhoto"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Photo not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/properties/{uuid}/floors/{floorUuid}/rooms": {
            "get": {
                "tags": [
                    "Rooms"
                ],
                "summary": "List rooms of a floor",
                "operationId": "5b760e36de337d5a4393005bb2a1b985",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    },
                    {
                        "name": "floorUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Rooms on this floor (with presigned room-model URLs when available).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/PropertyRoom"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Property or floor not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/recruit/people": {
            "get": {
                "tags": [
                    "Recruit"
                ],
                "summary": "Search professionals (masked)",
                "description": "Search the contacts catalog by location and profession. Results are masked (name + badges only). Use reveal to unlock contact details (spends 1 data credit).",
                "operationId": "recruitPeopleSearch",
                "parameters": [
                    {
                        "name": "profession",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "appraiser"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "TX"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "county",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "zip",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "description": "Name or company search.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lat",
                        "in": "query",
                        "description": "Search center latitude (requires lng).",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "lng",
                        "in": "query",
                        "description": "Search center longitude (requires lat).",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "radius_miles",
                        "in": "query",
                        "description": "Radius in miles (5–50). Default 25 when lat/lng set.",
                        "schema": {
                            "type": "integer",
                            "maximum": 50,
                            "minimum": 5
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 50
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated masked people list.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/RecruitPersonCard"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        },
                                        "data_credits": {
                                            "description": "Remaining data credits for the API key owner.",
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid X-API-Key.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "API key owner not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/recruit/people/{id}/reveal": {
            "post": {
                "tags": [
                    "Recruit"
                ],
                "summary": "Reveal contact details",
                "description": "Unlock email/phone/address for a person. Spends 1 data credit unless already revealed for this API key owner.",
                "operationId": "recruitPeopleReveal",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Revealed contact.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RecruitRevealResult"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid X-API-Key.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Insufficient data credits.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "API key owner not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Person not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/scans": {
            "get": {
                "tags": [
                    "Scans"
                ],
                "summary": "List scans the authenticated user can access",
                "description": "Paginated list of scans owned by the authenticated user or any sub-user (hierarchy child).",
                "operationId": "0d9582388f7b703d756b4ba5e072346e",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1).",
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100).",
                        "schema": {
                            "type": "integer",
                            "default": 15,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "uuids",
                        "in": "query",
                        "description": "Bulk fetch: comma-separated UUID list (max 100). Malformed UUIDs are silently dropped.",
                        "schema": {
                            "type": "string",
                            "example": "uuid1,uuid2,uuid3"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by status. Invalid values are silently ignored.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "processing",
                                "complete",
                                "failed"
                            ]
                        }
                    },
                    {
                        "name": "source",
                        "in": "query",
                        "description": "Filter by metadata.source (e.g. 'mobile'). Empty / 'string' placeholder ignored.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "created_after",
                        "in": "query",
                        "description": "ISO-8601 date or datetime. Only scans created at or after this time.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "created_before",
                        "in": "query",
                        "description": "ISO-8601 date or datetime. Only scans created at or before this time.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated scan list.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Scan"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/scans/{uuid}": {
            "get": {
                "tags": [
                    "Scans"
                ],
                "summary": "Get a single scan by UUID",
                "operationId": "3c605494759752fcf963dab829b3705b",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The scan.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ScanDetail"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scan not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/scans/{uuid}/report": {
            "get": {
                "tags": [
                    "Scans"
                ],
                "summary": "Get a presigned download URL for the scan's PDF report",
                "description": "Returns a short-lived presigned S3 URL to the scan's PDF report. Reports are generated server-side via the dashboard. Returns 404 if no report has been generated for this scan yet.",
                "operationId": "19c739c52c202568ac623cf86a967b84",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Presigned report URL.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PresignedDownload"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scan not found or no report available.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/scans/{uuid}/uad36": {
            "get": {
                "tags": [
                    "Scans"
                ],
                "summary": "Get the scan's UAD 3.6 subject property fields",
                "description": "The UAD 3.6 values recorded for this scan's subject property, one entry per field. BoxLi captures the subject only, never comparables. Each `key` is `<MISMO container path>#<UAD unique ID>`; repeatable containers (units, rooms, levels) carry an instance key in braces, e.g. `PROPERTY_UNIT{room:<uuid>}`, so one `uid` can appear once per instance. The document is assembled when the scan's report is first opened in the BoxLi dashboard; until then this answers 404 `uad36_not_available`.",
                "operationId": "289e11c0b2d7c187d5d609217c48ea23",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "UAD 3.6 subject fields.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "properties": {
                                                "scan_uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "version": {
                                                    "description": "Increments on every save of the document.",
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "schema_version": {
                                                    "type": "integer"
                                                },
                                                "registry_version": {
                                                    "type": "string"
                                                },
                                                "fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "key": {
                                                                "type": "string",
                                                                "example": "…/PROPERTY[SubjectProperty]/IMPROVEMENTS/IMPROVEMENT{u:1}/PROPERTY_UNITS/PROPERTY_UNIT{room:9f3c…}#0700.0035"
                                                            },
                                                            "uid": {
                                                                "description": "UAD 3.6 unique ID.",
                                                                "type": "string",
                                                                "example": "0700.0035"
                                                            },
                                                            "status": {
                                                                "description": "`unknown` means the appraiser marked the field Unknown; `value` is then null.",
                                                                "type": "string",
                                                                "enum": [
                                                                    "known",
                                                                    "unknown"
                                                                ]
                                                            },
                                                            "value": {
                                                                "type": "string",
                                                                "nullable": true
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "instances": {
                                                    "description": "Instance keys of each repeatable container, in report order.",
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scan not found, or no UAD 3.6 document yet (`uad36_not_available`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/scans/{uuid}/download": {
            "get": {
                "tags": [
                    "Scans"
                ],
                "summary": "Get a presigned download URL for the scan file",
                "description": "Returns a short-lived presigned S3 URL (5-min default TTL). Local-disk scans return 404 — only S3-backed files are downloadable via the public API.",
                "operationId": "467998234dc2d162967e6d418f5643d9",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "00000000-0000-0000-0000-000000000000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Presigned download URL.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PresignedDownload"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scan not found or not downloadable.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Presigning failed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/scan-orders": {
            "post": {
                "tags": [
                    "Scan Orders"
                ],
                "summary": "Create a scan order and get its launch link",
                "description": "Idempotent on `external_id` within your organization: repeating the request returns the existing order with 200 and no `scan_url`. Each new order spends one scan credit from your account.",
                "operationId": "c114fac419028cda3a5c255dc71bee2a",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateScanOrderRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created. One scan credit was taken.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScanOrderWithLink"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "An order with this `external_id` already exists; returned as it stands. Reissue for a new link.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScanOrder"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid `X-API-Key` (`unauthenticated`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "No scan credits left (`insufficient_credits`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not a partner key (`partner_key_required`), or your organization can't order scans (`feature_disabled`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scan orders are switched off on this environment (`not_found`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Same `external_id`, different address (`external_id_conflict`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Request body invalid (`validation_failed`). `error.fields` maps each field to its messages.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "example": "validation_failed"
                                                },
                                                "message": {
                                                    "type": "string"
                                                },
                                                "fields": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/scan-orders/{id}": {
            "get": {
                "tags": [
                    "Scan Orders"
                ],
                "summary": "Read an order's status",
                "description": "The fallback when a webhook is missed. Another organization's order answers 404.",
                "operationId": "ab11446f421f6e39261bbd456a4837a0",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "The order `id` (`ticket_id` in webhooks).",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The order.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScanOrder"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid `X-API-Key`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such order in your organization (`not_found`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Scan Orders"
                ],
                "summary": "Cancel an order",
                "description": "Marks the order cancelled, removes the job from the appraiser's phone on its next sync, ends the guest session and sends `deleted` once. Idempotent. A delivered order can be cancelled; its export stays downloadable. The credit is not refunded.",
                "operationId": "b155bb665b1581849be7f76aa7216807",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The cancelled order.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScanOrder"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid `X-API-Key`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such order in your organization (`not_found`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/scan-orders/{id}/reissue": {
            "post": {
                "tags": [
                    "Scan Orders"
                ],
                "summary": "Get a new launch link",
                "description": "For a new phone, a reinstall or an expired link. The old link stops working, the phone binding is cleared and the open guest session ends; anything the old phone had not uploaded is lost. Allowed while `pending` or `claimed`.",
                "operationId": "3211ce16dbb7b077873dc158c27e8af3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "valid_days": {
                                        "type": "integer",
                                        "default": 7,
                                        "maximum": 21,
                                        "minimum": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The order with its new link.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScanOrderWithLink"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid `X-API-Key`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such order in your organization (`not_found`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "The order is delivered or cancelled (`order_closed`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "`valid_days` out of range (`validation_failed`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/scan-orders/{id}/export": {
            "get": {
                "tags": [
                    "Scan Orders"
                ],
                "summary": "Get download links for the delivered files",
                "description": "Call it after the `delivered` or `model_modified` webhook. The URLs are short-lived; call again for fresh ones.",
                "operationId": "5b44fda4c56eac2a58965e28afd58e3c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Download links.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScanOrderExport"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid `X-API-Key`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such order in your organization (`not_found`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "The order has not been delivered yet (`not_delivered`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/webhooks": {
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "List your active webhook subscriptions",
                "operationId": "cb72fa3ea9c7ace85c11bfc074663e23",
                "responses": {
                    "200": {
                        "description": "Owned subscriptions (secret is hidden).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WebhookSubscription"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Create a webhook subscription",
                "description": "Returns the signing secret ONCE in the response. Store it — there's no way to retrieve it later. Use it to verify the X-Boxli-Signature header on incoming deliveries.",
                "operationId": "30ac2b4876fed8b772c121d215e3f629",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "event",
                                    "url"
                                ],
                                "properties": {
                                    "event": {
                                        "type": "string",
                                        "enum": [
                                            "scan.completed",
                                            "scan.failed"
                                        ],
                                        "example": "scan.completed"
                                    },
                                    "url": {
                                        "type": "string",
                                        "format": "uri",
                                        "example": "https://hooks.partner.example/boxli"
                                    },
                                    "name": {
                                        "type": "string",
                                        "example": "Production scan webhook",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created. `secret` is in this response and ONLY this response.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookSubscription"
                                        },
                                        "secret": {
                                            "description": "HMAC signing secret. Store securely — not shown again.",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Webhook subscription rejected. The `error.code` field tells you which constraint failed:\n     *\n     *         - `validation_failed` — body shape is wrong (missing `event` or `url`, etc.). `error.details` enumerates the offending fields.\n     *         - `insecure_url` — production requires `https://`; `http://` was sent.\n     *         - `malformed_url` — URL couldn't be parsed.\n     *         - `bad_scheme` — scheme is not `http` or `https` (e.g. `file://`, `gopher://`).\n     *         - `port_not_allowed` — URL uses a port outside the allowlist (80, 443, 8080, 8443).\n     *         - `userinfo_not_allowed` — URL contains a `user:password@` segment.\n     *         - `private_address` — URL host resolves to a private / loopback / link-local / metadata IP.\n     *         - `unresolvable_host` — URL host can't be resolved via DNS.\n     *         - `unsafe_url` — generic SSRF-guard catch-all.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/webhooks/{id}": {
            "delete": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Deactivate a webhook subscription",
                "operationId": "8ce792407b93d0d0f6483e907f6aef6f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deactivated. Delivery history is preserved."
                    },
                    "404": {
                        "description": "Subscription not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Update a webhook subscription",
                "description": "Edit the URL and/or name in place, and optionally rotate the signing secret — delivery history is preserved, no delete + recreate needed. Send `rotate_secret: true` to mint a fresh secret; it is returned ONCE in this response, exactly like create.",
                "operationId": "dc6c8f3c5104aa7ff6b41855efb479fc",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Webhook subscription id.",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "description": "At least one of `url`, `name`, `rotate_secret` is required.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "format": "uri",
                                        "example": "https://hooks.partner.example/boxli-v2"
                                    },
                                    "name": {
                                        "type": "string",
                                        "example": "Production scan webhook",
                                        "nullable": true
                                    },
                                    "rotate_secret": {
                                        "description": "Set true to invalidate the current signing secret and mint a new one.",
                                        "type": "boolean",
                                        "example": false
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated. `secret` is present ONLY when `rotate_secret` was true — store it; it is not shown again.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookSubscription"
                                        },
                                        "secret": {
                                            "description": "New HMAC signing secret. Only present when rotated.",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No webhook subscription with this id belongs to the caller.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Update rejected. Same `error.code` values as create (`insecure_url`, `malformed_url`, `bad_scheme`, `port_not_allowed`, `userinfo_not_allowed`, `private_address`, `unresolvable_host`, `unsafe_url`), plus `validation_failed` when the body shape is wrong or no editable field was supplied.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/webhooks/{id}/deliveries": {
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "List delivery attempts for a subscription",
                "description": "Returns the most-recent delivery rows for the given subscription, newest first. Use this to debug 'why didn't my webhook fire?' — every fan-out (event-fire) creates a row, every retry updates the same row, and every manual replay creates a new row.",
                "operationId": "c39e7b4bae07c49c86f9e69aa44e0d9d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter: pending | delivered | exhausted",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "delivered",
                                "exhausted"
                            ]
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deliveries page.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WebhookDelivery"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Subscription not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        },
        "/api/v2/public/webhooks/deliveries/{id}/replay": {
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Re-fire a previous delivery",
                "description": "Creates a NEW delivery row referencing the same payload + event, dispatched to the subscription's CURRENT url. The original row is preserved unchanged. Use when a partner endpoint was down during the original attempt and you want to manually re-trigger.",
                "operationId": "89a43fe9c60896455f8eb40d336fcaf4",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "The delivery row id (NOT the subscription id).",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Replay scheduled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookDelivery"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Delivery not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "apiKeyAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "schemas": {
            "ScanOrderAddress": {
                "required": [
                    "street",
                    "city",
                    "state",
                    "zip"
                ],
                "properties": {
                    "street": {
                        "description": "Partner scan orders: /api/v2/public/scan-orders.\nGuide: https://www.clearbox.com/developers/scan-orders.html\n\nEvery read is scoped by the key's organization (public-api.partner sets\n`partner_organization`); another org's order answers 404.",
                        "type": "string",
                        "maxLength": 255,
                        "example": "123 Example St"
                    },
                    "unit": {
                        "type": "string",
                        "maxLength": 64,
                        "nullable": true
                    },
                    "city": {
                        "type": "string",
                        "maxLength": 128,
                        "example": "Springfield"
                    },
                    "state": {
                        "description": "Two-letter US state code; stored upper-case.",
                        "type": "string",
                        "pattern": "^[A-Za-z]{2}$",
                        "example": "IL"
                    },
                    "zip": {
                        "type": "string",
                        "pattern": "^[0-9]{5}(-[0-9]{4})?$",
                        "example": "62701"
                    }
                },
                "type": "object"
            },
            "CreateScanOrderRequest": {
                "required": [
                    "external_id",
                    "address"
                ],
                "properties": {
                    "external_id": {
                        "description": "Your id for this job. Unique per organization; echoed in every webhook.",
                        "type": "string",
                        "maxLength": 191,
                        "example": "YOUR-ORDER-123"
                    },
                    "address": {
                        "$ref": "#/components/schemas/ScanOrderAddress"
                    },
                    "appraiser_email": {
                        "description": "Contact only, for support. Never used to log anyone in or link accounts.",
                        "type": "string",
                        "format": "email",
                        "nullable": true
                    },
                    "callback_url": {
                        "description": "https only. Overrides your organization's webhook URL for this order.",
                        "type": "string",
                        "format": "uri",
                        "nullable": true
                    },
                    "tier": {
                        "description": "Frozen on the order. Left out, or above what your account allows, the order takes your account's highest tier.",
                        "type": "string",
                        "enum": [
                            "scan_only",
                            "scan_photos",
                            "full"
                        ]
                    },
                    "report_type": {
                        "description": "`uad` only on the `full` tier; otherwise `floorplan`. Frozen on the order.",
                        "type": "string",
                        "default": "floorplan",
                        "enum": [
                            "floorplan",
                            "uad"
                        ]
                    },
                    "valid_days": {
                        "description": "Days the launch link stays valid. Reissue to extend.",
                        "type": "integer",
                        "default": 7,
                        "maximum": 21,
                        "minimum": 1
                    }
                },
                "type": "object"
            },
            "ScanOrder": {
                "required": [
                    "id",
                    "external_id",
                    "status",
                    "tier",
                    "report_type",
                    "address",
                    "valid_until",
                    "created_at"
                ],
                "properties": {
                    "id": {
                        "description": "Boxli order id; `ticket_id` in webhooks.",
                        "type": "string",
                        "format": "uuid"
                    },
                    "external_id": {
                        "type": "string"
                    },
                    "status": {
                        "description": "`pending`: link not opened yet. `claimed`: opened on a phone, now bound to it. `delivered`: files ready. `cancelled`: cancelled by you or Boxli staff.",
                        "type": "string",
                        "enum": [
                            "pending",
                            "claimed",
                            "delivered",
                            "cancelled"
                        ]
                    },
                    "tier": {
                        "type": "string",
                        "enum": [
                            "scan_only",
                            "scan_photos",
                            "full"
                        ]
                    },
                    "report_type": {
                        "type": "string",
                        "enum": [
                            "floorplan",
                            "uad"
                        ]
                    },
                    "address": {
                        "$ref": "#/components/schemas/ScanOrderAddress"
                    },
                    "appraiser_email": {
                        "type": "string",
                        "format": "email",
                        "nullable": true
                    },
                    "callback_url": {
                        "type": "string",
                        "format": "uri",
                        "nullable": true
                    },
                    "valid_until": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "claimed_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "delivered_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "cancelled_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "model_id": {
                        "description": "Id of the current delivered file set; changes on `model_modified`. Null until delivered.",
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "ScanOrderWithLink": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ScanOrder"
                    },
                    {
                        "required": [
                            "scan_url"
                        ],
                        "properties": {
                            "scan_url": {
                                "description": "https link to open on the appraiser's iPhone. It carries only an opaque token. Boxli stores a hash of it, so it is returned only at creation and by reissue. Treat it like a password until it is opened.",
                                "type": "string",
                                "format": "uri",
                                "example": "https://clearbox.com/scan/Xk82hQ0vZpL3sN9wR4tY7uB1mC5dF6gH8jK0lP2qS4vW6yZ9"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "ScanOrderFileSet": {
                "required": [
                    "pdf",
                    "png",
                    "json"
                ],
                "properties": {
                    "pdf": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "format": "uri"
                        }
                    },
                    "png": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "format": "uri"
                        }
                    },
                    "json": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "format": "uri"
                        }
                    }
                },
                "type": "object"
            },
            "ScanOrderExport": {
                "description": "Files are frozen at delivery; after `model_modified` this returns the new set and its `model_id`.",
                "required": [
                    "order_id",
                    "model_id",
                    "delivered_at",
                    "expires_at",
                    "single",
                    "compose",
                    "sketch"
                ],
                "properties": {
                    "order_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "model_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "delivered_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "expires_at": {
                        "description": "When the URLs below stop working. Call again for fresh ones.",
                        "type": "string",
                        "format": "date-time"
                    },
                    "single": {
                        "description": "One floor plan PDF per floor, in floor order. `png` holds each floor's plan page from the phone, in the same order, when the phone uploaded one for every floor; otherwise it is empty.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/ScanOrderFileSet"
                            }
                        ]
                    },
                    "compose": {
                        "description": "Every floor in one PDF. `png` is empty.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/ScanOrderFileSet"
                            }
                        ]
                    },
                    "sketch": {
                        "description": "`json[0]` is the area file (sketch JSON, version 2). `png` lists the sketch pages the phone uploaded (plan, calculation and summary pages), in page order; empty when none were uploaded. Every `png` array is empty unless the phone drew all of its latest pages from the delivered plan.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/ScanOrderFileSet"
                            }
                        ]
                    }
                },
                "type": "object"
            },
            "ScanOrderWebhookBody": {
                "description": "The flat body sent to your scan-order webhook (no envelope). Signed like every Boxli webhook: `X-Boxli-Signature` is the lowercase hex HMAC-SHA256 of the raw body.",
                "required": [
                    "ticket_id",
                    "event",
                    "model_id",
                    "external_id"
                ],
                "properties": {
                    "ticket_id": {
                        "description": "The Boxli order id.",
                        "type": "string",
                        "format": "uuid"
                    },
                    "event": {
                        "type": "string",
                        "enum": [
                            "delivered",
                            "model_modified",
                            "deleted"
                        ]
                    },
                    "model_id": {
                        "description": "Null on `deleted`.",
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "external_id": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "PropertyDetail": {
                "properties": {
                    "uuid": {
                        "description": "Public-API detail shape for `App\\Models\\Property`. Adds count\naggregates so a single detail call gives clients enough to render\na summary card without N+1'ing through floors/rooms/photos.",
                        "type": "string",
                        "format": "uuid",
                        "example": "00000000-0000-0000-0000-000000000000"
                    },
                    "name": {
                        "type": "string",
                        "nullable": true
                    },
                    "address": {
                        "type": "string",
                        "nullable": true
                    },
                    "apartment": {
                        "type": "string",
                        "nullable": true
                    },
                    "city": {
                        "type": "string",
                        "nullable": true
                    },
                    "state": {
                        "type": "string",
                        "nullable": true
                    },
                    "postal_code": {
                        "type": "string",
                        "nullable": true
                    },
                    "latitude": {
                        "type": "number",
                        "format": "double",
                        "nullable": true
                    },
                    "longitude": {
                        "type": "number",
                        "format": "double",
                        "nullable": true
                    },
                    "altitude": {
                        "type": "number",
                        "format": "double",
                        "nullable": true
                    },
                    "property_type": {
                        "type": "string",
                        "nullable": true
                    },
                    "number_of_floors": {
                        "type": "integer"
                    },
                    "has_finished_attic": {
                        "type": "boolean"
                    },
                    "basement_levels": {
                        "type": "integer"
                    },
                    "scan_complete": {
                        "type": "boolean"
                    },
                    "floors_count": {
                        "type": "integer"
                    },
                    "rooms_count": {
                        "type": "integer"
                    },
                    "photos_count": {
                        "type": "integer"
                    },
                    "links": {
                        "description": "Hypermedia links to related endpoints.",
                        "properties": {
                            "floors": {
                                "type": "string",
                                "format": "uri",
                                "example": "https://api.boxli.ai/api/v2/public/properties/{uuid}/floors"
                            },
                            "photos": {
                                "type": "string",
                                "format": "uri",
                                "example": "https://api.boxli.ai/api/v2/public/properties/{uuid}/photos"
                            }
                        },
                        "type": "object"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "PropertyFloor": {
                "properties": {
                    "uuid": {
                        "description": "Public-API shape for `App\\Models\\PropertyFloor`.\n\nDeliberately omits the heavy `dashboard_overlay` JSON blob,\n`rendered_geometry`, and `floor_structure_path` (raw S3 key).",
                        "type": "string",
                        "format": "uuid",
                        "example": "00000000-0000-0000-0000-000000000000"
                    },
                    "floor_number": {
                        "type": "integer",
                        "example": 1
                    },
                    "name": {
                        "type": "string",
                        "example": "First Floor",
                        "nullable": true
                    },
                    "is_basement": {
                        "type": "boolean"
                    },
                    "rooms_count": {
                        "type": "integer"
                    },
                    "compass_heading": {
                        "type": "number",
                        "format": "double",
                        "nullable": true
                    },
                    "total_area_sq_ft": {
                        "type": "number",
                        "format": "double",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "PropertyPhoto": {
                "properties": {
                    "uuid": {
                        "description": "Public-API shape for `App\\Models\\PropertyPhoto`. Includes presigned\ndownload + thumbnail URLs.",
                        "type": "string",
                        "format": "uuid",
                        "example": "00000000-0000-0000-0000-000000000000"
                    },
                    "photo_code": {
                        "type": "string",
                        "example": "STRUCTURE_REAR",
                        "nullable": true
                    },
                    "display_label": {
                        "type": "string",
                        "example": "Structure Rear",
                        "nullable": true
                    },
                    "caption": {
                        "type": "string",
                        "nullable": true
                    },
                    "rotation": {
                        "type": "integer",
                        "example": 0
                    },
                    "captured_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "latitude": {
                        "type": "number",
                        "format": "double",
                        "nullable": true
                    },
                    "longitude": {
                        "type": "number",
                        "format": "double",
                        "nullable": true
                    },
                    "position": {
                        "properties": {
                            "x": {
                                "type": "number",
                                "format": "double"
                            },
                            "y": {
                                "type": "number",
                                "format": "double"
                            },
                            "z": {
                                "type": "number",
                                "format": "double"
                            }
                        },
                        "type": "object",
                        "nullable": true
                    },
                    "room_uuid": {
                        "type": "string",
                        "format": "uuid",
                        "example": "00000000-0000-0000-0000-000000000000",
                        "nullable": true
                    },
                    "floor_uuid": {
                        "type": "string",
                        "format": "uuid",
                        "example": "00000000-0000-0000-0000-000000000000",
                        "nullable": true
                    },
                    "download_url": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/PresignedDownload"
                            }
                        ],
                        "nullable": true
                    },
                    "availability": {
                        "description": "Whether download_url is currently usable.",
                        "type": "string",
                        "enum": [
                            "available",
                            "unavailable"
                        ]
                    },
                    "unavailable_reason": {
                        "description": "Machine-readable reason when availability is unavailable.",
                        "type": "string",
                        "enum": [
                            "missing_path",
                            "pending_upload",
                            "object_missing",
                            "storage_unavailable",
                            "presign_failed"
                        ],
                        "nullable": true
                    },
                    "thumbnail_url": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/PresignedDownload"
                            }
                        ],
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "Property": {
                "properties": {
                    "uuid": {
                        "description": "Public-API list shape for `App\\Models\\Property` (mobile-source\nscanned properties).",
                        "type": "string",
                        "format": "uuid",
                        "example": "00000000-0000-0000-0000-000000000000"
                    },
                    "name": {
                        "type": "string",
                        "nullable": true
                    },
                    "address": {
                        "type": "string",
                        "nullable": true
                    },
                    "apartment": {
                        "type": "string",
                        "nullable": true
                    },
                    "city": {
                        "type": "string",
                        "nullable": true
                    },
                    "state": {
                        "type": "string",
                        "nullable": true
                    },
                    "postal_code": {
                        "type": "string",
                        "nullable": true
                    },
                    "latitude": {
                        "type": "number",
                        "format": "double",
                        "nullable": true
                    },
                    "longitude": {
                        "type": "number",
                        "format": "double",
                        "nullable": true
                    },
                    "property_type": {
                        "type": "string",
                        "nullable": true
                    },
                    "number_of_floors": {
                        "type": "integer"
                    },
                    "scan_complete": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "PropertyRoom": {
                "properties": {
                    "uuid": {
                        "description": "Public-API shape for `App\\Models\\PropertyRoom`. Includes a\npresigned URL for the room's 3D model (USDZ) when one exists on S3.",
                        "type": "string",
                        "format": "uuid",
                        "example": "00000000-0000-0000-0000-000000000000"
                    },
                    "name": {
                        "type": "string",
                        "nullable": true
                    },
                    "room_type": {
                        "type": "string",
                        "nullable": true
                    },
                    "room_types": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "dimensions": {
                        "properties": {
                            "width": {
                                "type": "number",
                                "format": "double",
                                "nullable": true
                            },
                            "length": {
                                "type": "number",
                                "format": "double",
                                "nullable": true
                            },
                            "height": {
                                "type": "number",
                                "format": "double",
                                "nullable": true
                            }
                        },
                        "type": "object"
                    },
                    "position": {
                        "properties": {
                            "x": {
                                "type": "number",
                                "format": "double",
                                "nullable": true
                            },
                            "y": {
                                "type": "number",
                                "format": "double",
                                "nullable": true
                            },
                            "z": {
                                "type": "number",
                                "format": "double",
                                "nullable": true
                            }
                        },
                        "type": "object"
                    },
                    "model_download": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/PresignedDownload"
                            }
                        ],
                        "nullable": true
                    },
                    "photo_count": {
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "ScanDetail": {
                "properties": {
                    "uuid": {
                        "description": "Public-API detail shape for `App\\Models\\Scan`. Extends the list\nresource with `description` and a whitelisted subset of `metadata`\nkeys. Whitelisting prevents new metadata fields (e.g. an internal\ndebugging blob added by a future feature) from auto-leaking.",
                        "type": "string",
                        "format": "uuid",
                        "example": "00000000-0000-0000-0000-000000000000"
                    },
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "processing",
                            "complete",
                            "failed"
                        ]
                    },
                    "source": {
                        "type": "string",
                        "nullable": true
                    },
                    "file_type": {
                        "type": "string",
                        "nullable": true
                    },
                    "file_size": {
                        "type": "integer"
                    },
                    "property_uuid": {
                        "description": "Mobile-source property this scan represents. Use it with /properties/{uuid}/photos to fetch the scan's photos. Null for legacy non-mobile scans.",
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "has_report": {
                        "description": "True when a PDF report has been generated for this scan. Use links.report to fetch it.",
                        "type": "boolean"
                    },
                    "exterior_photos": {
                        "description": "Outdoor exterior photos (front / left / right / back / extra). 1–5 entries, each with a presigned download URL.",
                        "type": "array",
                        "items": {
                            "properties": {
                                "index": {
                                    "description": "1=front, 2..5=other angles.",
                                    "type": "integer",
                                    "example": 1
                                },
                                "download": {
                                    "oneOf": [
                                        {
                                            "$ref": "#/components/schemas/PresignedDownload"
                                        }
                                    ],
                                    "nullable": true
                                }
                            },
                            "type": "object"
                        }
                    },
                    "metadata": {
                        "description": "Whitelisted metadata keys only (source, device, version, rooms_scanned, room_photo_count). Internal fields are never exposed.",
                        "type": "object"
                    },
                    "links": {
                        "description": "Hypermedia links to related endpoints. Empty for non-mobile scans.",
                        "properties": {
                            "property": {
                                "type": "string",
                                "format": "uri",
                                "example": "https://api.boxli.ai/api/v2/public/properties/{uuid}"
                            },
                            "photos": {
                                "type": "string",
                                "format": "uri",
                                "example": "https://api.boxli.ai/api/v2/public/properties/{uuid}/photos"
                            },
                            "floors": {
                                "type": "string",
                                "format": "uri",
                                "example": "https://api.boxli.ai/api/v2/public/properties/{uuid}/floors"
                            }
                        },
                        "type": "object"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "processed_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "Scan": {
                "properties": {
                    "uuid": {
                        "description": "Public-API list shape for `App\\Models\\Scan`.\n\nDeliberately HIDES: `file_path` (raw S3 key), `metadata.storage_disk`\n(internal), `user_id` (clients don't need it; they're already\nscoped to their own data by middleware), raw `metadata` (may contain\ndevice fingerprints we don't want to leak).",
                        "type": "string",
                        "format": "uuid",
                        "example": "00000000-0000-0000-0000-000000000000"
                    },
                    "name": {
                        "type": "string",
                        "example": "Bedford St — Main Building"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "processing",
                            "complete",
                            "failed"
                        ]
                    },
                    "source": {
                        "type": "string",
                        "example": "mobile",
                        "nullable": true
                    },
                    "file_type": {
                        "type": "string",
                        "example": "clearbox",
                        "nullable": true
                    },
                    "file_size": {
                        "description": "Bytes.",
                        "type": "integer",
                        "example": 8421376
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "processed_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "ErrorEnvelope": {
                "description": "Standard error response shape. Every 4xx/5xx response\n *                  follows this envelope.",
                "properties": {
                    "error": {
                        "properties": {
                            "code": {
                                "description": "Top-level OpenAPI annotations for the Boxli Public Read-Only Client\nAPI. This file contains NO PHP code — it exists solely so swagger-php\nhas a stable place to find `@OA\\Info`, `@OA\\Server`,\n`@OA\\SecurityScheme`, and `@OA\\Tag` declarations.\n\nAll other annotations live alongside the controllers and Resources\nthey describe.",
                                "type": "string",
                                "example": "not_found"
                            },
                            "message": {
                                "type": "string",
                                "example": "Scan not found."
                            },
                            "details": {
                                "type": "object",
                                "nullable": true
                            }
                        },
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "PaginationMeta": {
                "description": "Pagination metadata included alongside list responses.",
                "properties": {
                    "current_page": {
                        "type": "integer",
                        "example": 1
                    },
                    "last_page": {
                        "type": "integer",
                        "example": 5
                    },
                    "per_page": {
                        "type": "integer",
                        "example": 15
                    },
                    "total": {
                        "type": "integer",
                        "example": 72
                    }
                },
                "type": "object"
            },
            "PresignedDownload": {
                "description": "A short-lived presigned URL for fetching a binary\n *                  asset directly from S3.",
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "example": "https://s3.us-east-1.amazonaws.com/..."
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-05-21T12:34:56+00:00"
                    }
                },
                "type": "object"
            },
            "WebhookSubscription": {
                "description": "A registered webhook subscription. The `secret` field\n *                  is NEVER included in subsequent fetches; it is shown\n *                  only once in the POST /webhooks response.",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "event": {
                        "type": "string",
                        "enum": [
                            "scan.completed",
                            "scan.failed"
                        ],
                        "example": "scan.completed"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "name": {
                        "type": "string",
                        "nullable": true
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "last_delivery_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "last_status": {
                        "description": "HTTP status code from the last delivery attempt. Null if never delivered.",
                        "type": "integer",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "ApiActivityEntry": {
                "description": "One row from your API activity log — the public-facing slice of `public_api_request_logs`. Sensitive fields (IP, User-Agent, full headers) are stripped; the rest is what you sent + what we returned. Useful for self-service debugging — every entry's `request_id` matches the `X-Request-Id` header you would have received on that response, so you can correlate failed-integration tickets without our help.",
                "properties": {
                    "request_id": {
                        "description": "Stable per-request id. Same value as the `X-Request-Id` response header you originally received.",
                        "type": "string",
                        "format": "uuid"
                    },
                    "auth_method": {
                        "description": "Which credential made this call. Null on rare unauthenticated paths.",
                        "type": "string",
                        "enum": [
                            "api_key",
                            "jwt"
                        ],
                        "nullable": true
                    },
                    "key_id": {
                        "description": "Public prefix of the API key that authenticated the request (e.g. `pk_AbCd1234…`). Null when authenticated via JWT.",
                        "type": "string",
                        "nullable": true
                    },
                    "method": {
                        "type": "string",
                        "example": "GET"
                    },
                    "path": {
                        "type": "string",
                        "example": "/api/v2/public/scans"
                    },
                    "query": {
                        "description": "Query parameters as sent. Secret-shaped keys (`password`, `token`, etc.) are redacted.",
                        "type": "object",
                        "nullable": true
                    },
                    "status_code": {
                        "type": "integer",
                        "example": 200
                    },
                    "response_ms": {
                        "description": "Time we spent producing the response, in milliseconds.",
                        "type": "integer",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "WebhookDelivery": {
                "description": "A single webhook delivery audit row. One row per fan-out attempt-set; retries update the same row's `attempts` / `last_status`. A manual replay creates a NEW row referencing the same envelope.",
                "properties": {
                    "id": {
                        "description": "Delivery row id. Use this with POST /webhooks/deliveries/{id}/replay.",
                        "type": "integer"
                    },
                    "subscription_id": {
                        "type": "integer"
                    },
                    "event": {
                        "type": "string",
                        "example": "scan.completed"
                    },
                    "url": {
                        "description": "The URL we POSTed to. Snapshot of the subscription's URL at fire-time; mid-flight retries stick to this even if you edit the subscription.",
                        "type": "string",
                        "format": "uri"
                    },
                    "delivery_uuid": {
                        "description": "Stable across all retries of THIS row. Sent to the partner as both the `id` field in the envelope and the `X-Boxli-Delivery-Id` header.",
                        "type": "string",
                        "format": "uuid"
                    },
                    "status": {
                        "description": "pending = in-flight or in backoff; delivered = got a 2xx (terminal); exhausted = max attempts reached without 2xx (terminal — partner must replay).",
                        "type": "string",
                        "enum": [
                            "pending",
                            "delivered",
                            "exhausted"
                        ]
                    },
                    "attempts": {
                        "description": "Number of HTTP attempts made so far. Max 5.",
                        "type": "integer"
                    },
                    "next_attempt_at": {
                        "description": "When the next retry will be attempted. Null on terminal rows.",
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "last_status": {
                        "description": "HTTP status code from the last attempt. Null until first attempt completes. 0 for network errors.",
                        "type": "integer",
                        "nullable": true
                    },
                    "last_error": {
                        "description": "Short truncated error string for the last attempt. Null on success.",
                        "type": "string",
                        "nullable": true
                    },
                    "delivered_at": {
                        "description": "When status flipped to delivered. Null otherwise.",
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "WebhookEventEnvelope": {
                "description": "The common envelope shape sent to your endpoint for every webhook event. The `data` field shape varies by `event` — see the per-event payload schemas (e.g. `ScanCompletedPayload`).",
                "properties": {
                    "id": {
                        "description": "Per-delivery UUID. Use it as the idempotency key on your receiving endpoint — if you see the same id twice, you've already processed this event.",
                        "type": "string",
                        "format": "uuid",
                        "example": "f8a92c1e-9b8e-4a5c-bd6f-1a2b3c4d5e6f"
                    },
                    "event": {
                        "description": "Event name. Matches the subscription's event filter.",
                        "type": "string",
                        "example": "scan.completed"
                    },
                    "created_at": {
                        "description": "When the event was generated on the boxli side (not delivery time).",
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-05-21T15:42:01+00:00"
                    },
                    "data": {
                        "description": "Event-specific payload. Shape depends on `event`.",
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "ScanCompletedPayload": {
                "description": "The `data` field shape for `event=scan.completed`. Fires when a scan transitions to status=`complete`.",
                "properties": {
                    "scan": {
                        "properties": {
                            "uuid": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "name": {
                                "type": "string",
                                "example": "165 Flower of Scotland Ave"
                            },
                            "status": {
                                "type": "string",
                                "example": "complete"
                            },
                            "processed_at": {
                                "type": "string",
                                "format": "date-time",
                                "nullable": true
                            }
                        },
                        "type": "object"
                    },
                    "property_uuid": {
                        "description": "Pivot UUID for the rich property hierarchy. Use it with GET /properties/{uuid}/photos to fetch the scan's photos. Null for legacy non-mobile scans.",
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "ScanFailedPayload": {
                "description": "The `data` field shape for `event=scan.failed`. Fires when a scan transitions to status=`failed`. Envelope shape mirrors ScanCompletedPayload (same `scan` + `property_uuid` fields) so partners can share envelope-parsing code between the two events; the `event` field on the outer WebhookEventEnvelope is what you switch on.",
                "properties": {
                    "scan": {
                        "properties": {
                            "uuid": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "name": {
                                "type": "string",
                                "example": "165 Flower of Scotland Ave"
                            },
                            "status": {
                                "type": "string",
                                "example": "failed"
                            },
                            "processed_at": {
                                "type": "string",
                                "format": "date-time",
                                "nullable": true
                            }
                        },
                        "type": "object"
                    },
                    "failure_reason": {
                        "description": "Optional human-readable hint about what went wrong (set by the processor when available). Treat as a hint, not a contract — the wording may change between processor versions. Null when the processor didn't record one.",
                        "type": "string",
                        "example": "Invalid file format: expected .e57, got .zip",
                        "nullable": true
                    },
                    "property_uuid": {
                        "description": "Pivot UUID for the rich property hierarchy. Null for non-mobile scans or when the failure happened before a property was created.",
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "RecruitPersonCard": {
                "description": "Masked Recruit people-search result. Contact details are omitted until reveal.",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string",
                        "example": "Jane Doe"
                    },
                    "profession": {
                        "type": "string",
                        "example": "appraiser"
                    },
                    "profession_label": {
                        "type": "string",
                        "example": "Appraiser"
                    },
                    "city": {
                        "type": "string",
                        "nullable": true
                    },
                    "state": {
                        "type": "string",
                        "nullable": true
                    },
                    "badges": {
                        "properties": {
                            "background_check": {
                                "type": "boolean"
                            },
                            "license": {
                                "type": "boolean"
                            },
                            "training": {
                                "type": "boolean"
                            },
                            "pdq_basic": {
                                "type": "boolean"
                            },
                            "pdq_pro": {
                                "type": "boolean"
                            }
                        },
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "RecruitRevealResult": {
                "description": "Result of revealing a Recruit contact. Includes full contact fields and remaining data credit balance.",
                "properties": {
                    "already_revealed": {
                        "type": "boolean"
                    },
                    "credits_spent": {
                        "type": "integer"
                    },
                    "balance": {
                        "type": "integer"
                    },
                    "contact": {
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "email": {
                                "description": "Primary email.",
                                "type": "string",
                                "nullable": true
                            },
                            "phone": {
                                "description": "Primary phone.",
                                "type": "string",
                                "nullable": true
                            },
                            "emails": {
                                "description": "Every known email, primary first. Status is active, bounced, invalid or reported (someone said it's wrong).",
                                "type": "array",
                                "items": {
                                    "properties": {
                                        "value": {
                                            "type": "string"
                                        },
                                        "primary": {
                                            "type": "boolean"
                                        },
                                        "status": {
                                            "type": "string"
                                        },
                                        "last_seen_at": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "phones": {
                                "description": "Every known phone, primary first.",
                                "type": "array",
                                "items": {
                                    "properties": {
                                        "value": {
                                            "type": "string"
                                        },
                                        "primary": {
                                            "type": "boolean"
                                        },
                                        "status": {
                                            "type": "string"
                                        },
                                        "last_seen_at": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "company": {
                                "type": "string",
                                "nullable": true
                            },
                            "address": {
                                "type": "string",
                                "nullable": true
                            },
                            "city": {
                                "type": "string",
                                "nullable": true
                            },
                            "state": {
                                "type": "string",
                                "nullable": true
                            },
                            "zip": {
                                "type": "string",
                                "nullable": true
                            }
                        },
                        "type": "object"
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "apiKeyAuth": {
                "type": "apiKey",
                "description": "API key for server-to-server access. Sent as\n *                  `X-API-Key: <key_id>.<secret>` on every request\n *                  (the two halves separated by a single dot — both\n *                  required). Keys never expire; soft-revoke via the\n *                  Boxli admin tooling if a credential is compromised.\n *\n *                  **API keys are the only accepted credential.**\n *                  There is no login / refresh flow — API access is a\n *                  provisioned commercial relationship; partners\n *                  request a key from Boxli staff and use it directly.\n *\n *                  The key inherits the data scope of the user it was\n *                  minted for — same access the human would have in\n *                  the dashboard, no more.\n *\n *                  Contact help@boxli.ai to request a key for a new\n *                  integration.",
                "name": "X-API-Key",
                "in": "header"
            }
        }
    },
    "tags": [
        {
            "name": "Auth",
            "description": "Identity + self-audit (`/auth/me`, `/auth/me/activity`)."
        },
        {
            "name": "Scans",
            "description": "Dashboard-source scans (list, detail, download)."
        },
        {
            "name": "Properties",
            "description": "Mobile-source scanned properties."
        },
        {
            "name": "Floors",
            "description": "Property floors (nested under a property)."
        },
        {
            "name": "Rooms",
            "description": "Floor rooms (nested under a floor)."
        },
        {
            "name": "Photos",
            "description": "Property + room photos with presigned download URLs."
        },
        {
            "name": "Recruit",
            "description": "People search + credit-gated contact reveal."
        },
        {
            "name": "Scan Orders",
            "description": "Order a LiDAR floor-plan scan for an appraiser, then download the floor plans. Partner API keys only: other keys get 403 here, and a partner key gets 403 on every other endpoint.\n *\n * **Flow:** create an order and keep its `scan_url` → open the link on the appraiser's iPhone (Boxli opens on that one job as a guest, with no Boxli account) → the appraiser locks every floor and taps Finish and send → Boxli POSTs `delivered` to your webhook → call `GET /scan-orders/{id}/export`.\n *\n * **Webhook events** (body: `ScanOrderWebhookBody`, flat, with no envelope). Sent to the order's `callback_url`, or to your organization's scan-order webhook, with the same `X-Boxli-Signature`, `X-Boxli-Event` and `X-Boxli-Delivery-Id` headers and the same retry schedule as every Boxli webhook (see Webhooks):\n * - `delivered` — once, when every floor is locked and the appraiser tapped Finish and send, or after 10 quiet minutes.\n * - `model_modified` — within 48 h of delivery the appraiser re-locked or deleted a floor; download the export again. Not billed again.\n * - `deleted` — the order was cancelled, or Boxli removed its job. `model_id` is null.\n *\n * Each event is retried on failure (see Webhooks). If one is still missed, poll `GET /scan-orders/{id}`."
        },
        {
            "name": "Webhooks",
            "description": "Subscribe to push notifications.\n *\n * **Available events:**\n * - `scan.completed` — fires when a scan transitions to status=`complete`. Payload: `ScanCompletedPayload`.\n * - `scan.failed`    — fires when a scan transitions to status=`failed`.    Payload: `ScanFailedPayload`.\n *\n * **Delivery headers** sent to your endpoint:\n * - `Content-Type: application/json`\n * - `X-Boxli-Event: <event name>` (e.g. `scan.completed`)\n * - `X-Boxli-Delivery-Id: <uuid>` — unique per delivery, dedupe key\n * - `X-Boxli-Signature: <hex>` — HMAC-SHA256 of the request body, using your subscription's secret\n *\n * **Verifying the signature (pseudocode):**\n * ```\n * expected = hmac_sha256(your_secret, raw_request_body_bytes).hex()\n * if not constant_time_equal(expected, request.headers['X-Boxli-Signature']):\n *     reject()\n * ```\n *\n * **URL requirements (enforced at subscription create AND at every delivery):**\n * - **Scheme** must be `http` or `https`. Production additionally requires `https://`.\n * - **Port** must be one of: 80, 443, 8080, 8443. Other ports are rejected. Ask if your infra requires something different.\n * - **No embedded credentials.** URLs with a `user:password@` segment are rejected.\n * - **No private / reserved IP ranges.** The URL's host must NOT resolve to loopback, RFC1918 (`10/8`, `172.16/12`, `192.168/16`), CGNAT (`100.64/10`), link-local (`169.254/16` — incl. the cloud metadata endpoint `169.254.169.254`), or the IPv6 equivalents.\n * - DNS-rebinding mitigation: the IP check runs again immediately before each delivery, not just at subscription time.\n *\n * **Delivery contract (v2 — async):**\n * - Asynchronous via the `webhooks` queue; the event-trigger returns immediately.\n * - 3-second HTTP timeout per attempt.\n * - **HTTP redirects (3xx) are NOT followed.** Point us at the terminus URL; a 30x is treated as a delivery failure.\n * - **Automatic retry on non-2xx / network error** with exponential backoff:\n *   attempt 1 immediate → attempt 2 +1m → attempt 3 +5m → attempt 4 +30m → attempt 5 +2h.\n *   After 5 attempts without a 2xx, the delivery is marked `exhausted` and the partner must manually replay.\n * - SSRF-guard trips at delivery time (e.g. a previously-public URL that started resolving to a private IP) terminal-fail the delivery as `exhausted` with `last_error: 'Refused: ...'` — no retries, since the URL is partner-controlled.\n * - **Except a host that doesn't resolve.** A DNS failure at delivery time is usually a blip, so it takes the normal retry schedule above like a network error (`last_error: 'DNS: ...'`), and only reaches `exhausted` after the 5th attempt.\n * - `X-Boxli-Delivery-Id` is **stable across retries of the same delivery** — your endpoint MUST be idempotent on this header (insert-only into a `processed_deliveries` table, etc.).\n * - **A manual replay creates a NEW delivery row** with a NEW `X-Boxli-Delivery-Id`, so you can distinguish 'this is a retry of what I already saw' from 'this is a fresh redelivery I should re-process.'\n * - Inspect delivery history via `GET /webhooks/{id}/deliveries`; replay via `POST /webhooks/deliveries/{id}/replay`."
        }
    ]
}