{
    "openapi": "3.0.3",
    "info": {
        "title": "bookinglinks API",
        "version": "1.0.0",
        "description": "Book meetings on a public booking link without an account, and let a host's own bots manage links and bookings with an API token. Plain-language guide: https://alphacentauritech.com/bookinglinks/llms.txt. Errors are {\"error\": code, \"message\": text}; 429 responses carry Retry-After. Booking through this API means you agree to the Terms of Service (https://alphacentauritech.com/bookinglinks/terms) and acknowledge the Privacy Policy (https://alphacentauritech.com/bookinglinks/privacy).",
        "termsOfService": "https://alphacentauritech.com/bookinglinks/terms"
    },
    "servers": [
        {
            "url": "https://alphacentauritech.com/bookinglinks"
        }
    ],
    "tags": [
        {
            "name": "public",
            "description": "No account needed"
        },
        {
            "name": "host",
            "description": "Host API token needed"
        }
    ],
    "paths": {
        "/api/public/links/{slug}": {
            "get": {
                "security": [],
                "tags": [
                    "public"
                ],
                "operationId": "getPublicLink",
                "summary": "Link info",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Booking link slug, as in /b/{slug}.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Link",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "link": {
                                            "$ref": "#/components/schemas/PublicLink"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/public/links/{slug}/slots": {
            "get": {
                "security": [],
                "tags": [
                    "public"
                ],
                "operationId": "listSlots",
                "summary": "Open times",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Booking link slug, as in /b/{slug}.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "First date (YYYY-MM-DD in tz). Default today.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Last date, inclusive (max 62 days). Default the booking horizon.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "tz",
                        "in": "query",
                        "required": false,
                        "description": "IANA time zone for from/to and start_local. Default UTC.",
                        "schema": {
                            "type": "string",
                            "example": "America/Los_Angeles"
                        }
                    },
                    {
                        "name": "duration",
                        "in": "query",
                        "required": false,
                        "description": "Minutes; one of the link durations. Default the first.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Open times",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Slots"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/public/links/{slug}/book": {
            "post": {
                "security": [],
                "tags": [
                    "public"
                ],
                "operationId": "book",
                "summary": "Book a time",
                "description": "Send Content-Type: application/json. start must be a time listed by listSlots. Limit: 10 attempts per 10 minutes per IP. The host must allow bookings through the API for the link (else 403 api_booking_disabled), and each link takes at most api_daily_cap API bookings per UTC day (else 429 api_daily_cap_reached). agree_to_terms must be true (422 terms_not_accepted otherwise).",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Booking link slug, as in /b/{slug}.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/BookingInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Booked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/BookingResult"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "415": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/public/bookings/{token}": {
            "get": {
                "security": [],
                "tags": [
                    "public"
                ],
                "operationId": "getBooking",
                "summary": "Look up a booking",
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "description": "Manage token from the booking response (secret).",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Booking",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/public/bookings/{token}/slots": {
            "get": {
                "security": [],
                "tags": [
                    "public"
                ],
                "operationId": "listRescheduleSlots",
                "summary": "Times a booking can move to",
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "description": "Manage token from the booking response (secret).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "First date (YYYY-MM-DD in tz). Default today.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Last date, inclusive (max 62 days). Default the booking horizon.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "tz",
                        "in": "query",
                        "required": false,
                        "description": "IANA time zone for from/to and start_local. Default UTC.",
                        "schema": {
                            "type": "string",
                            "example": "America/Los_Angeles"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Open times",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Slots"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/public/bookings/{token}/reschedule": {
            "post": {
                "security": [],
                "tags": [
                    "public"
                ],
                "operationId": "reschedule",
                "summary": "Move a booking",
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "description": "Manage token from the booking response (secret).",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "start"
                                ],
                                "properties": {
                                    "start": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "tz": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Moved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/BookingResult"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "415": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/public/bookings/{token}/cancel": {
            "post": {
                "security": [],
                "tags": [
                    "public"
                ],
                "operationId": "cancelOwnBooking",
                "summary": "Cancel a booking",
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "description": "Manage token from the booking response (secret).",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Cancelled",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "cancelled": {
                                            "type": "boolean"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "415": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/me": {
            "get": {
                "security": [
                    {
                        "bearerAuth": [
                            "read"
                        ]
                    },
                    {
                        "apiKeyHeader": [
                            "read"
                        ]
                    }
                ],
                "tags": [
                    "host"
                ],
                "operationId": "me",
                "summary": "Token owner and scopes",
                "responses": {
                    "200": {
                        "description": "Me",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/calendars": {
            "get": {
                "security": [
                    {
                        "bearerAuth": [
                            "read"
                        ]
                    },
                    {
                        "apiKeyHeader": [
                            "read"
                        ]
                    }
                ],
                "tags": [
                    "host"
                ],
                "operationId": "listCalendars",
                "summary": "Connected calendars",
                "responses": {
                    "200": {
                        "description": "Calendars",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/links": {
            "get": {
                "security": [
                    {
                        "bearerAuth": [
                            "read"
                        ]
                    },
                    {
                        "apiKeyHeader": [
                            "read"
                        ]
                    }
                ],
                "tags": [
                    "host"
                ],
                "operationId": "listLinks",
                "summary": "All links",
                "responses": {
                    "200": {
                        "description": "Links",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "links": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Link"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "bearerAuth": [
                            "write"
                        ]
                    },
                    {
                        "apiKeyHeader": [
                            "write"
                        ]
                    }
                ],
                "tags": [
                    "host"
                ],
                "operationId": "createLink",
                "summary": "Create a link",
                "description": "title, slug, durations and locations are required.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/LinkInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The link",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "link": {
                                            "$ref": "#/components/schemas/Link"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "415": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/links/{id}": {
            "get": {
                "security": [
                    {
                        "bearerAuth": [
                            "read"
                        ]
                    },
                    {
                        "apiKeyHeader": [
                            "read"
                        ]
                    }
                ],
                "tags": [
                    "host"
                ],
                "operationId": "getLink",
                "summary": "One link",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Numeric id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The link",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "link": {
                                            "$ref": "#/components/schemas/Link"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "security": [
                    {
                        "bearerAuth": [
                            "write"
                        ]
                    },
                    {
                        "apiKeyHeader": [
                            "write"
                        ]
                    }
                ],
                "tags": [
                    "host"
                ],
                "operationId": "updateLink",
                "summary": "Change the fields sent (POST to this URL does the same)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Numeric id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/LinkInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The link",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "link": {
                                            "$ref": "#/components/schemas/Link"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "415": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "bearerAuth": [
                            "write"
                        ]
                    },
                    {
                        "apiKeyHeader": [
                            "write"
                        ]
                    }
                ],
                "tags": [
                    "host"
                ],
                "operationId": "deleteLink",
                "summary": "Delete a link with no bookings (or POST .../delete)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Numeric id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/links/{id}/deactivate": {
            "post": {
                "security": [
                    {
                        "bearerAuth": [
                            "write"
                        ]
                    },
                    {
                        "apiKeyHeader": [
                            "write"
                        ]
                    }
                ],
                "tags": [
                    "host"
                ],
                "operationId": "deactivateLink",
                "summary": "Stop taking bookings",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Numeric id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The link",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "link": {
                                            "$ref": "#/components/schemas/Link"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/links/{id}/activate": {
            "post": {
                "security": [
                    {
                        "bearerAuth": [
                            "write"
                        ]
                    },
                    {
                        "apiKeyHeader": [
                            "write"
                        ]
                    }
                ],
                "tags": [
                    "host"
                ],
                "operationId": "activateLink",
                "summary": "Take bookings again",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Numeric id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The link",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "link": {
                                            "$ref": "#/components/schemas/Link"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/bookings": {
            "get": {
                "security": [
                    {
                        "bearerAuth": [
                            "read"
                        ]
                    },
                    {
                        "apiKeyHeader": [
                            "read"
                        ]
                    }
                ],
                "tags": [
                    "host"
                ],
                "operationId": "listBookings",
                "summary": "Bookings in a date range (max 500)",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Start (date or date-time). Default now.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "End (date = end of that day). Default +90 days.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "all, confirmed (default), pending, cancelled, cancelling, rescheduled",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bookings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/bookings/{id}/cancel": {
            "post": {
                "security": [
                    {
                        "bearerAuth": [
                            "write"
                        ]
                    },
                    {
                        "apiKeyHeader": [
                            "write"
                        ]
                    }
                ],
                "tags": [
                    "host"
                ],
                "operationId": "cancelBooking",
                "summary": "Cancel a booking",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Numeric id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cancelled",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "blk_ token from Admin > API tokens"
            },
            "apiKeyHeader": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key",
                "description": "Same token, for sites behind HTTP Basic Auth."
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "string",
                        "enum": [
                            "not_found",
                            "method_not_allowed",
                            "invalid_tz",
                            "invalid_range",
                            "invalid_duration",
                            "terms_not_accepted",
                            "api_booking_disabled",
                            "api_daily_cap_reached",
                            "invalid_input",
                            "invalid_start",
                            "invalid_location",
                            "invalid_phone",
                            "invalid_destination",
                            "slot_unavailable",
                            "slot_taken",
                            "no_destination",
                            "calendar_unavailable",
                            "rate_limited",
                            "unsupported_media_type",
                            "invalid_json",
                            "unauthorized",
                            "insufficient_scope",
                            "validation_failed",
                            "slug_taken",
                            "has_bookings",
                            "invalid_csrf",
                            "server_error"
                        ]
                    },
                    "message": {
                        "type": "string"
                    },
                    "retry_after": {
                        "type": "integer",
                        "description": "Seconds (429 only)"
                    },
                    "fields": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        },
                        "description": "Per-field problems (validation_failed)"
                    }
                }
            },
            "Location": {
                "type": "object",
                "properties": {
                    "kind": {
                        "type": "string",
                        "enum": [
                            "meet",
                            "phone",
                            "in_person",
                            "phone_host",
                            "custom"
                        ]
                    },
                    "address": {
                        "type": "string",
                        "nullable": true
                    },
                    "phone": {
                        "type": "string",
                        "nullable": true,
                        "description": "phone_host only: the number the booker calls"
                    },
                    "url": {
                        "type": "string",
                        "nullable": true,
                        "description": "custom only, host API: the https meeting link. Public link listings omit it."
                    }
                }
            },
            "PublicLink": {
                "type": "object",
                "properties": {
                    "slug": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "durations": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "duration_mode": {
                        "type": "string"
                    },
                    "locations": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Location"
                        }
                    },
                    "location_mode": {
                        "type": "string"
                    },
                    "host_timezone": {
                        "type": "string"
                    },
                    "accepting_bookings": {
                        "type": "boolean"
                    },
                    "api_booking": {
                        "type": "boolean",
                        "description": "false: the host has not allowed bookings through the API (book answers 403 api_booking_disabled); use booking_page_url"
                    },
                    "api_daily_cap": {
                        "type": "integer",
                        "description": "API bookings this link takes per UTC day (then 429 api_daily_cap_reached)"
                    },
                    "booking_page_url": {
                        "type": "string"
                    },
                    "html_booking_url": {
                        "type": "string"
                    },
                    "slots_url": {
                        "type": "string"
                    },
                    "book_url": {
                        "type": "string"
                    }
                }
            },
            "Slots": {
                "type": "object",
                "properties": {
                    "tz": {
                        "type": "string"
                    },
                    "duration": {
                        "type": "integer"
                    },
                    "slots": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "start_utc": {
                                    "type": "string",
                                    "format": "date-time"
                                },
                                "start_local": {
                                    "type": "string",
                                    "format": "date-time"
                                },
                                "end_utc": {
                                    "type": "string",
                                    "format": "date-time"
                                },
                                "tz_abbr": {
                                    "type": "string"
                                },
                                "repeated": {
                                    "type": "boolean"
                                }
                            }
                        }
                    }
                }
            },
            "BookingInput": {
                "type": "object",
                "required": [
                    "start",
                    "name",
                    "email",
                    "agree_to_terms"
                ],
                "properties": {
                    "agree_to_terms": {
                        "type": "boolean",
                        "enum": [
                            true
                        ],
                        "description": "true: the booker agrees to the Terms of Service and acknowledges the Privacy Policy. Required once the Terms are published."
                    },
                    "start": {
                        "type": "string",
                        "format": "date-time",
                        "description": "A slot start_local or start_utc"
                    },
                    "duration": {
                        "type": "integer"
                    },
                    "tz": {
                        "type": "string",
                        "description": "The booker's IANA zone"
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 255
                    },
                    "location": {
                        "type": "string",
                        "enum": [
                            "meet",
                            "phone",
                            "in_person",
                            "phone_host",
                            "custom"
                        ],
                        "description": "Required when the link offers several. custom uses the host meeting link and does not create a Google Meet."
                    },
                    "phone": {
                        "type": "string",
                        "description": "Required for location phone"
                    },
                    "note": {
                        "type": "string",
                        "maxLength": 2000,
                        "description": "No medical or sensitive information"
                    }
                }
            },
            "BookingResult": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "start": {
                        "type": "string"
                    },
                    "end": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "meet_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "meeting_url": {
                        "type": "string",
                        "nullable": true,
                        "description": "Host-supplied https meeting link when location is custom (query string kept). Null otherwise. Not a Google Meet URL."
                    },
                    "manage_url": {
                        "type": "string"
                    },
                    "api": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        }
                    }
                }
            },
            "LinkInput": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "title": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "slug": {
                        "type": "string",
                        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
                    },
                    "description": {
                        "type": "string"
                    },
                    "active": {
                        "type": "boolean"
                    },
                    "durations": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "enum": [
                                15,
                                30,
                                60
                            ]
                        }
                    },
                    "locations": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "enum": [
                                        "meet",
                                        "phone",
                                        "in_person",
                                        "phone_host",
                                        "custom"
                                    ]
                                },
                                {
                                    "$ref": "#/components/schemas/Location"
                                }
                            ]
                        }
                    },
                    "weekly_hours": {
                        "type": "object",
                        "nullable": true,
                        "description": "mon..sun: \"09:00-12:00, 13:00-17:00\" or [[\"09:00\",\"17:00\"]]; null = host hours",
                        "additionalProperties": {
                            "oneOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "array",
                                    "items": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "date_overrides": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "2026-11-26 off",
                            "2026-11-28 10:00-14:00"
                        ]
                    },
                    "min_notice_min": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "horizon_days": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "buffer_before_min": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "buffer_after_min": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "increment_min": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "max_per_day": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "dest_calendar_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "calendar_overrides": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "calendar_id": {
                                    "type": "integer"
                                },
                                "busy": {
                                    "type": "string",
                                    "nullable": true,
                                    "enum": [
                                        "include",
                                        "exclude",
                                        null
                                    ]
                                },
                                "dest": {
                                    "type": "string",
                                    "nullable": true,
                                    "enum": [
                                        "schedule_on",
                                        "avoid",
                                        null
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "Link": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "url": {
                        "type": "string"
                    },
                    "duration_mode": {
                        "type": "string"
                    },
                    "location_mode": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "slug": {
                        "type": "string",
                        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
                    },
                    "description": {
                        "type": "string"
                    },
                    "active": {
                        "type": "boolean"
                    },
                    "durations": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "enum": [
                                15,
                                30,
                                60
                            ]
                        }
                    },
                    "locations": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "enum": [
                                        "meet",
                                        "phone",
                                        "in_person",
                                        "phone_host",
                                        "custom"
                                    ]
                                },
                                {
                                    "$ref": "#/components/schemas/Location"
                                }
                            ]
                        }
                    },
                    "weekly_hours": {
                        "type": "object",
                        "nullable": true,
                        "description": "mon..sun: \"09:00-12:00, 13:00-17:00\" or [[\"09:00\",\"17:00\"]]; null = host hours",
                        "additionalProperties": {
                            "oneOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "array",
                                    "items": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "date_overrides": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "2026-11-26 off",
                            "2026-11-28 10:00-14:00"
                        ]
                    },
                    "min_notice_min": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "horizon_days": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "buffer_before_min": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "buffer_after_min": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "increment_min": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "max_per_day": {
                        "type": "integer",
                        "nullable": true,
                        "description": "null = the host default"
                    },
                    "dest_calendar_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "calendar_overrides": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "calendar_id": {
                                    "type": "integer"
                                },
                                "busy": {
                                    "type": "string",
                                    "nullable": true,
                                    "enum": [
                                        "include",
                                        "exclude",
                                        null
                                    ]
                                },
                                "dest": {
                                    "type": "string",
                                    "nullable": true,
                                    "enum": [
                                        "schedule_on",
                                        "avoid",
                                        null
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
