{"openapi":"3.1.0","info":{"title":"HoraMatch API","version":"1.0.0","description":"API versionada para consultar disponibilidad, crear y gestionar reservas y recibir webhooks firmados."},"servers":[{"url":"https://horamatch.com/api/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/account":{"get":{"operationId":"account.retrieve","summary":"Identidad y scopes de la API key","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApiAccount"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/event-types":{"get":{"operationId":"eventTypes.list","summary":"Tipos de evento publicados","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EventTypeList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/event-types/{id}":{"get":{"operationId":"eventTypes.retrieve","summary":"Detalle de un tipo de evento","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EventType"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/event-types/{id}/slots":{"get":{"operationId":"availability.list","summary":"Disponibilidad calculada","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Availability"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"}}]}},"/bookings":{"get":{"operationId":"bookings.list","summary":"Reservas paginadas","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["tentative","pending_approval","confirmed","reschedule_pending","rejected","cancelled","completed","no_show","expired"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}]},"post":{"operationId":"bookings.create","summary":"Crear una reserva","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingCreateResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingCreateResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBookingInput"}}}}}},"/bookings/{uid}":{"get":{"operationId":"bookings.retrieve","summary":"Detalle de una reserva","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}]}},"/bookings/{uid}/cancel":{"post":{"operationId":"bookings.cancel","summary":"Cancelar una reserva","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingCancelResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingCancelResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBookingInput"}}}}}},"/webhooks/endpoints":{"get":{"operationId":"webhooks.list","summary":"Endpoints configurados","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"webhooks.create","summary":"Crear endpoint y revelar el secreto una vez por clave idempotente","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointSecret"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointSecret"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointInput"}}}}}},"/webhooks/endpoints/{id}":{"delete":{"operationId":"webhooks.remove","summary":"Desactivar endpoint","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointDisabled"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}]}},"/openapi.json":{"get":{"operationId":"openapi.retrieve","summary":"Contrato OpenAPI","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OpenApiDocument"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"hm_live_*"}},"schemas":{"ApiAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tenant":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"scopes":{"type":"array","items":{"type":"string"}}},"required":["id","name","tenant","scopes"],"additionalProperties":false},"EventType":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"durationMinutes":{"type":"integer"},"bookingWindowDays":{"type":"integer"},"locationType":{"type":"string"},"requiresApproval":{"type":"boolean"},"groupCapacity":{"anyOf":[{"type":"integer"},{"type":"null"}]},"allowsRecurrence":{"type":"boolean"},"recurrenceMaxOccurrences":{"type":"integer"},"host":{"type":"object","properties":{"handle":{"type":"string"},"name":{"type":"string"}},"required":["handle","name"],"additionalProperties":false},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","slug","title","description","type","durationMinutes","bookingWindowDays","locationType","requiresApproval","groupCapacity","allowsRecurrence","recurrenceMaxOccurrences","host","updatedAt"],"additionalProperties":false},"EventTypeList":{"type":"array","items":{"$ref":"#/components/schemas/EventType"}},"Slot":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"localDate":{"type":"string"},"localTime":{"type":"string"},"timezone":{"type":"string"},"offset":{"type":"string"},"spotsLeft":{"type":"integer"}},"required":["startsAt","endsAt","localDate","localTime","timezone","offset"],"additionalProperties":false},"Availability":{"type":"object","properties":{"eventType":{"$ref":"#/components/schemas/EventType"},"slots":{"type":"array","items":{"$ref":"#/components/schemas/Slot"}}},"required":["eventType","slots"],"additionalProperties":false},"CreateGuest":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"timezone":{"type":"string"},"locale":{"type":"string"},"notes":{"type":"string"}},"required":["name","email","timezone"],"additionalProperties":false},"BookingGuest":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"locale":{"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","email","locale","notes"],"additionalProperties":false},"Booking":{"type":"object","properties":{"uid":{"type":"string"},"eventTypeId":{"type":"string"},"status":{"type":"string","enum":["tentative","pending_approval","confirmed","reschedule_pending","rejected","cancelled","completed","no_show","expired"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"timezone":{"type":"string"},"title":{"type":"string"},"location":{"type":"object","properties":{"type":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","value"],"additionalProperties":false},"guest":{"$ref":"#/components/schemas/BookingGuest"},"revision":{"type":"integer"},"cancellationReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["uid","eventTypeId","status","startsAt","endsAt","timezone","title","location","guest","revision","cancellationReason","createdAt","updatedAt"],"additionalProperties":false},"BookingList":{"type":"array","items":{"$ref":"#/components/schemas/Booking"}},"RecurrenceInput":{"type":"object","properties":{"frequency":{"type":"string","const":"weekly"},"intervalWeeks":{"type":"integer"},"count":{"type":"integer"},"nonexistentTime":{"type":"string","enum":["skip","shift-forward"]},"ambiguousTime":{"type":"string","enum":["earlier","later"]}},"required":["intervalWeeks","count"],"additionalProperties":false},"CreateBookingInput":{"type":"object","properties":{"eventTypeId":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"guest":{"$ref":"#/components/schemas/CreateGuest"},"recurrence":{"$ref":"#/components/schemas/RecurrenceInput"}},"required":["eventTypeId","startsAt","guest"],"additionalProperties":false},"BookingOccurrence":{"type":"object","properties":{"bookingUid":{"type":"string"},"status":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"}},"required":["bookingUid","status","startsAt","endsAt"],"additionalProperties":false},"BookingSeriesResult":{"type":"object","properties":{"seriesUid":{"type":"string"},"frequency":{"type":"string","const":"weekly"},"intervalWeeks":{"type":"integer"},"count":{"type":"integer"},"occurrences":{"type":"array","items":{"$ref":"#/components/schemas/BookingOccurrence"}}},"required":["seriesUid","frequency","intervalWeeks","count","occurrences"],"additionalProperties":false},"BookingCreateResult":{"type":"object","properties":{"bookingUid":{"type":"string"},"status":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"replayed":{"type":"boolean"},"series":{"$ref":"#/components/schemas/BookingSeriesResult"}},"required":["bookingUid","status","startsAt","endsAt","replayed"],"additionalProperties":false},"CancelBookingInput":{"type":"object","properties":{"expectedRevision":{"type":"integer"}},"required":["expectedRevision"],"additionalProperties":false},"BookingCancelResult":{"type":"object","properties":{"booking":{"$ref":"#/components/schemas/Booking"},"replayed":{"type":"boolean"}},"required":["booking","replayed"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["booking.confirmed","booking.approval_requested","booking.approved","booking.rejected","booking.rescheduled","booking.cancelled"]}},"status":{"type":"string","enum":["active","disabled"]},"lastDeliveredAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","url","events","status","lastDeliveredAt","createdAt"],"additionalProperties":false},"WebhookEndpointList":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"CreateWebhookEndpointInput":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["booking.confirmed","booking.approval_requested","booking.approved","booking.rejected","booking.rescheduled","booking.cancelled"]}}},"required":["name","url","events"],"additionalProperties":false},"WebhookEndpointSecret":{"type":"object","properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"},"signingSecret":{"type":"string"},"replayed":{"type":"boolean"}},"required":["endpoint","signingSecret","replayed"],"additionalProperties":false},"WebhookEndpointDisabled":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","const":"disabled"},"replayed":{"type":"boolean"}},"required":["id","status","replayed"],"additionalProperties":false},"OpenApiDocument":{"type":"object"},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{}},"required":["code","message","requestId"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}