{
  "openapi": "3.1.0",
  "info": {
    "title": "Slotix Public Booking API",
    "description": "API prefix and host are configured per deployment. Public booking; private management uses X-Booking-Token.",
    "version": "1.0.0"
  },
  "paths": {
    "/public/activities/{token}": {
      "get": {
        "tags": [
          "Public activity booking"
        ],
        "summary": "Public Catalog",
        "operationId": "public_catalog_public_activities__token__get",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCatalog"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/public/activities/{token}/slots": {
      "get": {
        "tags": [
          "Public activity booking"
        ],
        "summary": "Public Slots",
        "operationId": "public_slots_public_activities__token__slots_get",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          },
          {
            "name": "service_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Service Id"
            }
          },
          {
            "name": "target_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Target Date"
            }
          },
          {
            "name": "professional_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Professional Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicSlot"
                  },
                  "title": "Response Public Slots Public Activities  Token  Slots Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/public/activities/{token}/events": {
      "post": {
        "tags": [
          "Public activity booking"
        ],
        "summary": "Public Event",
        "operationId": "public_event_public_activities__token__events_post",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MetricInput"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/public/activities/{token}/courses": {
      "get": {
        "tags": [
          "Public activity booking"
        ],
        "summary": "Public Courses",
        "operationId": "public_courses_public_activities__token__courses_get",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          },
          {
            "name": "service_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Service Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicCourse"
                  },
                  "title": "Response Public Courses Public Activities  Token  Courses Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/public/activities/{token}/book": {
      "post": {
        "tags": [
          "Public activity booking"
        ],
        "summary": "Public Book",
        "operationId": "public_book_public_activities__token__book_post",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReceipt"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/public/activities/{token}/courses/{session_id}/enroll": {
      "post": {
        "tags": [
          "Public activity booking"
        ],
        "summary": "Public Enroll",
        "operationId": "public_enroll_public_activities__token__courses__session_id__enroll_post",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnrollmentInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReceipt"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/public/activities/manage/booking": {
      "get": {
        "tags": [
          "Public activity booking"
        ],
        "summary": "Manage Booking",
        "operationId": "manage_booking_public_activities_manage_booking_get",
        "parameters": [
          {
            "name": "X-Booking-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Booking-Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReceipt"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/public/activities/manage/cancel": {
      "post": {
        "tags": [
          "Public activity booking"
        ],
        "summary": "Manage Cancel",
        "operationId": "manage_cancel_public_activities_manage_cancel_post",
        "parameters": [
          {
            "name": "X-Booking-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Booking-Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReceipt"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/public/activities/manage/accept": {
      "post": {
        "tags": [
          "Public activity booking"
        ],
        "summary": "Manage Accept",
        "operationId": "manage_accept_public_activities_manage_accept_post",
        "parameters": [
          {
            "name": "X-Booking-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Booking-Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReceipt"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/public/activities/manage/consent": {
      "put": {
        "tags": [
          "Public activity booking"
        ],
        "summary": "Manage Consent",
        "operationId": "manage_consent_public_activities_manage_consent_put",
        "parameters": [
          {
            "name": "X-Booking-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Booking-Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReceipt"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BookingInput": {
        "properties": {
          "client_name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 2,
            "title": "Client Name"
          },
          "contact": {
            "type": "string",
            "maxLength": 200,
            "minLength": 5,
            "title": "Contact"
          },
          "privacy_accepted": {
            "type": "boolean",
            "const": true,
            "title": "Privacy Accepted"
          },
          "privacy_version": {
            "type": "string",
            "maxLength": 40,
            "minLength": 1,
            "title": "Privacy Version"
          },
          "marketing_consent": {
            "type": "boolean",
            "title": "Marketing Consent",
            "default": false
          },
          "language": {
            "type": "string",
            "enum": [
              "it",
              "en",
              "de",
              "fr",
              "es"
            ],
            "title": "Language",
            "default": "it"
          },
          "source": {
            "type": "string",
            "enum": [
              "direct",
              "instagram",
              "facebook",
              "tiktok",
              "google",
              "offline",
              "telegram",
              "whatsapp"
            ],
            "title": "Source",
            "default": "direct"
          },
          "join_waitlist": {
            "type": "boolean",
            "title": "Join Waitlist",
            "default": false
          },
          "client_id": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Id"
          },
          "pass_id": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Pass Id"
          },
          "service_id": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Service Id"
          },
          "professional_id": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Professional Id"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "client_name",
          "contact",
          "privacy_accepted",
          "privacy_version",
          "service_id",
          "professional_id",
          "start"
        ],
        "title": "BookingInput"
      },
      "ConsentInput": {
        "properties": {
          "marketing_consent": {
            "type": "boolean",
            "title": "Marketing Consent"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "marketing_consent"
        ],
        "title": "ConsentInput"
      },
      "EnrollmentInput": {
        "properties": {
          "client_name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 2,
            "title": "Client Name"
          },
          "contact": {
            "type": "string",
            "maxLength": 200,
            "minLength": 5,
            "title": "Contact"
          },
          "privacy_accepted": {
            "type": "boolean",
            "const": true,
            "title": "Privacy Accepted"
          },
          "privacy_version": {
            "type": "string",
            "maxLength": 40,
            "minLength": 1,
            "title": "Privacy Version"
          },
          "marketing_consent": {
            "type": "boolean",
            "title": "Marketing Consent",
            "default": false
          },
          "language": {
            "type": "string",
            "enum": [
              "it",
              "en",
              "de",
              "fr",
              "es"
            ],
            "title": "Language",
            "default": "it"
          },
          "source": {
            "type": "string",
            "enum": [
              "direct",
              "instagram",
              "facebook",
              "tiktok",
              "google",
              "offline",
              "telegram",
              "whatsapp"
            ],
            "title": "Source",
            "default": "direct"
          },
          "join_waitlist": {
            "type": "boolean",
            "title": "Join Waitlist",
            "default": false
          },
          "client_id": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Id"
          },
          "pass_id": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Pass Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "client_name",
          "contact",
          "privacy_accepted",
          "privacy_version"
        ],
        "title": "EnrollmentInput"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "MetricInput": {
        "properties": {
          "event": {
            "type": "string",
            "enum": [
              "landing_view",
              "click_booking"
            ],
            "title": "Event"
          },
          "source": {
            "type": "string",
            "enum": [
              "direct",
              "instagram",
              "facebook",
              "tiktok",
              "google",
              "offline",
              "telegram",
              "whatsapp"
            ],
            "title": "Source",
            "default": "direct"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "event"
        ],
        "title": "MetricInput"
      },
      "PublicCatalog": {
        "properties": {
          "workspace": {
            "$ref": "#/components/schemas/PublicWorkspace"
          },
          "services": {
            "items": {
              "$ref": "#/components/schemas/PublicService"
            },
            "type": "array",
            "title": "Services"
          },
          "professionals": {
            "items": {
              "$ref": "#/components/schemas/PublicProfessional"
            },
            "type": "array",
            "title": "Professionals"
          }
        },
        "type": "object",
        "required": [
          "workspace",
          "services",
          "professionals"
        ],
        "title": "PublicCatalog"
      },
      "PublicCourse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "service_id": {
            "type": "integer",
            "title": "Service Id"
          },
          "professional_id": {
            "type": "integer",
            "title": "Professional Id"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start"
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "title": "End"
          },
          "capacity": {
            "type": "integer",
            "title": "Capacity"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "price": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          },
          "available": {
            "type": "integer",
            "title": "Available"
          }
        },
        "type": "object",
        "required": [
          "id",
          "service_id",
          "professional_id",
          "start",
          "end",
          "capacity",
          "title",
          "price",
          "available"
        ],
        "title": "PublicCourse"
      },
      "PublicProfessional": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "specialty": {
            "type": "string",
            "title": "Specialty"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "specialty"
        ],
        "title": "PublicProfessional"
      },
      "PublicReceipt": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "offer_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Offer Until"
          },
          "marketing_consent": {
            "type": "boolean",
            "title": "Marketing Consent"
          },
          "session": {
            "$ref": "#/components/schemas/ReceiptSession"
          },
          "workspace": {
            "$ref": "#/components/schemas/PublicWorkspace"
          },
          "manage_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Manage Token"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "offer_until",
          "marketing_consent",
          "session",
          "workspace"
        ],
        "title": "PublicReceipt"
      },
      "PublicService": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "catalog_item_id": {
            "type": "integer",
            "title": "Catalog Item Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "category": {
            "type": "string",
            "title": "Category"
          },
          "kind": {
            "type": "string",
            "enum": [
              "appointment",
              "course"
            ],
            "title": "Kind"
          },
          "visit_type": {
            "type": "string",
            "title": "Visit Type"
          },
          "duration_minutes": {
            "type": "integer",
            "title": "Duration Minutes"
          },
          "price": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          },
          "capacity": {
            "type": "integer",
            "title": "Capacity"
          },
          "waitlist_enabled": {
            "type": "boolean",
            "title": "Waitlist Enabled"
          },
          "prerequisites": {
            "type": "string",
            "title": "Prerequisites"
          },
          "professional_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Professional Ids"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          }
        },
        "type": "object",
        "required": [
          "id",
          "catalog_item_id",
          "name",
          "description",
          "category",
          "kind",
          "visit_type",
          "duration_minutes",
          "price",
          "capacity",
          "waitlist_enabled",
          "prerequisites",
          "professional_ids",
          "active"
        ],
        "title": "PublicService"
      },
      "PublicSlot": {
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start"
          },
          "professional_id": {
            "type": "integer",
            "title": "Professional Id"
          },
          "professional_name": {
            "type": "string",
            "title": "Professional Name"
          }
        },
        "type": "object",
        "required": [
          "start",
          "professional_id",
          "professional_name"
        ],
        "title": "PublicSlot"
      },
      "PublicWorkspace": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "sector": {
            "type": "string",
            "title": "Sector"
          },
          "timezone": {
            "type": "string",
            "title": "Timezone"
          },
          "phone": {
            "type": "string",
            "title": "Phone"
          },
          "address": {
            "type": "string",
            "title": "Address"
          },
          "privacy_notice": {
            "type": "string",
            "title": "Privacy Notice"
          },
          "privacy_version": {
            "type": "string",
            "title": "Privacy Version"
          },
          "cancellation_hours": {
            "type": "integer",
            "title": "Cancellation Hours"
          },
          "booking_horizon_days": {
            "type": "integer",
            "title": "Booking Horizon Days"
          },
          "patient_template_html": {
            "type": "string",
            "title": "Patient Template Html"
          },
          "public_slug": {
            "type": "string",
            "title": "Public Slug"
          }
        },
        "type": "object",
        "required": [
          "name",
          "sector",
          "timezone",
          "phone",
          "address",
          "privacy_notice",
          "privacy_version",
          "cancellation_hours",
          "booking_horizon_days",
          "patient_template_html",
          "public_slug"
        ],
        "title": "PublicWorkspace"
      },
      "ReceiptSession": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title"
          },
          "kind": {
            "type": "string",
            "enum": [
              "appointment",
              "course"
            ],
            "title": "Kind"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start"
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "title": "End"
          },
          "price": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          }
        },
        "type": "object",
        "required": [
          "title",
          "kind",
          "start",
          "end",
          "price"
        ],
        "title": "ReceiptSession"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}
