{"openapi":"3.1.0","info":{"title":"Peluquería Manolo API","description":"Public API for Peluquería Manolo. Allows AI agents and applications to list services, check availability, create and cancel bookings, and read reviews. No authentication required.","version":"1.0.0","contact":{"name":"Peluquería Manolo","email":"info@peluqueriamanolo.com","url":"https://peluqueria-manolo.anima.goil.dev"}},"servers":[{"url":"https://peluqueria-manolo.anima.goil.dev","description":"Production"}],"paths":{"/api/v1/services":{"get":{"operationId":"listServices","summary":"List all services","description":"Returns all available services with prices and durations. Optional category filter.","parameters":[{"name":"category","in":"query","required":false,"description":"Filter by category: corte, color, tratamiento, barba, peinado","schema":{"type":"string","enum":["corte","color","tratamiento","barba","peinado"]}}],"responses":{"200":{"description":"List of services","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServicesResponse"},"example":{"services":[{"id":"corte-hombre","name":"Corte hombre","description":"Corte de pelo para hombre con lavado incluido","price_eur":15,"duration_min":30,"category":"corte"}]}}}}}}},"/api/v1/availability":{"get":{"operationId":"checkAvailability","summary":"Check availability","description":"Returns available time slots for a service on a given date. Slots are grouped by stylist.","parameters":[{"name":"service_id","in":"query","required":true,"description":"Service ID (e.g., corte-hombre)","schema":{"type":"string"}},{"name":"date","in":"query","required":true,"description":"Date in YYYY-MM-DD format","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Available slots","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityResponse"},"example":{"date":"2026-04-15","service_id":"corte-hombre","service_name":"Corte hombre","duration_min":30,"slots":[{"time":"09:00","stylist":"Manolo","available":true},{"time":"09:00","stylist":"Laura","available":false},{"time":"09:30","stylist":"Manolo","available":true}]}}}},"400":{"description":"Bad request (invalid service_id or past date)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/bookings":{"post":{"operationId":"createBooking","summary":"Create a booking","description":"Creates a new booking. Returns confirmation with booking_id, status, and cancellation info.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBookingRequest"},"example":{"service_id":"corte-hombre","date":"2026-04-15","time":"10:00","stylist":"Manolo","customer_name":"Joan García","customer_phone":"+34 600 123 456","notes":"Primera vez en el salón"}}}},"responses":{"201":{"description":"Booking created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingConfirmation"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/bookings/{booking_id}":{"delete":{"operationId":"cancelBooking","summary":"Cancel a booking","description":"Cancels an existing booking. Free cancellation up to 24h before the appointment.","parameters":[{"name":"booking_id","in":"path","required":true,"description":"Booking ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Booking cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancellationConfirmation"}}}},"404":{"description":"Booking not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/reviews":{"get":{"operationId":"getReviews","summary":"Get reviews","description":"Returns recent customer reviews for the salon.","responses":{"200":{"description":"List of reviews","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewsResponse"}}}}}}}},"components":{"schemas":{"Service":{"type":"object","properties":{"id":{"type":"string","example":"corte-hombre"},"name":{"type":"string","example":"Corte hombre"},"description":{"type":"string"},"price_eur":{"type":"number","example":15},"duration_min":{"type":"integer","example":30},"category":{"type":"string","enum":["corte","color","tratamiento","barba","peinado"]}}},"ServicesResponse":{"type":"object","properties":{"services":{"type":"array","items":{"$ref":"#/components/schemas/Service"}},"total":{"type":"integer"}}},"Slot":{"type":"object","properties":{"time":{"type":"string","example":"10:00"},"stylist":{"type":"string","example":"Manolo"},"available":{"type":"boolean"}}},"AvailabilityResponse":{"type":"object","properties":{"date":{"type":"string","format":"date"},"service_id":{"type":"string"},"service_name":{"type":"string"},"duration_min":{"type":"integer"},"slots":{"type":"array","items":{"$ref":"#/components/schemas/Slot"}}}},"CreateBookingRequest":{"type":"object","required":["service_id","date","time","customer_name","customer_phone"],"properties":{"service_id":{"type":"string","example":"corte-hombre"},"date":{"type":"string","format":"date","example":"2026-04-15"},"time":{"type":"string","example":"10:00"},"stylist":{"type":"string","enum":["Manolo","Laura"],"example":"Manolo"},"customer_name":{"type":"string","example":"Joan García"},"customer_phone":{"type":"string","example":"+34 600 123 456"},"notes":{"type":"string"}}},"BookingConfirmation":{"type":"object","properties":{"booking_id":{"type":"string","example":"BK-20260415-A7F3"},"status":{"type":"string","example":"confirmed"},"service":{"$ref":"#/components/schemas/Service"},"date":{"type":"string","format":"date"},"time":{"type":"string"},"stylist":{"type":"string"},"customer_name":{"type":"string"},"customer_phone":{"type":"string"},"price_eur":{"type":"number"},"confirmation_url":{"type":"string","format":"uri"},"cancellation_url":{"type":"string","format":"uri"},"cancellation_policy":{"type":"string"},"business":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":"string"},"phone":{"type":"string"}}}}},"CancellationConfirmation":{"type":"object","properties":{"booking_id":{"type":"string"},"status":{"type":"string","example":"cancelled"},"message":{"type":"string"}}},"Review":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"rating":{"type":"number","minimum":1,"maximum":5},"date":{"type":"string","format":"date"},"text":{"type":"string"},"service":{"type":"string"}}},"ReviewsResponse":{"type":"object","properties":{"reviews":{"type":"array","items":{"$ref":"#/components/schemas/Review"}},"aggregate_rating":{"type":"number"},"total_reviews":{"type":"integer"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}}}