{
    "openapi": "3.1.0",
    "info": {
        "title": "Best Guest Partner API",
        "version": "1.0",
        "summary": "Push reservations and guests into Best Guest, read their compliance status back, and get webhooks.",
        "description": "For channel managers, PMSes and CRMs. A host creates a key in the Best Guest admin app (Settings > API Access) and gives it to you; send it as `Authorization: bgk_...` (`Bearer bgk_...` is accepted too). A key belongs to one workspace and can only reach this API.\n\nEvery response is `{ \"result\": true|false, \"data\": ..., \"errors\": [] }` with a real HTTP status. GET endpoints take query parameters, POST endpoints a JSON body. A `read` key may call GET endpoints only.\n\nv1 is source-compatible: a field is never removed or repurposed, new optional fields and new endpoints may be added, a breaking change ships as v2. Only the fields documented here are covered by that promise.\n\nSandbox: keys starting `bgk_test_` belong to a sandbox workspace on the same host. Nothing a sandbox does reaches a guest, a police portal, a bank or an invoice.",
        "contact": {
            "name": "Best Guest",
            "url": "https://bestguest.cz/en/developers"
        }
    },
    "servers": [
        {
            "url": "https://api.bestguest.app",
            "description": "Production and sandbox (the key decides)"
        }
    ],
    "tags": [
        {
            "name": "Account"
        },
        {
            "name": "Properties"
        },
        {
            "name": "Reservations"
        },
        {
            "name": "Webhooks"
        },
        {
            "name": "Events"
        },
        {
            "name": "Sandbox"
        }
    ],
    "paths": {
        "/v1/cancelReservation": {
            "post": {
                "operationId": "cancelReservation",
                "tags": [
                    "Reservations"
                ],
                "summary": "Cancel (soft-delete) a reservation",
                "description": "Cancel (soft-delete) a reservation. Refuses with ALREADY_SENT once it has been submitted for police reporting - that step is not reversible via the API.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "additionalProperties": true
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reservationId": {
                                        "type": "integer"
                                    },
                                    "externalId": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/createWebhook": {
            "post": {
                "operationId": "createWebhook",
                "tags": [
                    "Webhooks"
                ],
                "summary": "Register a webhook receiver",
                "description": "Register a webhook receiver. The signing secret is returned once. Events are delivered at least once, in no guaranteed order; deduplicate on the event id. A \"write\"-scope key is required.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/WebhookCreated"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string"
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "accommodationIds": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "required": [
                                    "url"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/v1/deleteWebhook": {
            "post": {
                "operationId": "deleteWebhook",
                "tags": [
                    "Webhooks"
                ],
                "summary": "Remove a webhook receiver; deliveries still waiting for it are cancelled",
                "description": "Remove a webhook receiver; deliveries still waiting for it are cancelled. A \"write\"-scope key is required.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "deleted": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "webhookId": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "webhookId"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/v1/getAccountStatus": {
            "get": {
                "operationId": "getAccountStatus",
                "tags": [
                    "Account"
                ],
                "summary": "Billing/subscription status for the workspace",
                "description": "Billing/subscription status for the workspace.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "additionalProperties": true
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": []
            }
        },
        "/v1/getEvents": {
            "get": {
                "operationId": "getEvents",
                "tags": [
                    "Events"
                ],
                "summary": "The ordered event feed: the pull-based way to recover from anything a webhook missed, or to sync without webhooks",
                "description": "The ordered event feed: the pull-based way to recover from anything a webhook missed, or to sync without webhooks. Events are kept 30 days: a cursor older than that is answered with 410 CURSOR_EXPIRED, and you start again without a cursor and resynchronise with getReservations.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/EventPage"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "410": {
                        "$ref": "#/components/responses/Gone"
                    }
                },
                "parameters": [
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "description": "Cursor: an event id (evt_123 or 123). Start with 0; pass the returned nextCursor next time.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Events per page, 1-500 (default 100).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "types",
                        "in": "query",
                        "required": false,
                        "description": "Only these event types (comma separated).",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ]
            }
        },
        "/v1/getMulticalendar": {
            "get": {
                "operationId": "getMulticalendar",
                "tags": [
                    "Reservations"
                ],
                "summary": "Property/listing roster + reservations + iCal blocks for one date window, in one round trip - the efficient way to poll for changes incrementally (the API has no updatedSince filter)",
                "description": "Property/listing roster + reservations + iCal blocks for one date window, in one round trip - the efficient way to poll for changes incrementally (the API has no updatedSince filter).",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "additionalProperties": true
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "dateFrom",
                        "in": "query",
                        "required": true,
                        "description": "Window start YYYY-MM-DD (inclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "dateTo",
                        "in": "query",
                        "required": true,
                        "description": "Window end YYYY-MM-DD (exclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "accommodationId",
                        "in": "query",
                        "required": false,
                        "description": "Id or array of ids; omitted = every accommodation in the workspace",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "includeIcal",
                        "in": "query",
                        "required": false,
                        "description": "1 (default) to include imported iCal blocks alongside real reservations",
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/v1/getProperties": {
            "get": {
                "operationId": "getProperties",
                "tags": [
                    "Properties"
                ],
                "summary": "List the workspace's accommodations and their listings (the ids needed to submit a reservation)",
                "description": "List the workspace's accommodations and their listings (the ids needed to submit a reservation).",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/Property"
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": []
            }
        },
        "/v1/getReservation": {
            "get": {
                "operationId": "getReservation",
                "tags": [
                    "Reservations"
                ],
                "summary": "Reservation detail plus compliance status: check-in form completion, close blockers, police-reporting status, local-fee status, and the guest check-in link",
                "description": "Reservation detail plus compliance status: check-in form completion, close blockers, police-reporting status, local-fee status, and the guest check-in link. The response carries other fields beyond these too, but only this documented set is covered by the v1 stability promise - see docs/partner-api-v1.md.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/Reservation"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "reservationId",
                        "in": "query",
                        "required": false,
                        "description": "Best Guest's internal reservation id. Exactly one of reservationId/externalId is required.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "externalId",
                        "in": "query",
                        "required": false,
                        "description": "The id you supplied when creating the reservation via upsertReservation. Exactly one of reservationId/externalId is required.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/v1/getReservations": {
            "get": {
                "operationId": "getReservations",
                "tags": [
                    "Reservations"
                ],
                "summary": "List reservations in the workspace, most recently created first",
                "description": "List reservations in the workspace, most recently created first. For a single reservation's full compliance status, use getReservation.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "additionalProperties": true
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "accommodationId",
                        "in": "query",
                        "required": false,
                        "description": "Restrict to one accommodation",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "onlyUpcoming",
                        "in": "query",
                        "required": false,
                        "description": "Only reservations that have not yet started",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "onlyClosed",
                        "in": "query",
                        "required": false,
                        "description": "Only reservations already submitted for police reporting",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "onlyUnclosed",
                        "in": "query",
                        "required": false,
                        "description": "Only reservations not yet submitted for police reporting",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Only reservations checking in on/after this date",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Only reservations checking in on/before this date",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ]
            }
        },
        "/v1/getWebhooks": {
            "get": {
                "operationId": "getWebhooks",
                "tags": [
                    "Webhooks"
                ],
                "summary": "List the workspace's webhook receivers with their status and last delivery",
                "description": "List the workspace's webhook receivers with their status and last delivery. Never returns a secret.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/Webhook"
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": []
            }
        },
        "/v1/ping": {
            "get": {
                "operationId": "ping",
                "tags": [
                    "Account"
                ],
                "summary": "Confirms the credential is valid and returns which workspace/vendor/scope it resolves to",
                "description": "Confirms the credential is valid and returns which workspace/vendor/scope it resolves to.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/Ping"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": []
            }
        },
        "/v1/replayWebhookEvents": {
            "post": {
                "operationId": "replayWebhookEvents",
                "tags": [
                    "Webhooks"
                ],
                "summary": "Send stored events to one receiver again (at most 1000 per call)",
                "description": "Send stored events to one receiver again (at most 1000 per call). A \"write\"-scope key is required.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "requeued": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "webhookId": {
                                        "type": "integer"
                                    },
                                    "fromEventId": {
                                        "type": "string"
                                    },
                                    "since": {
                                        "type": "string"
                                    },
                                    "eventIds": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "required": [
                                    "webhookId"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/v1/resetSandbox": {
            "post": {
                "operationId": "resetSandbox",
                "tags": [
                    "Sandbox"
                ],
                "summary": "Sandbox workspaces only (403 SANDBOX_ONLY elsewhere): remove every reservation of the sandbox so a test run starts clean",
                "description": "Sandbox workspaces only (403 SANDBOX_ONLY elsewhere): remove every reservation of the sandbox so a test run starts clean. The test properties stay. A \"write\"-scope key is required.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "reservationsRemoved": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                }
            }
        },
        "/v1/sandboxSimulate": {
            "post": {
                "operationId": "sandboxSimulate",
                "tags": [
                    "Sandbox"
                ],
                "summary": "Sandbox workspaces only (403 SANDBOX_ONLY elsewhere): play the outside world for one reservation - close it, complete its police submission, or fail it - so status reads and webhooks can be tested end to end",
                "description": "Sandbox workspaces only (403 SANDBOX_ONLY elsewhere): play the outside world for one reservation - close it, complete its police submission, or fail it - so status reads and webhooks can be tested end to end. Czech properties only for submit/fail. A \"write\"-scope key is required.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "reservationId": {
                                                            "type": "integer"
                                                        },
                                                        "action": {
                                                            "type": "string"
                                                        },
                                                        "submissionStatus": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reservationId": {
                                        "type": "integer"
                                    },
                                    "externalId": {
                                        "type": "string"
                                    },
                                    "action": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "action"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/v1/testWebhook": {
            "post": {
                "operationId": "testWebhook",
                "tags": [
                    "Webhooks"
                ],
                "summary": "Queue a webhook.test event to one receiver, to check the route and the signature end to end",
                "description": "Queue a webhook.test event to one receiver, to check the route and the signature end to end. A \"write\"-scope key is required.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "queued": {
                                                            "type": "boolean"
                                                        },
                                                        "eventId": {
                                                            "type": "string"
                                                        },
                                                        "deliveryEnabled": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "webhookId": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "webhookId"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/v1/updateGuestContact": {
            "post": {
                "operationId": "updateGuestContact",
                "tags": [
                    "Reservations"
                ],
                "summary": "Change a guest's e-mail or phone, or give a reservation its first guest contact",
                "description": "Change a guest's e-mail or phone, or give a reservation its first guest contact. 409 CONTACT_LOCKED once the guest completed or signed their form; 409 ALREADY_SENT once the reservation is submitted; at most 5 e-mail changes per reservation per 24 hours. A \"write\"-scope key is required.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/ContactResult"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reservationId": {
                                        "type": "integer"
                                    },
                                    "externalId": {
                                        "type": "string"
                                    },
                                    "externalGuestId": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "phoneNumber": {
                                        "type": "string"
                                    },
                                    "suppressGuestEmail": {
                                        "type": "boolean"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/updateWebhook": {
            "post": {
                "operationId": "updateWebhook",
                "tags": [
                    "Webhooks"
                ],
                "summary": "Change a webhook receiver",
                "description": "Change a webhook receiver. A \"write\"-scope key is required.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/Webhook"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "webhookId": {
                                        "type": "integer"
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "accommodationIds": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "enabled": {
                                        "type": "boolean"
                                    },
                                    "rotateSecret": {
                                        "type": "boolean"
                                    }
                                },
                                "required": [
                                    "webhookId"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/v1/upsertReservation": {
            "post": {
                "operationId": "upsertReservation",
                "tags": [
                    "Reservations"
                ],
                "summary": "Idempotent create-or-update: the first call with a given externalId creates the reservation, every later call with the same externalId updates it",
                "description": "Idempotent create-or-update: the first call with a given externalId creates the reservation, every later call with the same externalId updates it. This is the write side of the partner API - a \"write\"-scope key is required.",
                "security": [
                    {
                        "ApiKey": []
                    }
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "Success. The answer is in `data`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Envelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/UpsertResult"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "externalId": {
                                        "type": "string"
                                    },
                                    "accommodationId": {
                                        "type": "integer"
                                    },
                                    "listingIds": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "fromDate": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "toDate": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "personsCount": {
                                        "type": "integer"
                                    },
                                    "countryOfResidence": {
                                        "type": "string"
                                    },
                                    "recipientLanguage": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "phoneNumber": {
                                        "type": "string"
                                    },
                                    "firstName": {
                                        "type": "string"
                                    },
                                    "lastName": {
                                        "type": "string"
                                    },
                                    "purpose": {
                                        "type": "string"
                                    },
                                    "source": {
                                        "type": "string"
                                    },
                                    "allowOverlap": {
                                        "type": "boolean"
                                    },
                                    "allowSkeleton": {
                                        "type": "boolean"
                                    },
                                    "suppressGuestEmail": {
                                        "type": "boolean"
                                    },
                                    "guests": {
                                        "type": "array",
                                        "maxItems": 30,
                                        "description": "Every guest's details, each with your own externalGuestId (names, birthdate, nationality, document, address, optional signature image). Best Guest pre-fills each guest's check-in form; a form the guest completed, signed or edited is never overwritten. The response lists a result per guest. See the guests[] section of the reference.",
                                        "items": {
                                            "$ref": "#/components/schemas/GuestInput"
                                        }
                                    }
                                },
                                "required": [
                                    "externalId",
                                    "accommodationId",
                                    "listingIds",
                                    "fromDate",
                                    "toDate",
                                    "personsCount",
                                    "countryOfResidence",
                                    "recipientLanguage"
                                ]
                            }
                        }
                    }
                }
            }
        }
    },
    "webhooks": {
        "event": {
            "post": {
                "summary": "An event, delivered to your registered URL",
                "description": "Delivered at least once, in no guaranteed order: deduplicate on `id` and read the current state with `getReservation`. The request carries `X-BestGuest-Event`, `X-BestGuest-Event-Id`, `X-BestGuest-Delivery-Id` and `X-BestGuest-Signature: t=<unix>,v1=<hex>` where `v1 = HMAC-SHA256(secret, t + \".\" + rawBody)` (two `v1=` values while a secret rotation is running). Refuse a `t` more than 5 minutes away. Answer with any 2xx within 10 seconds; a failure is retried after 1 m, 5 m, 30 m, 2 h, 6 h, 12 h and 24 h, then the event stays available through `getEvents` and `replayWebhookEvents`.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Event"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx acknowledges the event."
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "ApiKey": {
                "type": "http",
                "scheme": "bearer",
                "description": "A Best Guest API key (bgk_...). The bare key in the Authorization header is accepted as well."
            }
        },
        "responses": {
            "Unauthorized": {
                "description": "Missing, invalid, revoked or expired key.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "FORBIDDEN: a read key called a write endpoint, or an id belongs to another workspace.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Conflict": {
                "description": "A real conflict: OVERLAP_CONFLICT, EXTERNAL_ID_CONFLICT, ALREADY_SENT, CONTACT_LOCKED, SANDBOX_LIMIT_REACHED, WEBHOOK_LIMIT_REACHED.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Gone": {
                "description": "CURSOR_EXPIRED: the cursor is older than the 30 days events are kept. Start again without a cursor and resynchronise with getReservations.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "ValidationError": {
                "description": "VALIDATION_ERROR, GUEST_CONTACT_REQUIRED, WEBHOOK_URL_NOT_ALLOWED or SANDBOX_RECIPIENT_NOT_ALLOWED: fix the request.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "RateLimited": {
                "description": "RATE_LIMIT_EXCEEDED: the per-key hourly ceiling (600 by default).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        },
        "schemas": {
            "Envelope": {
                "type": "object",
                "properties": {
                    "result": {
                        "const": true
                    },
                    "data": [],
                    "errors": {
                        "type": "array",
                        "maxItems": 0
                    }
                }
            },
            "Error": {
                "type": "object",
                "properties": {
                    "result": {
                        "const": false
                    },
                    "data": {
                        "type": "null"
                    },
                    "errors": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer"
                                },
                                "msg": {
                                    "type": "string"
                                },
                                "note": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "Ping": {
                "type": "object",
                "properties": {
                    "workspaceId": {
                        "type": "integer"
                    },
                    "workspaceName": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "scope": {
                        "enum": [
                            "read",
                            "write"
                        ]
                    },
                    "vendorId": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "sandbox": {
                        "type": "boolean",
                        "description": "true for a sandbox workspace."
                    }
                }
            },
            "Property": {
                "type": "object",
                "properties": {
                    "accommodationId": {
                        "type": "integer"
                    },
                    "accommodationName": {
                        "type": "string"
                    },
                    "residentialClientName": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "district": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "cityDistrict": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "street": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "registerNumber": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "orientationNumber": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "postalNumber": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "countryCode": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "autoClose": {
                        "type": "boolean",
                        "description": "Read-only: the host's \"close reservations automatically\" option. When on, a reservation closes by itself once every form is complete (from the arrival day to 14 days after), and a Czech one then goes to the police on schedule."
                    },
                    "listings": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "listingId": {
                                    "type": "integer"
                                },
                                "listingName": {
                                    "type": "string"
                                },
                                "typeName": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "personsCount": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "primaryBeds": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "extraBeds": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "GuestInput": {
                "type": "object",
                "required": [
                    "externalGuestId"
                ],
                "additionalProperties": false,
                "properties": {
                    "birthCountry": {
                        "type": "string",
                        "pattern": "^[A-Za-z]{3}$",
                        "description": "ISO 3166-1 alpha-3, e.g. DEU."
                    },
                    "birthPlace": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "birthdate": {
                        "type": "string",
                        "format": "date"
                    },
                    "checkIn": {
                        "type": "string",
                        "format": "date"
                    },
                    "checkOut": {
                        "type": "string",
                        "format": "date"
                    },
                    "city": {
                        "type": "string",
                        "maxLength": 50
                    },
                    "district": {
                        "type": "string",
                        "maxLength": 50
                    },
                    "email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 50
                    },
                    "externalGuestId": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Your own id for this guest. Required. Stable across calls: it is how a later call finds the same form."
                    },
                    "firstName": {
                        "type": "string",
                        "maxLength": 50
                    },
                    "gender": {
                        "type": "string",
                        "enum": [
                            "M",
                            "F",
                            "X",
                            "N"
                        ],
                        "description": "Accepted so you need not strip it; Best Guest does not store it (the result carries a FIELDS_NOT_STORED warning)."
                    },
                    "houseNumber": {
                        "type": "string",
                        "maxLength": 20
                    },
                    "identIssueDate": {
                        "type": "string",
                        "format": "date",
                        "description": "The identity document's issue date. Accepted, not stored (FIELDS_NOT_STORED warning)."
                    },
                    "identNumber": {
                        "type": "string",
                        "maxLength": 50
                    },
                    "identType": {
                        "type": "string",
                        "enum": [
                            "id",
                            "passport"
                        ]
                    },
                    "isLead": {
                        "type": "boolean",
                        "description": "The booker. At most one. The lead's name and contact stand in for the top-level ones."
                    },
                    "lastName": {
                        "type": "string",
                        "maxLength": 50
                    },
                    "licensePlate": {
                        "type": "string",
                        "maxLength": 20
                    },
                    "nationality": {
                        "type": "string",
                        "pattern": "^[A-Za-z]{3}$",
                        "description": "ISO 3166-1 alpha-3, e.g. DEU."
                    },
                    "note": {
                        "type": "string",
                        "maxLength": 250
                    },
                    "phoneNumber": {
                        "type": "string",
                        "maxLength": 30
                    },
                    "postalCode": {
                        "type": "string",
                        "maxLength": 15
                    },
                    "purpose": {
                        "type": "string",
                        "maxLength": 5
                    },
                    "remove": {
                        "type": "boolean",
                        "description": "true removes this guest's check-in form, and then only externalGuestId may accompany it. Allowed only for a guest you added through the API whose form nobody has filled, signed, edited or been billed for; otherwise the result is \"skipped\" with the reason. Removing a guest that is already gone is \"unchanged\"."
                    },
                    "residenceDocumentIssuingCountry": {
                        "type": "string",
                        "pattern": "^[A-Za-z]{3}$",
                        "description": "ISO 3166-1 alpha-3, e.g. DEU."
                    },
                    "residenceDocumentNumber": {
                        "type": "string",
                        "maxLength": 20
                    },
                    "residenceDocumentValidFrom": {
                        "type": "string",
                        "format": "date"
                    },
                    "residenceDocumentValidTo": {
                        "type": "string",
                        "format": "date"
                    },
                    "signature": {
                        "type": "string",
                        "contentEncoding": "base64",
                        "description": "A PNG or JPEG image of the guest's signature, base64 (a data URI is accepted), at most 1 MB. When you supply it the form can be completed without the guest opening Best Guest."
                    },
                    "state": {
                        "type": "string",
                        "maxLength": 50
                    },
                    "stayAuthorizationType": {
                        "type": "string",
                        "enum": [
                            "VISA",
                            "RESIDENCE_DOCUMENT",
                            "BIOMETRIC_PASSPORT"
                        ]
                    },
                    "street": {
                        "type": "string",
                        "maxLength": 50
                    },
                    "visaIssuePlace": {
                        "type": "string",
                        "maxLength": 30
                    },
                    "visaNumber": {
                        "type": "string",
                        "maxLength": 20
                    },
                    "visaType": {
                        "type": "string",
                        "enum": [
                            "AV",
                            "CV",
                            "LTV",
                            "DV"
                        ]
                    },
                    "visaValidFrom": {
                        "type": "string",
                        "format": "date"
                    },
                    "visaValidTo": {
                        "type": "string",
                        "format": "date"
                    }
                }
            },
            "UpsertResult": {
                "type": "object",
                "properties": {
                    "reservationId": {
                        "type": "integer"
                    },
                    "externalId": {
                        "type": "string"
                    },
                    "created": {
                        "type": "boolean"
                    },
                    "status": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "checkinUrl": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "The lead guest's check-in link. Send it to the guest only."
                    },
                    "guests": {
                        "type": "array",
                        "description": "One result per guest, when the call carried guests[].",
                        "items": {
                            "$ref": "#/components/schemas/GuestResult"
                        }
                    }
                }
            },
            "GuestResult": {
                "type": "object",
                "properties": {
                    "externalGuestId": {
                        "type": "string"
                    },
                    "dataId": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "result": {
                        "enum": [
                            "created",
                            "updated",
                            "unchanged",
                            "removed",
                            "skipped"
                        ]
                    },
                    "reason": {
                        "type": "string",
                        "description": "Why a guest was skipped (or, with result unchanged, NOT_FOUND for a remove of a guest that is not there): FORM_COMPLETED, SIGNED, EDITED_SINCE, BILLED, NOT_PARTNER_CREATED, LEAD_CANNOT_BE_REMOVED, RESERVATION_CLOSED, FORM_REMOVED, NAME_REQUIRED, TOO_MANY_GUESTS, NO_LEAD_CONTACT, LEAD_ALREADY_MAPPED, GUEST_ACCOUNT_FAILED, INVALID_FILE_TYPE, ERROR."
                    },
                    "missingFields": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "What the form still needs to count as complete; the signature is reported as \"signature\"."
                    },
                    "signatureRequired": {
                        "type": "boolean"
                    },
                    "checkinUrl": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "warnings": {
                        "type": "array",
                        "items": {
                            "enum": [
                                "CONTACT_NOT_CHANGED",
                                "FIELDS_NOT_STORED"
                            ]
                        }
                    }
                }
            },
            "ContactResult": {
                "type": "object",
                "properties": {
                    "reservationId": {
                        "type": "integer"
                    },
                    "externalId": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "externalGuestId": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "checkinUrl": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "checkinUrlChanged": {
                        "type": "boolean"
                    },
                    "emailSent": {
                        "type": "boolean"
                    }
                }
            },
            "Reservation": {
                "type": "object",
                "additionalProperties": true,
                "description": "Only the fields listed here are covered by the v1 promise; other fields in a real response exist for Best Guest's own screens and may change.",
                "properties": {
                    "reservationId": {
                        "type": "integer"
                    },
                    "externalId": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "fromDate": {
                        "type": "string"
                    },
                    "toDate": {
                        "type": "string"
                    },
                    "accommodationId": {
                        "type": "integer"
                    },
                    "listings": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "listingId": {
                                    "type": "integer"
                                },
                                "listingName": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "personsCount": {
                        "type": "integer"
                    },
                    "countryOfResidence": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "reservationSource": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "cleanersNote": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "forms": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "dataId": {
                                    "type": "integer"
                                },
                                "firstName": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "lastName": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "birthdate": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "nationality": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "identNumber": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "identType": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "status": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "filledForms": {
                        "type": "integer"
                    },
                    "missingForms": {
                        "type": "integer"
                    },
                    "readyToSend": {
                        "type": "boolean"
                    },
                    "submissionStatus": {
                        "enum": [
                            null,
                            "PENDING",
                            "SENT",
                            "FAILED"
                        ],
                        "description": "Police reporting. Outside Czechia a closed reservation is stored as SENT although nothing is reported to a police portal."
                    },
                    "localFeePaidAmount": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "localFeePaidCurrency": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "localFeeQrAmount": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "localFeeQrInfo": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "checkinUrl": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "compliance": {
                        "type": "object",
                        "properties": {
                            "closeBlockers": {
                                "type": "array",
                                "items": {
                                    "type": "object"
                                }
                            },
                            "readyToClose": {
                                "type": "boolean"
                            }
                        }
                    }
                }
            },
            "Webhook": {
                "type": "object",
                "properties": {
                    "webhookId": {
                        "type": "integer"
                    },
                    "url": {
                        "type": "string"
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "reservation.created",
                                "reservation.updated",
                                "reservation.cancelled",
                                "guest.form_completed",
                                "reservation.closed",
                                "reservation.reopened",
                                "reservation.submitted",
                                "reservation.submission_failed",
                                "localfee.requested",
                                "localfee.paid",
                                "localfee.payment_reverted"
                            ]
                        }
                    },
                    "accommodationIds": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "status": {
                        "enum": [
                            "active",
                            "disabled"
                        ]
                    },
                    "disabledReason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "lastDeliveryStatus": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "lastDeliveredAt": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "lastHttpStatus": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "createdAt": {
                        "type": "string"
                    },
                    "secret": {
                        "type": "string",
                        "description": "Only in the answer to a secret rotation, once."
                    }
                }
            },
            "WebhookCreated": {
                "type": "object",
                "properties": {
                    "webhookId": {
                        "type": "integer"
                    },
                    "secret": {
                        "type": "string",
                        "description": "The signing secret. Shown once."
                    },
                    "url": {
                        "type": "string"
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "accommodationIds": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "status": {
                        "const": "active"
                    }
                }
            },
            "Event": {
                "type": "object",
                "required": [
                    "id",
                    "type",
                    "apiVersion",
                    "occurredAt",
                    "workspaceId",
                    "data"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "examples": [
                            "evt_1042"
                        ]
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "reservation.created",
                            "reservation.updated",
                            "reservation.cancelled",
                            "guest.form_completed",
                            "reservation.closed",
                            "reservation.reopened",
                            "reservation.submitted",
                            "reservation.submission_failed",
                            "localfee.requested",
                            "localfee.paid",
                            "localfee.payment_reverted",
                            "webhook.test"
                        ]
                    },
                    "apiVersion": {
                        "const": "v1"
                    },
                    "occurredAt": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "workspaceId": {
                        "type": "integer"
                    },
                    "data": {
                        "type": "object",
                        "description": "Ids and status words only, never a name, a document number, a contact or a link.",
                        "properties": {
                            "reservationId": {
                                "type": "integer"
                            },
                            "externalId": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "accommodationId": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "status": {
                                "type": "string"
                            },
                            "filledForms": {
                                "type": "integer"
                            },
                            "personsCount": {
                                "type": "integer"
                            },
                            "submissionStatus": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "dataId": {
                                "type": "integer",
                                "description": "guest.form_completed only."
                            },
                            "changed": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "description": "reservation.updated only: the names of the fields that changed."
                            }
                        }
                    }
                }
            },
            "EventPage": {
                "type": "object",
                "properties": {
                    "events": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Event"
                        }
                    },
                    "nextCursor": {
                        "type": "string",
                        "description": "Pass as `after` next time."
                    },
                    "hasMore": {
                        "type": "boolean"
                    },
                    "feedEnabled": {
                        "type": "boolean",
                        "description": "false while Best Guest has event detection switched off: the feed is then empty."
                    }
                }
            }
        }
    }
}
