-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathopenapi.yaml
More file actions
1597 lines (1545 loc) · 47.4 KB
/
Copy pathopenapi.yaml
File metadata and controls
1597 lines (1545 loc) · 47.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: Hospitable Public API
version: "2.0"
description: |
The Hospitable Public API allows you to manage calendars, reservations, properties, and more in a programmatic way, using conventional HTTP requests.
The API conforms to REST architectural standards and uses OAuth 2.0 for authentication.
Key features:
- Manage properties, reservations, and calendars
- Automated guest messaging
- Multi-platform synchronization (Airbnb, Vrbo, Booking.com)
- Webhook support for real-time updates
- Dynamic pricing and availability management
contact:
name: Hospitable Platform Team
email: team-platform@hospitable.com
externalDocs:
description: Official API Documentation
url: https://developer.hospitable.com/docs/public-api-docs/
servers:
- url: https://public.api.hospitable.com/v2
description: Production server
security:
- Bearer-Authorization: []
components:
securitySchemes:
Bearer-Authorization:
type: http
scheme: bearer
description: Enter the token with the `Bearer ` prefix, e.g. `Bearer abcde12345`
schemas:
# Core Property Schema
Property:
type: object
required:
- id
- name
- public_name
- picture
- address
- timezone
- listed
- amenities
- description
- summary
- check-in
- check-out
- currency
- capacity
- room_details
- house_rules
- listings
- tags
- property_type
- room_type
- calendar_restricted
properties:
id:
type: string
format: uuid
examples: ["550e8400-e29b-41d4-a716-446655440000"]
name:
type: string
examples: ["Relaxing Villa near the sea"]
public_name:
type: string
examples: ["Relaxing Villa near the sea"]
picture:
type: string
format: uri
examples: ["https://cdn2.thecatapi.com/images/d9m.jpg"]
address:
type: object
required: [number, street, city, state, country, postcode, coordinates, display]
properties:
number:
type: string
description: Apartment or unit number
examples: ["32"]
street:
type: string
examples: ["Senefelderplatz"]
city:
type: string
examples: ["Berlin"]
state:
type: string
country:
type: string
examples: ["DE"]
postcode:
type: string
examples: ["10405"]
coordinates:
type: object
required: [latitude, longitude]
properties:
latitude:
type: number
format: float
examples: [50.8514786]
longitude:
type: number
format: float
examples: [4.364562]
display:
type: string
examples: ["37a Senefelderplatz, 10405 Berlin, DE"]
timezone:
type: string
examples: ["+0200"]
listed:
type: boolean
examples: [true]
amenities:
type: array
items:
type: string
examples: ["shower"]
description:
type: string
examples: ["Example Description"]
summary:
type: string
examples: ["Example Summary"]
check-in:
type: string
description: The default checkin time for the property
examples: ["12:30"]
check-out:
type: string
description: The default checkout time for the property
examples: ["12:30"]
currency:
type: string
examples: ["EUR"]
capacity:
type: object
properties:
max:
type: integer
nullable: true
examples: [2]
bedrooms:
type: integer
nullable: true
examples: [1]
beds:
type: number
nullable: true
examples: [1]
bathrooms:
type: number
nullable: true
examples: [1.5]
room_details:
type: array
items:
type: object
required: [type, quantity]
properties:
type:
type: string
examples: ["king_size"]
quantity:
type: integer
examples: [1]
house_rules:
type: object
required: [pets_allowed, smoking_allowed, events_allowed]
properties:
pets_allowed:
type: boolean
examples: [true]
smoking_allowed:
type: boolean
examples: [false]
events_allowed:
nullable: true
listings:
type: array
items:
type: object
required: [platform, platform_id]
properties:
platform:
type: string
examples: ["airbnb"]
platform_id:
type: string
description: This is the listing id used on the platform
examples: ["24488"]
platform_name:
type: string
description: "`pat:read` scope only"
platform_email:
type: string
description: "`pat:read` scope only"
ical_imports:
type: array
description: iCal import feeds for this property. Only included when 'listings' is included.
items:
type: object
required: [uuid, url, name, host, last_sync_at, disconnected_at]
properties:
uuid:
type: string
format: uuid
description: The unique identifier for this iCal import
examples: ["550e8400-e29b-41d4-a716-446655440000"]
url:
type: string
format: uri
description: The URL of the iCal feed
examples: ["https://example.com/calendar.ics"]
name:
type: string
nullable: true
description: A friendly name for this iCal import
examples: ["Vacation Rental Calendar"]
host:
type: object
required: [first_name, last_name]
properties:
first_name:
type: string
nullable: true
examples: ["John"]
last_name:
type: string
nullable: true
examples: ["Doe"]
last_sync_at:
type: string
format: date-time
nullable: true
examples: ["2019-01-01T12:00:00Z"]
disconnected_at:
type: string
format: date-time
nullable: true
examples: ["2019-01-01T12:00:00Z"]
tags:
type: array
items:
type: string
examples: ["Tag"]
property_type:
type: string
room_type:
type: string
calendar_restricted:
type: boolean
description: If a property is `calendar_restricted` its calendar will not be able to be updated using the Update Property Calendar endpoint
parent_child:
type: object
nullable: true
description: If the property is in a Parent/Child setup then this will contain all the information about that relationship
properties:
type:
type: string
enum: [parent, child]
description: If this property is the parent or child in the relationship
parent:
type: string
nullable: true
description: If this property is a child, this is the parent property id
examples: ["550e8400-e29b-41d4-a716-446655440000"]
children:
type: array
description: If this property is a parent, this is any child property ids
items:
type: string
format: uuid
examples: ["550e8400-e29b-41d4-a716-446655440000"]
siblings:
type: array
description: If this property is a child, this is any sibling property ids
items:
type: string
format: uuid
examples: ["550e8400-e29b-41d4-a716-446655440000"]
# Reservation Schema
Reservation:
type: object
required:
- id
- conversation_id
- platform
- platform_id
- booking_date
- arrival_date
- departure_date
- nights
- check_in
- check_out
- last_message_at
- status
- reservation_status
- status_history
- guests
properties:
id:
type: string
format: uuid
examples: ["6f58fd0a-a9cb-3746-9219-384a156ff7bb"]
conversation_id:
type: string
format: uuid
examples: ["6f58fd0a-a9cb-3746-9219-384a156ff7bb"]
platform:
type: string
enum: [airbnb, homeaway, booking, direct, manual]
readOnly: true
examples: ["homeaway"]
platform_id:
type: string
description: The reservation code
examples: ["ABC123"]
booking_date:
type: string
format: date-time
examples: ["2019-01-01T12:00:00Z"]
arrival_date:
type: string
format: date-time
description: This provides only the date, not the exact check-in time. Refer to check_in.
examples: ["2019-01-03T00:00:00-05:00"]
departure_date:
type: string
format: date-time
description: This provides only the date, not the exact check-out time. Refer to check_out.
examples: ["2019-01-05T00:00:00-05:00"]
nights:
type: integer
check_in:
type: string
format: date-time
examples: ["2019-01-03T13:00:00-05:00"]
check_out:
type: string
format: date-time
examples: ["2019-01-05T11:00:00-05:00"]
last_message_at:
type: string
format: date-time
examples: ["2019-01-05T11:00:00-00:00"]
status:
type: string
examples: ["booking"]
deprecated: true
reservation_status:
type: object
required: [current, history]
properties:
current:
$ref: '#/components/schemas/ReservationStatus'
history:
type: array
items:
allOf:
- $ref: '#/components/schemas/ReservationStatus'
- type: object
required: [changed_at]
properties:
changed_at:
type: string
format: date-time
examples: ["2019-01-03T12:00:00-05:00"]
status_history:
type: array
deprecated: true
items:
type: object
required: [category, sub_category, changed_at]
properties:
category:
type: string
examples: ["accepted"]
sub_category:
type: string
nullable: true
examples: ["accepted"]
changed_at:
type: string
format: date-time
examples: ["2019-01-03T12:00:00-05:00"]
guests:
type: object
required: [total, adult_count, child_count, infant_count, pet_count]
properties:
total:
type: integer
examples: [1]
adult_count:
type: integer
examples: [1]
child_count:
type: integer
examples: [0]
infant_count:
type: integer
examples: [0]
pet_count:
type: integer
examples: [0]
issue_alert:
type: string
nullable: true
description: Any guest issues that have been detected on the reservation
examples: ["Broken AC"]
stay_type:
type: string
enum: [guest_stay, owner_stay]
ReservationStatus:
type: object
required: [category, sub_category]
properties:
category:
type: string
enum: [request, accepted, cancelled, not accepted, unknown, checkpoint]
description: The overall status of the reservation
sub_category:
type: string
enum: [pending verification, awaiting approval, request to book, request for payment, declined, withdrawn, expired, checkpoint, voided]
description: The status of the reservation within a category
# Message Schema
Message:
type: object
properties:
platform:
type: string
examples: ["airbnb"]
platform_id:
type: integer
examples: [1130024]
conversation_id:
type: string
examples: ["becd1474-ccd1-40bf-9ce8-04456bfa338d"]
reservation_id:
type: string
nullable: true
examples: ["becd1474-ccd1-40bf-9ce8-04456bfa338d"]
content_type:
type: string
examples: ["text/plain"]
body:
type: string
examples: ["Hello, there."]
attachments:
type: array
items:
type: object
properties:
type:
type: string
enum: [image]
url:
type: string
description: The image location URL
sender_type:
type: string
examples: ["host", "guest"]
sender_role:
type: string
examples: ["host", "co-host", "teammate", "null"]
sender:
type: object
properties:
first_name:
type: string
examples: ["Jane"]
full_name:
type: string
examples: ["Jane Doe"]
locale:
type: string
examples: ["en"]
picture_url:
type: string
format: uri
thumbnail_url:
type: string
format: uri
location:
nullable: true
user:
type: object
properties:
id:
type: string
format: uuid
email:
type: string
format: email
name:
type: string
created_at:
type: string
format: date-time
examples: ["2019-07-29T19:01:14Z"]
source:
type: string
enum: [public_api, platform, AI, automated, hospitable]
description: |
The source of the message:
- **public_api**: sent using the API, either using an access token or by an integration partner
- **platform**: Sent through the booking channel's native messaging platform
- **hospitable**: sent from within Hospitable
- **automated**: a scheduled or event based automated message
- **AI**: Sent using Hospitable auto-reply
integration:
type: string
nullable: true
description: |
**Personal Access Token only!**
If the message was sent using an integration, then the name of the integration partner will be returned.
sent_reference_id:
type: string
nullable: true
description: The message identifier provided if the message was sent using one of the Send Message endpoints
# Financial Schemas
FinancialV2:
type: object
properties:
amount:
type: integer
examples: [12345]
formatted:
type: string
examples: ["$123.45"]
NegativeFinancial:
type: object
properties:
amount:
type: integer
examples: [-12345]
formatted:
type: string
examples: ["$-123.45"]
# Calendar Schema
CalendarDay:
type: object
properties:
date:
type: string
format: date
examples: ["2023-10-01"]
day:
type: string
examples: ["SUNDAY"]
min_stay:
type: integer
status:
type: object
properties:
reason:
type: string
enum: [RESERVED, AVAILABLE, BLOCKED]
description: "`BLOCKED` is used for all other reasons a date is unavailable"
source_type:
type: string
enum: [USER, VENDOR, PLATFORM, AVAILABILITY_WINDOW, TURNOVER_DAY, ADVANCED_NOTICE, UPSELL, RESERVATION]
nullable: true
description: The source of the availability
source:
type: string
nullable: true
description: The source of the availability
examples: ["Airbnb"]
available:
type: boolean
examples: [false]
price:
type: object
properties:
amount:
type: integer
examples: [15000]
currency:
type: string
examples: ["EUR"]
formatted:
type: string
examples: ["€150.00"]
closed_for_checkin:
type: boolean
closed_for_checkout:
type: boolean
# Review Schema
Review:
type: object
required: [id, platform, public, private]
properties:
id:
type: string
format: uuid
examples: ["550e8400-e29b-41d4-a716-446655440000"]
platform:
type: string
enum: [airbnb, direct]
examples: ["airbnb"]
public:
type: object
required: [rating, review, response]
properties:
rating:
type: integer
minimum: 1
maximum: 5
review:
type: string
examples: ["Great place we will be back!"]
response:
type: string
examples: ["So happy you enjoyed it so much!"]
private:
type: object
required: [feedback]
properties:
feedback:
type: string
examples: ["downstairs was a bit cold."]
detailed_ratings:
type: array
items:
type: object
properties:
type:
type: string
enum: [cleanliness, communication, location, checkin, accuracy, value]
rating:
type: integer
minimum: 1
maximum: 5
comment:
type: string
examples: ["The cabin was cozy and comfy."]
responded_at:
type: string
format: date-time
reviewed_at:
type: string
format: date-time
examples: ["2024-03-19T10:00:00Z"]
can_respond:
type: boolean
guest:
type: object
required: [first_name, last_name]
properties:
first_name:
type: string
last_name:
type: string
language:
type: string
description: The guest's preferred language
# Pagination Schema
PaginationMeta:
type: object
properties:
current_page:
type: integer
examples: [1]
from:
type: integer
examples: [1]
last_page:
type: integer
examples: [50]
per_page:
type: integer
examples: [10]
to:
type: integer
examples: [10]
total:
type: integer
examples: [100]
links:
type: array
items:
type: object
properties:
url:
type: string
nullable: true
label:
type: string
examples: ["« Previous"]
active:
type: boolean
examples: [false]
# Error Schema
Error:
type: object
properties:
status_code:
type: integer
examples: [400]
reason_phrase:
type: string
examples: ["Invalid pagination parameter supplied."]
message:
type: string
examples: ["The given data was invalid."]
paths:
# Properties endpoints
/properties:
get:
summary: Get Properties
description: |
Retrieve a list of properties associated with your account.
**Available includes:**
- user
- listings (required: `listing:read` scope)
- details
- bookings
tags: [Properties]
parameters:
- name: include
in: query
description: What relationships should be included in the response
schema:
type: string
examples: ["listings"]
- name: page
in: query
description: The page of results to return
schema:
type: integer
minimum: 1
default: 1
- name: per_page
in: query
description: The number of results to include per page
schema:
type: integer
minimum: 1
maximum: 100
default: 10
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Property'
meta:
$ref: '#/components/schemas/PaginationMeta'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/properties/search:
get:
summary: Search Properties
description: |
Search for properties with availability and pricing for specific dates.
This endpoint allows you to search up to **3 years** in the future and for a max period of **90 days**.
**Available includes:**
- listings (required: `listing:read` scope)
- details
Requires the customer to have a Self-hosted site created in Direct, with the properties scoped.
tags: [Properties]
parameters:
- name: include
in: query
description: What relationships should be included in the response
schema:
type: string
examples: ["listings"]
- name: start_date
in: query
required: true
schema:
type: string
format: date
examples: ["2024-08-16"]
- name: end_date
in: query
required: true
schema:
type: string
format: date
examples: ["2024-10-21"]
- name: adults
in: query
required: true
schema:
type: integer
minimum: 1
- name: children
in: query
schema:
type: integer
minimum: 0
- name: infants
in: query
schema:
type: integer
minimum: 0
- name: pets
in: query
schema:
type: integer
minimum: 0
- name: location
in: query
style: deepObject
schema:
type: object
required: [latitude, longitude]
properties:
latitude:
type: number
format: float
longitude:
type: number
format: float
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
property:
$ref: '#/components/schemas/Property'
pricing:
type: object
properties:
daily:
type: array
items:
type: object
properties:
date:
type: string
format: date
price:
$ref: '#/components/schemas/FinancialV2'
total_without_taxes:
$ref: '#/components/schemas/FinancialV2'
total:
$ref: '#/components/schemas/FinancialV2'
availability:
type: object
properties:
available:
type: boolean
details:
type: array
items:
type: object
properties:
notAvailableReason:
type: string
date:
type: string
format: date-time
distance_in_km:
type: integer
/properties/{uuid}:
get:
summary: Get Property by UUID
description: |
Retrieve a specific property by its ID.
**Available includes:**
- user
- listings (required: `listing:read` scope)
- details
- bookings
tags: [Properties]
parameters:
- name: uuid
in: path
required: true
description: The UUID of the property to retrieve
schema:
type: string
format: uuid
- name: include
in: query
description: What relationships should be included in the response
schema:
type: string
examples: ["listings"]
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Property'
/properties/{uuid}/calendar:
get:
summary: Get Property Calendar
description: |
Retrieve calendar data including availability and pricing.
**Required scopes:**
- `property:read`
- `calendar:read`
tags: [Properties]
parameters:
- name: uuid
in: path
required: true
description: The UUID of the property
schema:
type: string
format: uuid
- name: start_date
in: query
schema:
type: string
format: date
- name: end_date
in: query
schema:
type: string
format: date
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
start_date:
type: string
format: date
end_date:
type: string
format: date
days:
type: array
items:
$ref: '#/components/schemas/CalendarDay'
put:
summary: Update Property Calendar
description: |
Update pricing and availability for specific dates.
Allows updating a property's calendar data for up to 1,095 days (3 years) into the future.
**Required scopes:**
- `property:read`
- `calendar:write`
**Rate limit**: 1000 requests per minute for the calendar endpoint.
tags: [Properties]
parameters: