{ "openapi": "3.1.0", "info": { "title": "AiForDev API", "version": "0.1.0", "description": "REST API for the AiForDevelopers platform" }, "servers": [ { "url": "http://localhost:8080/api", "description": "Local backend" } ], "security": [ { "bearerAuth": [] } ], "tags": [ { "name": "auth", "description": "Authentication & registration" }, { "name": "users", "description": "User profile" }, { "name": "schedules", "description": "Schedule & availability management" }, { "name": "calendar", "description": "Google Calendar integration" }, { "name": "eventTypes", "description": "Event type management" }, { "name": "bookings", "description": "Booking management" }, { "name": "public", "description": "Public endpoints (no auth)" }, { "name": "contacts", "description": "Contact management" } ], "paths": { "/api/auth/register": { "post": { "tags": [ "auth" ], "summary": "Register a new user", "operationId": "register", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterRequest" } } } }, "responses": { "201": { "description": "User registered successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthResponse" } } } }, "400": { "description": "Validation error or email already registered", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "emailExists": { "summary": "Email already registered", "value": { "message": "Email already registered" } }, "validation": { "summary": "Validation error", "value": { "message": "email: Invalid email format" } } } } } } } } }, "/api/auth/login": { "post": { "tags": [ "auth" ], "summary": "Authenticate user", "operationId": "login", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } } }, "responses": { "200": { "description": "Authentication successful", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthResponse" } } } }, "400": { "description": "Invalid credentials or validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "invalidCredentials": { "summary": "Invalid email or password", "value": { "message": "Invalid email or password" } }, "validation": { "summary": "Validation error", "value": { "message": "email: Invalid email format" } } } } } } } } }, "/api/auth/refresh": { "post": { "tags": [ "auth" ], "summary": "Refresh access token", "operationId": "refreshToken", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefreshRequest" } } } }, "responses": { "200": { "description": "New access token issued", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenResponse" } } } }, "400": { "description": "Invalid, expired, or missing refresh token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "invalid": { "summary": "Invalid refresh token", "value": { "message": "Invalid refresh token" } }, "notFound": { "summary": "Refresh token not found", "value": { "message": "Refresh token not found" } }, "expired": { "summary": "Refresh token expired", "value": { "message": "Refresh token expired" } }, "missing": { "summary": "Refresh token is required", "value": { "message": "refreshToken: Refresh token is required" } } } } } } } } }, "/api/auth/oauth2/google": { "get": { "tags": [ "auth" ], "summary": "Initiate Google OAuth2 flow", "operationId": "googleOAuth", "responses": { "302": { "description": "Redirect to Google OAuth consent screen" } } } }, "/api/auth/oauth2/google/callback": { "get": { "tags": [ "auth" ], "summary": "Google OAuth2 callback", "operationId": "googleOAuthCallback", "parameters": [ { "name": "code", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Authorization code from Google" } ], "responses": { "302": { "description": "Redirect to frontend with tokens", "headers": { "Location": { "schema": { "type": "string" }, "description": "{FRONTEND_URL}/auth/callback?accessToken=...&refreshToken=...&email=..." } } } } } }, "/api/me": { "get": { "tags": [ "users" ], "summary": "Get current authenticated user", "operationId": "getCurrentUser", "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Current user info", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" } } } }, "/api/schedules": { "post": { "tags": [ "schedules" ], "summary": "Create a new schedule", "operationId": "createSchedule", "security": [ { "bearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateScheduleRequest" } } } }, "responses": { "201": { "description": "Schedule created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduleResponse" } } } }, "400": { "description": "Validation error — overlapping windows, invalid dayOfWeek, or startTime >= endTime", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "overlapping": { "summary": "Availability windows overlap", "value": { "message": "Availability windows must not overlap" } }, "invalidTime": { "summary": "Invalid time range", "value": { "message": "startTime must be before endTime" } }, "validation": { "summary": "Validation error", "value": { "message": "name: Schedule name is required" } } } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" } } }, "get": { "tags": [ "schedules" ], "summary": "List schedules for current user", "operationId": "listSchedules", "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "List of user schedules", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduleResponse" } } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" } } } }, "/api/schedules/{id}": { "put": { "tags": [ "schedules" ], "summary": "Update a schedule", "operationId": "updateSchedule", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Schedule UUID" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateScheduleRequest" } } } }, "responses": { "200": { "description": "Schedule updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduleResponse" } } } }, "400": { "description": "Validation error — overlapping windows, invalid dayOfWeek, or startTime >= endTime", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "overlapping": { "summary": "Availability windows overlap", "value": { "message": "Availability windows must not overlap" } }, "invalidTime": { "summary": "Invalid time range", "value": { "message": "startTime must be before endTime" } } } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" }, "404": { "description": "Schedule not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": [ "schedules" ], "summary": "Delete a schedule", "operationId": "deleteSchedule", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Schedule UUID" } ], "responses": { "204": { "description": "Schedule deleted" }, "401": { "description": "Unauthorized — missing or invalid JWT" }, "404": { "description": "Schedule not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/calendar/google/connect": { "get": { "tags": [ "calendar" ], "summary": "Initiate Google Calendar OAuth2 flow", "operationId": "connectGoogleCalendar", "security": [], "responses": { "302": { "description": "Redirect to Google Calendar OAuth consent screen" } } } }, "/api/calendar/google/callback": { "get": { "tags": [ "calendar" ], "summary": "Google Calendar OAuth2 callback", "operationId": "googleCalendarCallback", "security": [], "parameters": [ { "name": "code", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Authorization code from Google" } ], "responses": { "302": { "description": "Redirect to frontend with status" } } } }, "/api/calendar/google/status": { "get": { "tags": [ "calendar" ], "summary": "Get Google Calendar connection status", "operationId": "getCalendarConnectionStatus", "responses": { "200": { "description": "Connection status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarConnectionStatusResponse" } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" } } } }, "/api/calendar/google/events": { "get": { "tags": [ "calendar" ], "summary": "Get busy slots from Google Calendar", "operationId": "getCalendarBusySlots", "parameters": [ { "name": "timeMin", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" }, "description": "Start of the time period" }, { "name": "timeMax", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" }, "description": "End of the time period" } ], "responses": { "200": { "description": "List of busy time slots", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarBusySlotsResponse" } } } }, "400": { "description": "Calendar not connected or invalid parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "notConnected": { "summary": "Calendar not connected", "value": { "message": "Google Calendar is not connected" } }, "invalidParams": { "summary": "Invalid query parameters", "value": { "message": "timeMin and timeMax are required" } } } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" } } }, "post": { "tags": [ "calendar" ], "summary": "Create an event in Google Calendar", "operationId": "createCalendarEvent", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCalendarEventRequest" } } } }, "responses": { "201": { "description": "Event created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarEventResponse" } } } }, "400": { "description": "Calendar not connected or validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "notConnected": { "summary": "Calendar not connected", "value": { "message": "Google Calendar is not connected" } } } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" } } } }, "/api/calendar/google/events/{googleEventId}": { "delete": { "tags": [ "calendar" ], "summary": "Delete an event from Google Calendar", "operationId": "deleteCalendarEvent", "parameters": [ { "name": "googleEventId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Google Calendar event ID" } ], "responses": { "204": { "description": "Event deleted successfully" }, "400": { "description": "Calendar not connected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "notConnected": { "summary": "Calendar not connected", "value": { "message": "Google Calendar is not connected" } } } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" }, "404": { "description": "Event not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "notFound": { "summary": "Event not found", "value": { "message": "Event not found" } } } } } } } } }, "/api/event-types": { "post": { "tags": [ "eventTypes" ], "summary": "Create a new event type", "operationId": "createEventType", "security": [ { "bearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateEventTypeRequest" } } } }, "responses": { "201": { "description": "Event type created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventTypeResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "validation": { "value": { "message": "title: Title is required" } } } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" }, "409": { "description": "Event type with this slug already exists for this user", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "duplicateSlug": { "value": { "message": "Event type with slug 'my-event' already exists" } } } } } } } }, "get": { "tags": [ "eventTypes" ], "summary": "List event types for current user", "operationId": "listEventTypes", "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "List of user event types", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/EventTypeResponse" } } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" } } } }, "/api/event-types/{id}": { "get": { "tags": [ "eventTypes" ], "summary": "Get event type by ID", "operationId": "getEventType", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Event type UUID" } ], "responses": { "200": { "description": "Event type details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventTypeResponse" } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" }, "404": { "description": "Event type not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "put": { "tags": [ "eventTypes" ], "summary": "Update an event type", "operationId": "updateEventType", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Event type UUID" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateEventTypeRequest" } } } }, "responses": { "200": { "description": "Event type updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventTypeResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized — missing or invalid JWT" }, "404": { "description": "Event type not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Event type with this slug already exists for this user", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": [ "eventTypes" ], "summary": "Delete an event type", "operationId": "deleteEventType", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Event type UUID" } ], "responses": { "204": { "description": "Event type deleted" }, "401": { "description": "Unauthorized — missing or invalid JWT" }, "404": { "description": "Event type not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/event-types/{id}/availability": { "get": { "tags": [ "eventTypes" ], "summary": "Get available time slots for a date", "description": "Returns available booking slots for the given date, accounting for schedule availability, Google Calendar busy slots, existing bookings, and buffers", "operationId": "getAvailability", "security": [], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Event type UUID" }, { "name": "date", "in": "query", "required": true, "schema": { "type": "string", "format": "date" }, "description": "Date to check (YYYY-MM-DD)" } ], "responses": { "200": { "description": "Available time slots", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AvailabilitySlotsResponse" } } } }, "404": { "description": "Event type not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/{userId}/{slug}": { "get": { "tags": [ "public" ], "summary": "Get public event type info", "description": "Returns event type details for the public booking page (no authentication required)", "operationId": "getPublicEventType", "security": [], "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Owner user UUID" }, { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Event type slug" } ], "responses": { "200": { "description": "Public event type details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicEventTypeResponse" } } } }, "404": { "description": "Event type not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/bookings": { "get": { "tags": [ "bookings" ], "summary": "List bookings for the authenticated user", "description": "Returns the authenticated user's bookings, optionally filtered by upcoming or past.", "operationId": "listBookings", "parameters": [ { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "upcoming", "past" ], "default": "upcoming" }, "description": "Filter bookings by upcoming (start time in the future) or past." } ], "responses": { "200": { "description": "List of bookings", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/BookingResponse" } } } } }, "401": { "description": "Unauthorized" } } }, "post": { "tags": [ "bookings" ], "summary": "Create a booking", "description": "Creates a new booking for a public event type (no authentication required)", "operationId": "createBooking", "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBookingRequest" } } } }, "responses": { "201": { "description": "Booking created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BookingResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "validation": { "value": { "message": "guestName: Guest name is required" } } } } } }, "404": { "description": "Event type not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Slot already booked", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "slotTaken": { "value": { "message": "This time slot is already booked" } } } } } } } } }, "/api/bookings/{id}": { "delete": { "tags": [ "bookings" ], "summary": "Cancel a booking", "description": "Cancels a booking. The authenticated owner of the event type may cancel without a token. Guests cancel by providing the cancelToken issued in the confirmation email. Cancelling also removes the associated Google Calendar event and sends cancellation emails to both parties.\n", "operationId": "cancelBooking", "security": [], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Booking UUID" }, { "name": "token", "in": "query", "required": false, "schema": { "type": "string", "format": "uuid" }, "description": "Cancel token (required for unauthenticated guests)" } ], "responses": { "200": { "description": "Booking cancelled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BookingResponse" } } } }, "401": { "description": "Unauthorized — owner auth or valid cancel token required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Booking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Booking already cancelled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "alreadyCancelled": { "value": { "message": "Booking is already cancelled" } } } } } } } } }, "/api/contacts": { "get": { "tags": [ "contacts" ], "summary": "List contacts", "operationId": "listContacts", "parameters": [ { "name": "favorite", "in": "query", "schema": { "type": "boolean" } }, { "name": "search", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "List of contacts", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ContactResponse" } } } } }, "401": { "description": "Unauthorized" } } } }, "/api/contacts/{id}": { "get": { "tags": [ "contacts" ], "summary": "Get contact by ID", "operationId": "getContact", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Contact details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContactResponse" } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Contact not found" } } }, "patch": { "tags": [ "contacts" ], "summary": "Update contact favorite status", "operationId": "updateContactFavorite", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateFavoriteRequest" } } } }, "responses": { "200": { "description": "Updated contact", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContactResponse" } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Contact not found" } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "schemas": { "RegisterRequest": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "description": "User email address" }, "password": { "type": "string", "minLength": 6, "description": "User password (min 6 characters)" } }, "required": [ "email", "password" ] }, "UserResponse": { "type": "object", "properties": { "id": { "type": "string", "description": "User UUID" }, "email": { "type": "string", "format": "email", "description": "User email address" } }, "required": [ "id", "email" ] }, "AuthResponse": { "type": "object", "properties": { "accessToken": { "type": "string", "description": "JWT access token" }, "refreshToken": { "type": "string", "description": "JWT refresh token" }, "user": { "$ref": "#/components/schemas/UserResponse" } }, "required": [ "accessToken", "refreshToken", "user" ] }, "ErrorResponse": { "type": "object", "properties": { "message": { "type": "string", "description": "Human-readable error message" } }, "required": [ "message" ] }, "LoginRequest": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "description": "User email address" }, "password": { "type": "string", "description": "User password" } }, "required": [ "email", "password" ] }, "RefreshRequest": { "type": "object", "properties": { "refreshToken": { "type": "string", "description": "Valid refresh token" } }, "required": [ "refreshToken" ] }, "TokenResponse": { "type": "object", "properties": { "accessToken": { "type": "string", "description": "New JWT access token" } }, "required": [ "accessToken" ] }, "availability": { "type": "object", "properties": { "id": { "type": "string", "description": "Availability window UUID" }, "dayOfWeek": { "type": "string", "enum": [ "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN" ], "description": "Day of week" }, "startTime": { "type": "string", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$", "description": "Start time in HH:MM format (24h)" }, "endTime": { "type": "string", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$", "description": "End time in HH:MM format (24h)" } }, "required": [ "id", "dayOfWeek", "startTime", "endTime" ] }, "ScheduleResponse": { "type": "object", "properties": { "id": { "type": "string", "description": "Schedule UUID" }, "userId": { "type": "string", "description": "Owner user UUID" }, "name": { "type": "string", "description": "Schedule name" }, "timezone": { "type": "string", "description": "IANA timezone (e.g. Europe/Moscow)" }, "availabilities": { "type": "array", "description": "Availability windows", "items": { "$ref": "#/components/schemas/availability" } } }, "required": [ "id", "userId", "name", "timezone", "availabilities" ] }, "CreateScheduleRequest": { "type": "object", "properties": { "name": { "type": "string", "description": "Schedule name" }, "timezone": { "type": "string", "description": "IANA timezone (e.g. Europe/Moscow)" }, "availabilities": { "type": "array", "description": "Availability windows (without id — created by server)", "items": { "type": "object", "properties": { "dayOfWeek": { "type": "string", "enum": [ "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN" ], "description": "Day of week" }, "startTime": { "type": "string", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$", "description": "Start time in HH:MM format (24h)" }, "endTime": { "type": "string", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$", "description": "End time in HH:MM format (24h)" } }, "required": [ "dayOfWeek", "startTime", "endTime" ] }, "minItems": 1 } }, "required": [ "name", "timezone", "availabilities" ] }, "UpdateScheduleRequest": { "type": "object", "properties": { "name": { "type": "string", "description": "Schedule name" }, "timezone": { "type": "string", "description": "IANA timezone (e.g. Europe/Moscow)" }, "availabilities": { "type": "array", "description": "Availability windows (without id — replaces existing)", "items": { "type": "object", "properties": { "dayOfWeek": { "type": "string", "enum": [ "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN" ], "description": "Day of week" }, "startTime": { "type": "string", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$", "description": "Start time in HH:MM format (24h)" }, "endTime": { "type": "string", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$", "description": "End time in HH:MM format (24h)" } }, "required": [ "dayOfWeek", "startTime", "endTime" ] }, "minItems": 1 } } }, "CalendarConnectionStatusResponse": { "type": "object", "properties": { "connected": { "type": "boolean", "description": "Whether Google Calendar is connected" }, "email": { "type": "string", "format": "email", "description": "Google Calendar email address" } }, "required": [ "connected" ] }, "CalendarBusySlot": { "type": "object", "properties": { "start": { "type": "string", "format": "date-time", "description": "Start of the busy slot" }, "end": { "type": "string", "format": "date-time", "description": "End of the busy slot" } }, "required": [ "start", "end" ] }, "CalendarBusySlotsResponse": { "type": "object", "properties": { "busy": { "type": "array", "description": "List of busy time slots", "items": { "$ref": "#/components/schemas/CalendarBusySlot" } } }, "required": [ "busy" ] }, "CreateCalendarEventRequest": { "type": "object", "properties": { "summary": { "type": "string", "description": "Event title/summary" }, "description": { "type": "string", "description": "Event description" }, "start": { "type": "string", "format": "date-time", "description": "Event start time" }, "end": { "type": "string", "format": "date-time", "description": "Event end time" } }, "required": [ "summary", "start", "end" ] }, "CalendarEventResponse": { "type": "object", "properties": { "googleEventId": { "type": "string", "description": "Google Calendar event ID" }, "summary": { "type": "string", "description": "Event title/summary" }, "description": { "type": "string", "description": "Event description" }, "start": { "type": "string", "format": "date-time", "description": "Event start time" }, "end": { "type": "string", "format": "date-time", "description": "Event end time" } }, "required": [ "googleEventId", "summary", "start", "end" ] }, "EventTypeResponse": { "type": "object", "properties": { "id": { "type": "string", "description": "EventType UUID" }, "userId": { "type": "string", "description": "Owner user UUID" }, "title": { "type": "string", "description": "Event type title" }, "description": { "type": "string", "description": "Event type description" }, "slug": { "type": "string", "description": "URL-friendly slug generated from title" }, "duration": { "type": "integer", "description": "Duration in minutes" }, "scheduleId": { "type": "string", "description": "Associated schedule UUID" }, "scheduleName": { "type": "string", "description": "Associated schedule name" }, "bufferBefore": { "type": "integer", "description": "Buffer before event in minutes" }, "bufferAfter": { "type": "integer", "description": "Buffer after event in minutes" }, "bookingUrl": { "type": "string", "description": "Public booking link for this event type" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp" } }, "required": [ "id", "userId", "title", "slug", "duration", "bufferBefore", "bufferAfter", "bookingUrl", "createdAt" ] }, "CreateEventTypeRequest": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "description": "Event type title" }, "description": { "type": "string", "description": "Event type description" }, "duration": { "type": "integer", "minimum": 5, "description": "Duration in minutes (min 5)" }, "scheduleId": { "type": "string", "description": "Associated schedule UUID" }, "bufferBefore": { "type": "integer", "minimum": 0, "description": "Buffer before event in minutes" }, "bufferAfter": { "type": "integer", "minimum": 0, "description": "Buffer after event in minutes" } }, "required": [ "title", "duration" ] }, "UpdateEventTypeRequest": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "description": "Event type title" }, "description": { "type": "string", "description": "Event type description" }, "duration": { "type": "integer", "minimum": 5, "description": "Duration in minutes (min 5)" }, "scheduleId": { "type": "string", "description": "Associated schedule UUID (empty string to unlink)" }, "bufferBefore": { "type": "integer", "minimum": 0, "description": "Buffer before event in minutes" }, "bufferAfter": { "type": "integer", "minimum": 0, "description": "Buffer after event in minutes" } } }, "AvailabilitySlot": { "type": "object", "properties": { "start": { "type": "string", "format": "date-time", "description": "Slot start time (ISO 8601)" }, "end": { "type": "string", "format": "date-time", "description": "Slot end time (ISO 8601)" } }, "required": [ "start", "end" ] }, "AvailabilitySlotsResponse": { "type": "object", "properties": { "date": { "type": "string", "format": "date", "description": "The date for which slots are returned (YYYY-MM-DD)" }, "slots": { "type": "array", "items": { "$ref": "#/components/schemas/AvailabilitySlot" } } }, "required": [ "date", "slots" ] }, "PublicEventTypeResponse": { "type": "object", "properties": { "id": { "type": "string", "description": "EventType UUID" }, "title": { "type": "string", "description": "Event type title" }, "description": { "type": "string", "description": "Event type description" }, "duration": { "type": "integer", "description": "Duration in minutes" }, "slug": { "type": "string", "description": "URL-friendly slug" }, "bufferBefore": { "type": "integer", "description": "Buffer before event in minutes" }, "bufferAfter": { "type": "integer", "description": "Buffer after event in minutes" }, "timezone": { "type": "string", "description": "Schedule IANA timezone (e.g. Europe/Moscow)" }, "ownerName": { "type": "string", "description": "Name of the event type owner" } }, "required": [ "id", "title", "duration", "slug", "bufferBefore", "bufferAfter", "timezone" ] }, "BookingResponse": { "type": "object", "properties": { "id": { "type": "string", "description": "Booking UUID" }, "eventTypeId": { "type": "string", "description": "EventType UUID" }, "eventTitle": { "type": "string", "description": "EventType title at time of booking" }, "guestName": { "type": "string", "description": "Guest full name" }, "guestEmail": { "type": "string", "description": "Guest email address" }, "notes": { "type": "string", "description": "Optional notes from the guest" }, "startTime": { "type": "string", "format": "date-time", "description": "Booking start time (ISO 8601)" }, "endTime": { "type": "string", "format": "date-time", "description": "Booking end time (ISO 8601)" }, "status": { "type": "string", "enum": [ "CONFIRMED", "CANCELLED" ], "description": "Booking status" }, "cancelToken": { "type": "string", "format": "uuid", "description": "Token used by guests to cancel a booking via the email link" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp" } }, "required": [ "id", "eventTypeId", "eventTitle", "guestName", "guestEmail", "startTime", "endTime", "status", "cancelToken", "createdAt" ] }, "CreateBookingRequest": { "type": "object", "properties": { "eventTypeId": { "type": "string", "description": "EventType UUID to book" }, "guestName": { "type": "string", "minLength": 1, "description": "Guest full name" }, "guestEmail": { "type": "string", "format": "email", "description": "Guest email address" }, "notes": { "type": "string", "description": "Optional notes from the guest" }, "startTime": { "type": "string", "format": "date-time", "description": "Selected slot start time (ISO 8601)" }, "endTime": { "type": "string", "format": "date-time", "description": "Selected slot end time (ISO 8601)" }, "timezone": { "type": "string", "description": "Guest IANA timezone (e.g. Europe/Moscow)" } }, "required": [ "eventTypeId", "guestName", "guestEmail", "startTime", "endTime" ] }, "ContactResponse": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "email": { "type": "string", "format": "email" }, "avatarUrl": { "type": "string" }, "isFavorite": { "type": "boolean" }, "lastBookedAt": { "type": "string", "format": "date-time" }, "bookingCount": { "type": "integer" }, "createdAt": { "type": "string", "format": "date-time" } } }, "UpdateFavoriteRequest": { "type": "object", "properties": { "isFavorite": { "type": "boolean" } }, "required": [ "isFavorite" ] } } } }