{
    "openapi": "3.1.0",
    "info": {
        "title": "Instaenv public API",
        "version": "2026-11-07",
        "summary": "Homes, tours, sales kits and leads of your agency.",
        "description": "The Instaenv public API lets your systems (CRM, portal feed, website) list, create and update the homes of your\nagency, read their tour, sales kit and leads, and publish or unpublish their public page.\n\n**Plans.** Your organization is limited by its plan: the homes published at the same time and the people in the\nteam. `GET /organization` shows both limits and what you use of them; going over one is refused with\n`403 plan_published_limit` or `403 plan_user_limit`.\n\n**Authentication.** Every call except this document needs an API key of your organization, created in\nSettings > Desarrolladores by the owner or a manager. Send it as `Authorization: Bearer ie_live_...`. A key acts\nfor the whole organization (every home, not one agent's), within its scopes.\n\n**Format.** JSON only, UTF-8. Timestamps are ISO-8601 in UTC (`2026-11-07T18:00:00Z`) and IDs are strings.\nHuman-readable messages are in English; send `Accept-Language: es|ca|de` to get them in another language.\n\n**Errors** share one envelope: `{\"error\": {\"code\": \"...\", \"message\": \"...\", \"details\": {...}}}`. Branch on\n`code`, never on `message`.\n\n**Pagination** is cursor-based: `limit` (1-100, default 25) and `cursor`. Lists answer\n`{\"data\": [...], \"next_cursor\": \"...\" | null}`; pass `next_cursor` as `cursor` to get the next page.\n\n**Idempotency.** POST requests accept an `Idempotency-Key` header (1-255 characters, a UUID is a good choice).\nFor 24 hours, the same key with the same request returns the stored response (with `Idempotent-Replayed: true`);\nthe same key with a different request is `409 idempotency_conflict`.\n\n**Rate limits.** 120 requests per minute per key. Every response carries `RateLimit-Limit`,\n`RateLimit-Remaining`, `RateLimit-Reset` (seconds) and `RateLimit-Policy`. Past the limit the API answers\n`429 rate_limited` with `Retry-After`.\n\n**Photo URLs** are signed and expire after about 6 hours: download the files, do not hotlink them.\n\n**Webhooks** notify your endpoints when something happens (see the `webhooks` section). Deliveries are\nat-least-once: deduplicate by event id. An event's `data.object` is exactly what the matching GET returns\n(a home is the `Property` object). Endpoints are managed in Settings > Desarrolladores or with the\n`/webhooks` endpoints below (scope `webhooks:manage`). Through the API, an event also needs the read scope\nof its data, to subscribe to it and to see or replay its deliveries: `lead.created` needs `leads:read`,\nevery other event `properties:read` (each event's `x-scope`, and `scope` in `GET /webhook-events`).\n",
        "contact": {
            "name": "Instaenv",
            "url": "https://instaenv.com"
        }
    },
    "servers": [
        {
            "url": "https://api.instaenv.com/api/public/v1",
            "description": "Production"
        }
    ],
    "security": [
        {
            "apiKey": []
        }
    ],
    "tags": [
        {
            "name": "Properties",
            "description": "Homes of your agency, with their tour, page, texts and photos."
        },
        {
            "name": "Leads",
            "description": "Buyers and tenants who wrote from the public pages."
        },
        {
            "name": "Organization",
            "description": "Your organization and discovery endpoints."
        },
        {
            "name": "Webhooks",
            "description": "Endpoints that receive your organization's events, and their delivery log (scope `webhooks:manage`, plus\n`leads:read` for `lead.created` and `properties:read` for every other event).\n"
        }
    ],
    "paths": {
        "/properties": {
            "get": {
                "tags": [
                    "Properties"
                ],
                "operationId": "listProperties",
                "summary": "List homes",
                "description": "Homes of your organization, most recently updated first. Requires `properties:read`.",
                "x-scope": "properties:read",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Only homes in this status.",
                        "schema": {
                            "$ref": "#/components/schemas/PropertyStatus"
                        }
                    },
                    {
                        "name": "reference",
                        "in": "query",
                        "description": "Only the home with this reference (your own ID for it).",
                        "schema": {
                            "type": "string",
                            "maxLength": 64
                        },
                        "example": "ABC123"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only homes updated at or after this time (ISO-8601).",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "example": "2026-11-01T00:00:00Z"
                    },
                    {
                        "name": "published",
                        "in": "query",
                        "description": "Only homes whose public page is (true) or is not (false) published.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "One page of homes.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PropertyList"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Properties"
                ],
                "operationId": "createProperty",
                "summary": "Create a home",
                "description": "Creates a home of your organization. Its tour is made from its 360 photos, added in the Instaenv app. The\nhome is in charge of your organization's owner unless `agent_email` names another member. Requires\n`properties:write`.\n",
                "x-scope": "properties:write",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PropertyCreate"
                            },
                            "example": {
                                "title": "Piso en Gràcia",
                                "reference": "ABC123",
                                "address": "Carrer de Verdi 12",
                                "city": "Barcelona",
                                "postal_code": "08012",
                                "operation": "sale",
                                "price": 345000,
                                "bedrooms": 3,
                                "bathrooms": 2,
                                "area_m2": 92
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The new home.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Property"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "409": {
                        "$ref": "#/components/responses/IdempotencyConflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/properties/{id}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/PropertyId"
                }
            ],
            "get": {
                "tags": [
                    "Properties"
                ],
                "operationId": "getProperty",
                "summary": "Get a home",
                "description": "Requires `properties:read`.",
                "x-scope": "properties:read",
                "responses": {
                    "200": {
                        "description": "The home.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Property"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Properties"
                ],
                "operationId": "updateProperty",
                "summary": "Update a home",
                "description": "Partial update. Only the fields you send change; send `null` to clear an optional field. Requires\n`properties:write`. On the free plan, turning the kit on for a home that has a recording and no kit yet\nwould generate it, so it is refused (`403 plan_no_ai`).\n",
                "x-scope": "properties:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PropertyUpdate"
                            },
                            "example": {
                                "price": 329000
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The updated home.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Property"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "description": "The key lacks `properties:write` (`insufficient_scope`), or the organization's plan does not include the automatic kit (`plan_no_ai`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "examples": {
                                    "insufficient_scope": {
                                        "value": {
                                            "error": {
                                                "code": "insufficient_scope",
                                                "required": "properties:write",
                                                "message": "This API key does not have the properties:write scope."
                                            }
                                        }
                                    },
                                    "plan_no_ai": {
                                        "value": {
                                            "error": {
                                                "code": "plan_no_ai",
                                                "message": "Your plan does not include this feature: the automatic sales kit, redoing pieces and translations are part of the paid plans. You can upload your 360 photos and fill in the home by hand. Change your plan to use it."
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "description": "Invalid fields (`validation_failed`), or the tour-only switch was refused: the page must be unpublished\nbefore a home becomes tour-only (`unpublish_first`). A refused request changes nothing.\n",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "examples": {
                                    "validation_failed": {
                                        "value": {
                                            "error": {
                                                "code": "validation_failed",
                                                "message": "Some fields are invalid.",
                                                "details": {
                                                    "fields": {
                                                        "price": [
                                                            "The price field must be an integer."
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "unpublish_first": {
                                        "value": {
                                            "error": {
                                                "code": "unpublish_first",
                                                "message": "Unpublish the property page before making this home 3D tour only.",
                                                "details": {
                                                    "fields": {
                                                        "kit_enabled": [
                                                            "Unpublish the property page before making this home 3D tour only."
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Properties"
                ],
                "operationId": "deleteProperty",
                "summary": "Delete a home",
                "description": "Deletes the home, its 360 photos, recordings, tour, kit and leads. Refused while a recording is being\nprocessed (`409 processing`). Requires `properties:write`.\n",
                "x-scope": "properties:write",
                "responses": {
                    "204": {
                        "description": "Deleted.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "description": "A recording of the home is being processed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "example": {
                                    "error": {
                                        "code": "processing",
                                        "message": "This home cannot be deleted while a recording is being processed. Wait until it finishes."
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/properties/{id}/publish": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/PropertyId"
                }
            ],
            "post": {
                "tags": [
                    "Properties"
                ],
                "operationId": "publishProperty",
                "summary": "Publish the public page",
                "description": "Puts the home's public page (and its QR code) live. Same rules as the app: the home needs its tour, at\nleast one 360 photo (`422 tour_required`), except on the free plan, whose page can also go live with just\nthe details, texts and photos written by hand; tour-only homes have no page (`422 kit_disabled`). The plan\nlimits the homes published at the same time (`403 plan_published_limit`). Publishing a published home is a\nno-op. Requires `properties:write`.\n",
                "x-scope": "properties:write",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The home, published.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Property"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "description": "The key lacks `properties:write` (`insufficient_scope`), or the organization already has as many homes\npublished as its plan allows (`plan_published_limit`): unpublish one or change plans.\n",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "examples": {
                                    "insufficient_scope": {
                                        "value": {
                                            "error": {
                                                "code": "insufficient_scope",
                                                "required": "properties:write",
                                                "message": "This API key does not have the properties:write scope."
                                            }
                                        }
                                    },
                                    "plan_published_limit": {
                                        "value": {
                                            "error": {
                                                "code": "plan_published_limit",
                                                "message": "Your plan allows 50 published homes at a time. Unpublish one or change plans to publish this one."
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/IdempotencyConflict"
                    },
                    "422": {
                        "description": "The home cannot be published.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                },
                                "examples": {
                                    "tour_required": {
                                        "value": {
                                            "error": {
                                                "code": "tour_required",
                                                "message": "The page can be published once the home has 360 photos."
                                            }
                                        }
                                    },
                                    "kit_disabled": {
                                        "value": {
                                            "error": {
                                                "code": "kit_disabled",
                                                "message": "This home is tour-only: it has no page to publish. Share its tour instead."
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/properties/{id}/unpublish": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/PropertyId"
                }
            ],
            "post": {
                "tags": [
                    "Properties"
                ],
                "operationId": "unpublishProperty",
                "summary": "Unpublish the public page",
                "description": "The page and its QR code answer \"no longer available\" until the home is published again. Requires `properties:write`.",
                "x-scope": "properties:write",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The home, unpublished.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Property"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/IdempotencyConflict"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/properties/{id}/leads": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/PropertyId"
                }
            ],
            "get": {
                "tags": [
                    "Leads"
                ],
                "operationId": "listPropertyLeads",
                "summary": "List a home's leads",
                "description": "Leads of one home, newest first. Requires `leads:read`.",
                "x-scope": "leads:read",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "One page of leads.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LeadList"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/leads": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "operationId": "listLeads",
                "summary": "List leads",
                "description": "Leads of every home of your organization, newest first. Requires `leads:read`.",
                "x-scope": "leads:read",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "name": "since",
                        "in": "query",
                        "description": "Only leads received at or after this time (ISO-8601).",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "property_id",
                        "in": "query",
                        "description": "Only leads of this home.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "One page of leads.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LeadList"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/organization": {
            "get": {
                "tags": [
                    "Organization"
                ],
                "operationId": "getOrganization",
                "summary": "Get your organization",
                "description": "Name and plan, with the plan's limits and what the organization uses of them. Any scope.",
                "responses": {
                    "200": {
                        "description": "Your organization.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Organization"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhook-events": {
            "get": {
                "tags": [
                    "Organization"
                ],
                "operationId": "listWebhookEvents",
                "summary": "List webhook event types",
                "description": "The event types webhooks can subscribe to, with the read scope an API key needs to subscribe to each one\nand to see its deliveries. Static; handy for discovery. Any scope.\n",
                "responses": {
                    "200": {
                        "description": "Event types.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "required": [
                                                    "type",
                                                    "description",
                                                    "scope"
                                                ],
                                                "properties": {
                                                    "type": {
                                                        "$ref": "#/components/schemas/EventType"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "scope": {
                                                        "type": "string",
                                                        "enum": [
                                                            "properties:read",
                                                            "leads:read"
                                                        ],
                                                        "description": "The read scope an API key needs for this event, besides `webhooks:manage`."
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "type": "property.created",
                                            "description": "A home was created (in the app, through the API or by the pipeline).",
                                            "scope": "properties:read"
                                        },
                                        {
                                            "type": "lead.created",
                                            "description": "A buyer or tenant wrote from the public page of a home.",
                                            "scope": "leads:read"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhooks": {
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "listWebhookEndpoints",
                "summary": "List webhook endpoints",
                "description": "Your organization's endpoints, newest first. Requires `webhooks:manage`.",
                "x-scope": "webhooks:manage",
                "responses": {
                    "200": {
                        "description": "The endpoints (without their secrets).",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WebhookEndpoint"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "createWebhookEndpoint",
                "summary": "Create a webhook endpoint",
                "description": "Up to 10 endpoints per organization. The URL must use HTTPS and reach a public address (private, loopback,\nlink-local and cloud metadata addresses are refused, when saving and again on every delivery). The response\ncarries the signing `secret` (`whsec_...`) this once: store it. Requires `webhooks:manage`, and the read\nscope of every event subscribed to (`leads:read` for `lead.created`, `properties:read` for the others; `*`\nneeds both), else `403 insufficient_scope` naming the missing one.\n",
                "x-scope": "webhooks:manage",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEndpointCreate"
                            },
                            "example": {
                                "url": "https://crm.example.com/hooks/instaenv",
                                "events": [
                                    "tour.ready",
                                    "lead.created"
                                ],
                                "description": "CRM sync"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The endpoint, with its secret (shown once).",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhooks/{endpoint}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/WebhookEndpointId"
                }
            ],
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "getWebhookEndpoint",
                "summary": "Get a webhook endpoint",
                "description": "Requires `webhooks:manage`.",
                "x-scope": "webhooks:manage",
                "responses": {
                    "200": {
                        "description": "The endpoint (without its secret).",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookEndpoint"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "updateWebhookEndpoint",
                "summary": "Update a webhook endpoint",
                "description": "Partial update. `enabled: true` turns an endpoint back on and clears its failure streak (also after it was\nswitched off automatically); `enabled: false` stops new events and pending retries. Requires\n`webhooks:manage`, and the read scope of every event the endpoint receives after the change, whatever\nfield changes (`403 insufficient_scope` otherwise).\n",
                "x-scope": "webhooks:manage",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEndpointUpdate"
                            },
                            "example": {
                                "enabled": true
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The updated endpoint.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookEndpoint"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "deleteWebhookEndpoint",
                "summary": "Delete a webhook endpoint",
                "description": "The endpoint and its delivery log are deleted; nothing more is sent to it. Requires `webhooks:manage`.",
                "x-scope": "webhooks:manage",
                "responses": {
                    "204": {
                        "description": "Deleted.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhooks/{endpoint}/rotate-secret": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/WebhookEndpointId"
                }
            ],
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "rotateWebhookSecret",
                "summary": "Rotate the signing secret",
                "description": "A new secret, returned this once. The old one stops working immediately. Requires `webhooks:manage`.",
                "x-scope": "webhooks:manage",
                "responses": {
                    "200": {
                        "description": "The endpoint, with its new secret.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhooks/{endpoint}/test": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/WebhookEndpointId"
                }
            ],
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "testWebhookEndpoint",
                "summary": "Send a test event",
                "description": "Sends a `ping` event to this endpoint, even while it is disabled: `{\"type\": \"ping\", \"data\": {\"object\":\n{\"endpoint_id\": \"...\", \"message\": \"Test event from Instaenv.\"}}}`, signed like every event. `ping` cannot be\nsubscribed to. 10 per minute. Requires `webhooks:manage`.\n",
                "x-scope": "webhooks:manage",
                "responses": {
                    "202": {
                        "description": "The delivery of the test event (usually already attempted).",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookDelivery"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhooks/{endpoint}/deliveries": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/WebhookEndpointId"
                }
            ],
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "listWebhookDeliveries",
                "summary": "List an endpoint's deliveries",
                "description": "Newest first, kept for 30 days. Requires `webhooks:manage`. Only the deliveries of events the key can read\nare listed (`ping`, `lead.created` with `leads:read`, the others with `properties:read`); filtering by an\nevent type it cannot read is `403 insufficient_scope`.\n",
                "x-scope": "webhooks:manage",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "succeeded",
                                "failed"
                            ]
                        }
                    },
                    {
                        "name": "event_type",
                        "in": "query",
                        "description": "An event type, or `ping`.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of deliveries.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "next_cursor"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WebhookDelivery"
                                            }
                                        },
                                        "next_cursor": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhook-deliveries/{delivery}/replay": {
            "parameters": [
                {
                    "name": "delivery",
                    "in": "path",
                    "required": true,
                    "description": "A delivery ID from the delivery log.",
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "replayWebhookDelivery",
                "summary": "Send a delivery again",
                "description": "Sends the same event (same event id and payload) again, as a new delivery. Receivers that deduplicate by\nevent id will ignore it if they already processed it. 30 per minute. Requires `webhooks:manage`. A\ndelivery of an event the key cannot read is `404`, as it is not in its delivery log.\n",
                "x-scope": "webhooks:manage",
                "responses": {
                    "202": {
                        "description": "The new delivery.",
                        "headers": {
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimitPolicy"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookDelivery"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/InsufficientScope"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/openapi.json": {
            "get": {
                "tags": [
                    "Organization"
                ],
                "operationId": "getOpenApi",
                "summary": "This document",
                "description": "The OpenAPI 3.1 description of this API. No API key needed.",
                "security": [],
                "responses": {
                    "200": {
                        "description": "OpenAPI document.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "apiKey": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "ie_live_ followed by 40 letters and digits",
                "description": "An API key of your organization (Settings > Desarrolladores). Scopes: `properties:read`,\n`properties:write`, `leads:read`, `webhooks:manage`. The key is shown once, when it is created.\n"
            }
        },
        "parameters": {
            "WebhookEndpointId": {
                "name": "endpoint",
                "in": "path",
                "required": true,
                "description": "The webhook endpoint's ID.",
                "schema": {
                    "type": "string",
                    "example": "01JC3Z7T8W2Q4N5M6P7R8S9T0V"
                }
            },
            "PropertyId": {
                "name": "id",
                "in": "path",
                "required": true,
                "description": "The home's ID.",
                "schema": {
                    "type": "string",
                    "pattern": "^\\d+$"
                },
                "example": "123"
            },
            "Limit": {
                "name": "limit",
                "in": "query",
                "description": "Items per page.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 25
                }
            },
            "Cursor": {
                "name": "cursor",
                "in": "query",
                "description": "`next_cursor` of the previous page.",
                "schema": {
                    "type": "string"
                }
            },
            "IdempotencyKey": {
                "name": "Idempotency-Key",
                "in": "header",
                "required": false,
                "description": "Makes retries safe for 24 hours. Same key and same request return the stored response; a different request is a 409.",
                "schema": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                },
                "example": "6f1c2a52-4d0e-4a54-9f0a-0d3c6a1b7e21"
            }
        },
        "headers": {
            "RateLimitLimit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                    "type": "integer"
                }
            },
            "RateLimitRemaining": {
                "description": "Requests left in the current window.",
                "schema": {
                    "type": "integer"
                }
            },
            "RateLimitReset": {
                "description": "Seconds until the window resets.",
                "schema": {
                    "type": "integer"
                }
            },
            "RateLimitPolicy": {
                "description": "The policy, `120;w=60`.",
                "schema": {
                    "type": "string"
                }
            }
        },
        "responses": {
            "Unauthenticated": {
                "description": "Missing, invalid, revoked or expired API key.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "unauthenticated",
                                "message": "Missing, invalid, revoked or expired API key. Send it as \"Authorization: Bearer ie_live_...\"."
                            }
                        }
                    }
                }
            },
            "InsufficientScope": {
                "description": "The key lacks the scope this endpoint needs.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "insufficient_scope",
                                "required": "properties:write",
                                "message": "This API key does not have the properties:write scope."
                            }
                        }
                    }
                }
            },
            "NotFound": {
                "description": "No home with this ID in your organization.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "not_found",
                                "message": "Not found."
                            }
                        }
                    }
                }
            },
            "ValidationFailed": {
                "description": "Invalid fields or query parameters. `details.fields` lists the messages per field.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "validation_failed",
                                "message": "Some fields are invalid.",
                                "details": {
                                    "fields": {
                                        "title": [
                                            "The title field is required."
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "IdempotencyConflict": {
                "description": "`idempotency_conflict`: the Idempotency-Key was already used with a different request.\n`idempotency_in_progress`: the first request with this key is still running; retry shortly.\n",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "idempotency_conflict",
                                "message": "This Idempotency-Key was already used with a different request."
                            }
                        }
                    }
                }
            },
            "RateLimited": {
                "description": "More than 120 requests in a minute with this key.",
                "headers": {
                    "Retry-After": {
                        "description": "Seconds to wait.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                },
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "rate_limited",
                                "message": "Too many requests. Slow down and retry after the time in Retry-After."
                            }
                        }
                    }
                }
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "description": "Machine-readable. One of `unauthenticated`, `insufficient_scope`, `forbidden`, `not_found`,\n`method_not_allowed`, `bad_request`, `validation_failed`, `invalid_idempotency_key`,\n`idempotency_conflict`, `idempotency_in_progress`, `processing`, `tour_required`, `kit_disabled`,\n`unpublish_first`, `plan_no_ai`, `plan_published_limit`, `plan_user_limit`, `rate_limited`,\n`internal_error`. `plan_published_limit`: the organization already has as many homes published as\nits plan allows (unpublish one or change plans). `plan_user_limit`: its team (members plus pending\ninvitations) has as many people as its plan allows.\n"
                            },
                            "message": {
                                "type": "string",
                                "description": "Human-readable, English unless Accept-Language asks for es, ca or de."
                            },
                            "required": {
                                "description": "The missing scope (insufficient_scope only).",
                                "type": "string"
                            },
                            "details": {
                                "type": "object",
                                "description": "More about the error. Validation errors have `fields` (field name to messages).",
                                "additionalProperties": true
                            }
                        }
                    }
                }
            },
            "PropertyStatus": {
                "type": "string",
                "description": "Where the home stands, as the app shows it:\n`no_recording` (no tour yet: no 360 photos nor recording), `processing` (a recording is being turned into\na tour), `recording_problem` (no tour and the latest recording was rejected or failed), `generating` (the\ntour exists and kit pieces are still being made), `ready` (tour and kit settled, page not published; a home\nwith 360 photos is ready), `published` (the public page is live). The names are kept for compatibility.\n",
                "enum": [
                    "no_recording",
                    "processing",
                    "recording_problem",
                    "generating",
                    "ready",
                    "published"
                ]
            },
            "Property": {
                "type": "object",
                "required": [
                    "id",
                    "reference",
                    "title",
                    "address",
                    "city",
                    "postal_code",
                    "country",
                    "operation",
                    "price",
                    "currency",
                    "bedrooms",
                    "bathrooms",
                    "area_m2",
                    "kit_enabled",
                    "show_exact_location",
                    "status",
                    "attention",
                    "tour",
                    "page",
                    "texts",
                    "photos",
                    "thumbnail",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "123"
                    },
                    "reference": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Your own ID for the home, unique in your organization.",
                        "example": "ABC123"
                    },
                    "title": {
                        "type": "string",
                        "description": "The home's internal name in the app.",
                        "example": "Piso en Gràcia"
                    },
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "Barcelona"
                    },
                    "postal_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "08012"
                    },
                    "country": {
                        "type": "string",
                        "enum": [
                            "ES",
                            "DE"
                        ],
                        "description": "ISO 3166-1 alpha-2 code of the home's country. It decides which documents the home needs and where its address is looked up on the map.",
                        "example": "ES"
                    },
                    "operation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "sale",
                            "rent",
                            null
                        ]
                    },
                    "price": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Whole euros.",
                        "example": 345000
                    },
                    "currency": {
                        "type": "string",
                        "const": "EUR"
                    },
                    "bedrooms": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "bathrooms": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "area_m2": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "kit_enabled": {
                        "type": "boolean",
                        "description": "False for tour-only homes (\"solo visita\"): they get the tour without the sales kit or a page, and\ntheir `texts` and `photos` are hidden (null and empty) while the kit is off.\n"
                    },
                    "show_exact_location": {
                        "type": "boolean",
                        "description": "How the public page's map places the home: the exact point (true), or an area of about 300 m around it\nwhose centre is not the home (false, the default). The address itself is never public.\n"
                    },
                    "status": {
                        "$ref": "#/components/schemas/PropertyStatus"
                    },
                    "attention": {
                        "type": "array",
                        "description": "What needs the agency: `needs_recording`, `recording_rejected`, `recording_failed`, `kit_missing`,\n`missing_details`, `pieces_failed`, `ready_to_publish`, `tour_hidden`. New values may be added.\n",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "needs_recording"
                        ]
                    },
                    "tour": {
                        "description": "The home's 3D tour (homes recorded before tours were made from 360 photos), null without one. A private tour has no links.",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "type": "object",
                                "required": [
                                    "ready",
                                    "share_url",
                                    "embed_url",
                                    "embed_html"
                                ],
                                "properties": {
                                    "ready": {
                                        "type": "boolean"
                                    },
                                    "share_url": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "uri",
                                        "example": "https://instaenv.com/s/k3j9x0aa2bq1"
                                    },
                                    "embed_url": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "uri",
                                        "example": "https://instaenv.com/embed/k3j9x0aa2bq1"
                                    },
                                    "embed_html": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "The iframe to paste in other websites; null when the organization does not allow embedding."
                                    }
                                }
                            }
                        ]
                    },
                    "page": {
                        "type": "object",
                        "required": [
                            "published",
                            "url",
                            "published_at"
                        ],
                        "properties": {
                            "published": {
                                "type": "boolean"
                            },
                            "url": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri",
                                "description": "The public page, while it is published.",
                                "example": "https://instaenv.com/en/p/piso-barcelona-x8k2m1qa"
                            },
                            "published_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        }
                    },
                    "texts": {
                        "description": "Listing texts per language (es, en, ca, de), null until written. A language not written yet is null.",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "es": {
                                        "$ref": "#/components/schemas/ListingText"
                                    },
                                    "en": {
                                        "$ref": "#/components/schemas/ListingText"
                                    },
                                    "ca": {
                                        "$ref": "#/components/schemas/ListingText"
                                    },
                                    "de": {
                                        "$ref": "#/components/schemas/ListingText"
                                    }
                                }
                            }
                        ]
                    },
                    "photos": {
                        "type": "array",
                        "description": "The kit's photos. URLs are signed and expire after about 6 hours; download them, do not hotlink.",
                        "items": {
                            "$ref": "#/components/schemas/Photo"
                        }
                    },
                    "thumbnail": {
                        "description": "The home's picture for lists and feeds, as the app shows it: the kit's first photo, else the tour's\nthumbnail (always the tour's for tour-only homes). Null until there is one. Signed like `photos`.\n",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/Photo"
                            }
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "example": {
                    "id": "123",
                    "reference": "ABC123",
                    "title": "Piso en Gràcia",
                    "address": "Carrer de Verdi 12",
                    "city": "Barcelona",
                    "postal_code": "08012",
                    "country": "ES",
                    "operation": "sale",
                    "price": 345000,
                    "currency": "EUR",
                    "bedrooms": 3,
                    "bathrooms": 2,
                    "area_m2": 92,
                    "kit_enabled": true,
                    "show_exact_location": false,
                    "status": "published",
                    "attention": [],
                    "tour": {
                        "ready": true,
                        "share_url": "https://instaenv.com/s/k3j9x0aa2bq1",
                        "embed_url": "https://instaenv.com/embed/k3j9x0aa2bq1",
                        "embed_html": "<iframe src=\"https://instaenv.com/embed/k3j9x0aa2bq1\" width=\"100%\" height=\"560\" style=\"border:0\" allow=\"fullscreen; xr-spatial-tracking\" loading=\"lazy\"></iframe>"
                    },
                    "page": {
                        "published": true,
                        "url": "https://instaenv.com/en/p/piso-barcelona-x8k2m1qa",
                        "published_at": "2026-11-07T18:00:00Z"
                    },
                    "texts": {
                        "es": {
                            "title": "Luminoso piso de 3 habitaciones en Gràcia",
                            "description": "Piso exterior y reformado a dos minutos de la plaza del Sol.",
                            "highlights": [
                                "Exterior",
                                "Reformado",
                                "Ascensor"
                            ]
                        },
                        "en": null,
                        "ca": null,
                        "de": null
                    },
                    "photos": [
                        {
                            "url": "https://files.instaenv.com/properties/123/photos/01.jpg?X-Amz-Signature=...",
                            "width": 1600,
                            "height": 1200,
                            "sources": [
                                {
                                    "type": "image/webp",
                                    "srcset": "https://files.instaenv.com/properties/123/photos/01-480.webp?X-Amz-Signature=... 480w, https://files.instaenv.com/properties/123/photos/01-960.webp?X-Amz-Signature=... 960w"
                                }
                            ]
                        }
                    ],
                    "thumbnail": {
                        "url": "https://files.instaenv.com/properties/123/photos/01.jpg?X-Amz-Signature=...",
                        "width": 1600,
                        "height": 1200,
                        "sources": [
                            {
                                "type": "image/webp",
                                "srcset": "https://files.instaenv.com/properties/123/photos/01-480.webp?X-Amz-Signature=... 480w, https://files.instaenv.com/properties/123/photos/01-960.webp?X-Amz-Signature=... 960w"
                            }
                        ]
                    },
                    "created_at": "2026-11-05T09:30:00Z",
                    "updated_at": "2026-11-07T18:00:00Z"
                }
            },
            "ListingText": {
                "oneOf": [
                    {
                        "type": "null"
                    },
                    {
                        "type": "object",
                        "required": [
                            "title",
                            "description",
                            "highlights"
                        ],
                        "properties": {
                            "title": {
                                "type": "string"
                            },
                            "description": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "highlights": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                ]
            },
            "Photo": {
                "type": "object",
                "required": [
                    "url",
                    "width",
                    "height",
                    "sources"
                ],
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "The original, signed (about 6 hours)."
                    },
                    "width": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "height": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "sources": {
                        "type": "array",
                        "description": "Smaller responsive copies by format, best first (`<picture>` sources): AVIF where our servers can encode\nit, WebP, then JPEG. Empty until the copies are made; the original `url` is then the only source.\n",
                        "items": {
                            "type": "object",
                            "required": [
                                "type",
                                "srcset"
                            ],
                            "properties": {
                                "type": {
                                    "type": "string",
                                    "example": "image/avif"
                                },
                                "srcset": {
                                    "type": "string",
                                    "example": "https://files.instaenv.com/.../01-480.avif 480w, https://files.instaenv.com/.../01-960.avif 960w"
                                }
                            }
                        }
                    }
                }
            },
            "PropertyCreate": {
                "type": "object",
                "required": [
                    "title"
                ],
                "properties": {
                    "title": {
                        "type": "string",
                        "maxLength": 160
                    },
                    "reference": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64,
                        "description": "Your own ID for the home. Must be unique in your organization."
                    },
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120
                    },
                    "postal_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 10,
                        "pattern": "^[0-9A-Za-z -]+$"
                    },
                    "country": {
                        "type": "string",
                        "enum": [
                            "ES",
                            "DE"
                        ],
                        "default": "ES",
                        "description": "ISO 3166-1 alpha-2 code of the home's country."
                    },
                    "operation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "sale",
                            "rent",
                            null
                        ],
                        "default": "sale"
                    },
                    "price": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000000
                    },
                    "bedrooms": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 50
                    },
                    "bathrooms": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 50
                    },
                    "area_m2": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "minimum": 1,
                        "maximum": 100000
                    },
                    "kit_enabled": {
                        "type": "boolean",
                        "default": true,
                        "description": "False creates a tour-only home (\"solo visita\"): it gets the tour without the sales kit or a page.\n"
                    },
                    "show_exact_location": {
                        "type": "boolean",
                        "default": false,
                        "description": "Show the exact point on the public page's map instead of an area around the home."
                    },
                    "agent_email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "description": "The member of your organization in charge of the home. Defaults to the organization's owner."
                    }
                }
            },
            "PropertyUpdate": {
                "type": "object",
                "description": "Any of the creation fields; only the ones sent change.",
                "properties": {
                    "title": {
                        "type": "string",
                        "maxLength": 160
                    },
                    "reference": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120
                    },
                    "postal_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 10
                    },
                    "country": {
                        "type": "string",
                        "enum": [
                            "ES",
                            "DE"
                        ],
                        "description": "ISO 3166-1 alpha-2 code of the home's country."
                    },
                    "operation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "sale",
                            "rent",
                            null
                        ]
                    },
                    "price": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000000
                    },
                    "bedrooms": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 50
                    },
                    "bathrooms": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 50
                    },
                    "area_m2": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "minimum": 1,
                        "maximum": 100000
                    },
                    "kit_enabled": {
                        "type": "boolean",
                        "description": "The tour-only switch, with the app's rules. `false` is refused while the page is published\n(`422 unpublish_first`); the kit pieces the home has are kept, hidden. `true` shows them again; when the\nhome has a recording but no kit yet, the kit is ordered from it.\n"
                    },
                    "show_exact_location": {
                        "type": "boolean",
                        "description": "Show the exact point on the public page's map (true) or an area around the home (false)."
                    },
                    "agent_email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "description": "Hand the home to another member; null gives it back to the organization's owner."
                    }
                }
            },
            "PropertyList": {
                "type": "object",
                "required": [
                    "data",
                    "next_cursor"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Property"
                        }
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            },
            "Lead": {
                "type": "object",
                "required": [
                    "id",
                    "property_id",
                    "name",
                    "email",
                    "phone",
                    "message",
                    "created_at"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "42"
                    },
                    "property_id": {
                        "type": "string",
                        "example": "123"
                    },
                    "name": {
                        "type": "string"
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email"
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "message": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "example": {
                    "id": "42",
                    "property_id": "123",
                    "name": "Marta Puig",
                    "email": "marta@example.com",
                    "phone": "+34 600 000 000",
                    "message": "Is it still available? I would like to visit it this week.",
                    "created_at": "2026-11-07T18:00:00Z"
                }
            },
            "LeadList": {
                "type": "object",
                "required": [
                    "data",
                    "next_cursor"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Lead"
                        }
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            },
            "Organization": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "plan"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "plan": {
                        "$ref": "#/components/schemas/Plan"
                    }
                },
                "example": {
                    "id": "1",
                    "name": "Finques Gràcia",
                    "plan": {
                        "key": "pro",
                        "published_limit": 50,
                        "user_limit": 10,
                        "published": 12,
                        "users": 3
                    }
                }
            },
            "Plan": {
                "type": "object",
                "description": "The organization's plan, its limits (null: no limit) and what the organization uses of them, counted as\npublishing (`403 plan_published_limit`) and inviting (`403 plan_user_limit`) are refused.\n",
                "required": [
                    "key",
                    "published_limit",
                    "user_limit",
                    "published",
                    "users"
                ],
                "properties": {
                    "key": {
                        "type": "string",
                        "description": "`free`, `pro` or `enterprise`. New values may be added.",
                        "example": "pro"
                    },
                    "published_limit": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Homes that can be published at the same time; null without a limit.",
                        "example": 50
                    },
                    "user_limit": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "People in the team, members plus pending invitations; null without a limit.",
                        "example": 10
                    },
                    "published": {
                        "type": "integer",
                        "description": "Homes of the organization published now.",
                        "example": 12
                    },
                    "users": {
                        "type": "integer",
                        "description": "Members plus invitations still pending.",
                        "example": 3
                    }
                }
            },
            "WebhookEndpoint": {
                "type": "object",
                "required": [
                    "id",
                    "url",
                    "description",
                    "events",
                    "enabled",
                    "failure_count",
                    "disabled_at",
                    "disabled_reason",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "01JC3Z7T8W2Q4N5M6P7R8S9T0V"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "example": "https://crm.example.com/hooks/instaenv"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "events": {
                        "type": "array",
                        "description": "Event types it receives; `[\"*\"]` is every type, including ones added later.",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "tour.ready",
                            "lead.created"
                        ]
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "failure_count": {
                        "type": "integer",
                        "description": "Failed attempts since the last success."
                    },
                    "disabled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "disabled_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "failing",
                            "manual",
                            null
                        ],
                        "description": "`failing`: switched off automatically after 3 days of failures or 50 failed deliveries in a row (the\nowner gets an email); `manual`: switched off by your agency.\n"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "WebhookEndpointWithSecret": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/WebhookEndpoint"
                    },
                    {
                        "type": "object",
                        "required": [
                            "secret"
                        ],
                        "properties": {
                            "secret": {
                                "type": "string",
                                "description": "The signing secret, shown only on creation and rotation.",
                                "example": "whsec_3fJ8kQ2mN7pR1sT5vX9zB4cD6gH0jL2n"
                            }
                        }
                    }
                ]
            },
            "WebhookEndpointCreate": {
                "type": "object",
                "required": [
                    "url",
                    "events"
                ],
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "maxLength": 2048,
                        "description": "HTTPS, on a public address, without user name or password."
                    },
                    "events": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "type": "string",
                            "description": "An event type or `*`."
                        }
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "enabled": {
                        "type": "boolean",
                        "default": true
                    }
                }
            },
            "WebhookEndpointUpdate": {
                "type": "object",
                "description": "Any of the creation fields; only the ones sent change.",
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "maxLength": 2048
                    },
                    "events": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "type": "string"
                        }
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "enabled": {
                        "type": "boolean"
                    }
                }
            },
            "WebhookDelivery": {
                "type": "object",
                "required": [
                    "id",
                    "endpoint_id",
                    "event_id",
                    "event_type",
                    "status",
                    "attempt",
                    "response_status",
                    "response_body_excerpt",
                    "duration_ms",
                    "error",
                    "next_retry_at",
                    "payload",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "endpoint_id": {
                        "type": "string"
                    },
                    "event_id": {
                        "type": "string",
                        "example": "evt_01JC3Z7T8W2Q4N5M6P7R8S9T0V"
                    },
                    "event_type": {
                        "type": "string",
                        "description": "An event type, or `ping` for test events."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "succeeded",
                            "failed"
                        ],
                        "description": "`pending` while attempts remain, `failed` after the last retry (or when the endpoint was disabled)."
                    },
                    "attempt": {
                        "type": "integer",
                        "description": "Attempts made so far."
                    },
                    "response_status": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The HTTP status your endpoint answered on the last attempt."
                    },
                    "response_body_excerpt": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "The first kilobyte of that answer."
                    },
                    "duration_ms": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "error": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Why the last attempt got no HTTP answer (`timeout`, `connection_failed`, `private_address`, `endpoint_disabled`...)."
                    },
                    "next_retry_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "payload": {
                        "$ref": "#/components/schemas/EventEnvelope"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "Recording": {
                "type": "object",
                "description": "The recording an event is about (`data.recording` of recording and tour events).",
                "required": [
                    "id",
                    "status",
                    "corrective",
                    "uploaded_at",
                    "created_at"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "description": "`analyzing`, `reconstructing`, `published`, `failed`, `rejected`..."
                    },
                    "corrective": {
                        "type": "boolean",
                        "description": "A corrective recording, redoing one area of a published tour."
                    },
                    "uploaded_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "EventType": {
                "type": "string",
                "enum": [
                    "property.created",
                    "property.updated",
                    "property.deleted",
                    "recording.uploaded",
                    "recording.failed",
                    "tour.ready",
                    "kit.ready",
                    "property.published",
                    "property.unpublished",
                    "lead.created"
                ]
            },
            "EventEnvelope": {
                "type": "object",
                "description": "Every webhook delivery is a POST with this JSON body and the headers `Instaenv-Signature`\n(`t=<unix>,v1=<hex HMAC-SHA256(secret, \"<t>.<raw body>\")>`), `Instaenv-Event-Id`, `Instaenv-Event-Type`,\n`Content-Type: application/json` and `User-Agent: Instaenv-Webhooks/1`. Reject timestamps older than\n5 minutes. Any 2xx within 10 seconds counts as delivered; otherwise it is retried after 1 min, 5 min,\n30 min, 2 h, 6 h, 12 h and 24 h. Delivery is at-least-once: deduplicate by `id`.\n",
                "required": [
                    "id",
                    "type",
                    "created_at",
                    "api_version",
                    "organization_id",
                    "data"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "evt_01JC3Z7T8W2Q4N5M6P7R8S9T0V"
                    },
                    "type": {
                        "$ref": "#/components/schemas/EventType"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "api_version": {
                        "type": "string",
                        "const": "2026-11-07"
                    },
                    "organization_id": {
                        "type": "string",
                        "example": "1"
                    },
                    "data": {
                        "type": "object",
                        "required": [
                            "object"
                        ],
                        "properties": {
                            "object": {
                                "type": "object"
                            }
                        }
                    }
                }
            },
            "PropertyEvent": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/EventEnvelope"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "data": {
                                "type": "object",
                                "properties": {
                                    "object": {
                                        "$ref": "#/components/schemas/Property"
                                    }
                                }
                            }
                        }
                    }
                ]
            },
            "PropertyDeletedEvent": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/EventEnvelope"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "const": "property.deleted"
                            },
                            "data": {
                                "type": "object",
                                "properties": {
                                    "object": {
                                        "type": "object",
                                        "required": [
                                            "id",
                                            "reference"
                                        ],
                                        "properties": {
                                            "id": {
                                                "type": "string"
                                            },
                                            "reference": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ]
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                ]
            },
            "RecordingEvent": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/EventEnvelope"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "data": {
                                "type": "object",
                                "required": [
                                    "object",
                                    "recording"
                                ],
                                "properties": {
                                    "object": {
                                        "$ref": "#/components/schemas/Property"
                                    },
                                    "recording": {
                                        "$ref": "#/components/schemas/Recording"
                                    }
                                }
                            }
                        }
                    }
                ]
            },
            "RecordingFailedEvent": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/EventEnvelope"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "const": "recording.failed"
                            },
                            "data": {
                                "type": "object",
                                "required": [
                                    "object",
                                    "recording"
                                ],
                                "properties": {
                                    "object": {
                                        "$ref": "#/components/schemas/Property"
                                    },
                                    "recording": {
                                        "allOf": [
                                            {
                                                "$ref": "#/components/schemas/Recording"
                                            },
                                            {
                                                "type": "object",
                                                "required": [
                                                    "error_code",
                                                    "retry_useful"
                                                ],
                                                "properties": {
                                                    "status": {
                                                        "enum": [
                                                            "failed",
                                                            "rejected"
                                                        ]
                                                    },
                                                    "error_code": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "description": "Why it failed or was rejected (for example `sfm_no_model`, `too_dark`, `worker_lost`)."
                                                    },
                                                    "retry_useful": {
                                                        "type": "boolean",
                                                        "description": "Whether retrying the same recording can work: true only for failures on our side (a\nworker or a queue failed). False when the same recording would fail the same way again\n(it could not be aligned or read, or the quality check rejected it): record again.\n"
                                                    }
                                                }
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                ]
            },
            "LeadEvent": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/EventEnvelope"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "const": "lead.created"
                            },
                            "data": {
                                "type": "object",
                                "properties": {
                                    "object": {
                                        "$ref": "#/components/schemas/Lead"
                                    }
                                }
                            }
                        }
                    }
                ]
            }
        }
    },
    "webhooks": {
        "property.created": {
            "post": {
                "x-scope": "properties:read",
                "summary": "A home was created",
                "description": "Fired for homes created in the app, through the API or by the pipeline.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PropertyEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx acknowledges the event."
                    }
                }
            }
        },
        "property.updated": {
            "post": {
                "x-scope": "properties:read",
                "summary": "A home changed",
                "description": "Only meaningful field changes, debounced to at most one event per home per minute.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PropertyEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx acknowledges the event."
                    }
                }
            }
        },
        "property.deleted": {
            "post": {
                "x-scope": "properties:read",
                "summary": "A home was deleted",
                "description": "The data holds only the home's id and reference.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PropertyDeletedEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx acknowledges the event."
                    }
                }
            }
        },
        "recording.uploaded": {
            "post": {
                "x-scope": "properties:read",
                "summary": "A recording was uploaded",
                "description": "The capture upload was confirmed; processing starts. `data.recording` is the recording.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/RecordingEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx acknowledges the event."
                    }
                }
            }
        },
        "recording.failed": {
            "post": {
                "x-scope": "properties:read",
                "summary": "A recording failed",
                "description": "The recording could not be turned into a tour (failed or rejected by the quality check).\n`data.recording` has its `error_code` and `retry_useful`.\n",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/RecordingFailedEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx acknowledges the event."
                    }
                }
            }
        },
        "tour.ready": {
            "post": {
                "x-scope": "properties:read",
                "summary": "The tour is ready",
                "description": "The tour made from the recording is published and can be shared. `data.recording` is the recording.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/RecordingEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx acknowledges the event."
                    }
                }
            }
        },
        "kit.ready": {
            "post": {
                "x-scope": "properties:read",
                "summary": "The kit settled",
                "description": "Every piece of the sales kit is ready or failed.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PropertyEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx acknowledges the event."
                    }
                }
            }
        },
        "property.published": {
            "post": {
                "x-scope": "properties:read",
                "summary": "The page was published",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PropertyEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx acknowledges the event."
                    }
                }
            }
        },
        "property.unpublished": {
            "post": {
                "x-scope": "properties:read",
                "summary": "The page was unpublished",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PropertyEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx acknowledges the event."
                    }
                }
            }
        },
        "lead.created": {
            "post": {
                "x-scope": "leads:read",
                "summary": "A lead arrived",
                "description": "A buyer or tenant wrote from the home's public page.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/LeadEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx acknowledges the event."
                    }
                }
            }
        }
    }
}
