{"openapi":"3.0.0","info":{"title":"Airbnb API","description":"Welcome to the Airbnb API! The APIs documented here allow you to programmatically `Manage a listing`, `Confirm a reservation`, `Receive reservation information` and `Send and receive messages`.","contact":{"name":"Airbnb Developer Center","url":"https://developer.airbnb.com/"},"version":"1.0"},"servers":[{"url":"https://api.airbnb.com/v2"}],"security":[{"ApiAccessToken":[],"ApiKey":[],"ApiVersion":[]}],"paths":{"/messages":{"summary":"Message APIs","post":{"tags":["Messaging"],"summary":"Send text or image as a single message","description":"Use this endpoint to send a text or an image as a single message.","operationId":"sendMessage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/send_message_request"}}}},"responses":{"200":{"description":"Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/send_message_response"}}}},"400":{"description":"Bad Request Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}},"403":{"description":"Forbidden Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}},"404":{"description":"Not Found Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}}}}},"/messages/{message_id}":{"summary":"Message APIs","put":{"tags":["Messaging"],"summary":"Update a message","description":"Use this API to update a message.","operationId":"updateMessage","parameters":[{"name":"message_id","in":"path","description":"ID of the message.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/update_message_request"}}}},"responses":{"200":{"description":"Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/empty_response.yaml"}}}},"400":{"description":"Bad Request Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}},"403":{"description":"Forbidden Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}},"404":{"description":"Not Found Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}}}}},"/threads":{"summary":"Thread APIs","get":{"tags":["Messaging"],"summary":"Retrieve all threads","description":"Use this endpoint to retrieve all threads.","operationId":"getThreads","parameters":[{"name":"_limit","in":"query","description":"Maximum number of threads to return, up to 25. The default is 20.","required":false,"schema":{"type":"integer"}},{"name":"_cursor","in":"query","description":"Cursor to retrieve subsequent pages of results.","required":false,"schema":{"type":"string"}},{"name":"_inbox_filter","in":"query","description":"Filter for the types of threads to retrieve.","required":true,"schema":{"type":"string","enum":["stay_host","experience_host","services_host","support"]}}],"responses":{"200":{"description":"Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/get_threads_response"}}}},"400":{"description":"Bad Request Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}},"403":{"description":"Forbidden Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}},"404":{"description":"Not Found Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}}}}},"/threads/{thread_id}":{"summary":"Thread APIs","get":{"tags":["Messaging"],"summary":"Retrieve thread","description":"Use this endpoint to retrieve a single thread.","operationId":"getThread","parameters":[{"name":"thread_id","in":"path","description":"Unique identifier for the thread.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/get_thread_response"}}}},"400":{"description":"Bad Request Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}},"403":{"description":"Forbidden Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}},"404":{"description":"Not Found Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}}}}},"/threads/{thread_id}/messages":{"summary":"Thread APIs","get":{"tags":["Messaging"],"summary":"Retrieve thread messages","description":"Use this endpoint to retrieve paginated messages from a thread.","operationId":"getThreadMessages","parameters":[{"name":"thread_id","in":"path","description":"Unique identifier for the thread.","required":true,"schema":{"type":"string"}},{"name":"_limit","in":"query","description":"Maximum number of messages to return, up to 100. The default is 20.","required":false,"schema":{"type":"integer"}},{"name":"_cursor","in":"query","description":"Cursor to retrieve subsequent pages of results.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/get_thread_messages_response"}}}},"400":{"description":"Bad Request Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}},"403":{"description":"Forbidden Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}},"404":{"description":"Not Found Response","content":{"application/json":{"schema":{"$ref":"../spec/schemas/common/error_response.yaml"}}}}}}}},"components":{"schemas":{"message_content_type":{"type":"string","description":"Image MIME content type.","enum":["image/jpeg","image/png","image/gif","image/tiff"]},"get_threads_response":{"type":"object","properties":{"threads":{"type":"array","items":{"$ref":"#/components/schemas/thread"}},"paging":{"$ref":"../spec/schemas/common/cursor_paging_object.yaml"}}},"get_thread_response":{"type":"object","properties":{"thread":{"$ref":"#/components/schemas/thread"}}},"get_thread_messages_response":{"type":"object","properties":{"messages":{"type":"array","description":"Sorted by creation time in descending order.  The same format as the Message Object, excluding the `thread_id`. \n","items":{"$ref":"#/components/schemas/message"}},"paging":{"$ref":"../spec/schemas/common/cursor_paging_object.yaml"}}},"booking_details":{"type":"object","properties":{"listing_id":{"type":"string","description":"Airbnb listing ID."},"listing_name":{"type":"string","description":"Listing name."},"checkin_date":{"type":"string","description":"Check-in date in  [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format."},"checkout_date":{"type":"string","description":"Check-out date in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format."},"nights":{"type":"integer","description":"Number of nights."},"number_of_guests":{"type":"integer","description":"Total number of guests."},"number_of_adults":{"type":"integer","description":"Total number of adults."},"number_of_children":{"type":"integer","description":"Total number of children."},"number_of_infants":{"type":"integer","description":"Total number of infants."},"number_of_pets":{"type":"integer","description":"Total number of pets."},"reservation_confirmation_code":{"type":"string","description":"Reservation code if present, null otherwise."},"non_response_at":{"type":"string","description":"When the inquiry is considered \"not responded to\", in [ISO 8601 ](https://www.iso.org/iso-8601-date-and-time-format.html) date/time format. Note that this negatively impacts a Host's response rate. The value is null if no response is required."},"expected_payout_amount_accurate":{"type":"string","description":"The amount to be paid out to the Host, in the Host's currency.  Formatted with the recommended [ISO-4217](https://www.iso.org/iso-4217-currency-codes.html) exponent corresponding to the currency.\n**NOTE: This field is only available when the parent attachment type is `reservation`.**"}}},"thread_attachment":{"type":"object","properties":{"type":{"type":"string","description":"Attachment type—one of `Inquiry`, `SpecialOffer`, or `Reservation`."},"status":{"type":"string","description":"Current status of the reservation, inquiry, or special offer associated with the thread.  See the list of [valid message statuses](https://developer.airbnb.com/docs/message-status)."},"status_details":{"type":"string","description":"Detailed human-readable value for the status of the thread attachment."},"booking_details":{"$ref":"#/components/schemas/booking_details"}}},"participant":{"type":"object","properties":{"id":{"type":"string","description":"User's ID."},"first_name":{"type":"string","description":"User's first name."},"preferred_locale":{"type":"string","description":"User's preferred locale. See the [list of supported locales](/reference/supported-locales)."},"location":{"type":"string","description":"User's location."},"role":{"type":"string","description":"User's role in the thread."}}},"thread":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the thread."},"business_purpose":{"type":"string","description":"Thread type—one of `booking_direct_thread`, `cohosting_direct_thread` and `support_messaging_thread`."},"updated_at":{"type":"string","description":"Date and time the thread was updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format. \n"},"users":{"type":"array","description":"All users who have access to the message thread.","items":{"$ref":"#/components/schemas/participant"}},"attachment":{"$ref":"#/components/schemas/thread_attachment"},"last_message_reads":{"type":"array","description":"A list of last message read for each thread participant that has read receipts enabled.","items":{"$ref":"#/components/schemas/last_message_read"}},"supported_reactions":{"type":"array","description":"All possible supported emojis that you can use to react to messages in the thread.","items":{"type":"string","description":"Unicode representation of a reaction emoji"}}}},"send_message_request":{"required":["thread_id"],"type":"object","properties":{"thread_id":{"type":"string","description":"Thread ID."},"message":{"type":"string","description":"A string text message, maximum 65,535 characters.  Airbnb will ignore the text if you send an image and text in the same request."},"media_url":{"type":"string","description":"The media URL for the message. Please only use the signed URLs returned by Airbnb, and make sure that the content is uploaded to the URL before calling."},"media_type":{"type":"string","description":"The media type for the message.","enum":["image","video"]}}},"update_message_request":{"required":["thread_id"],"type":"object","properties":{"thread_id":{"type":"string","description":"ID of the thread."},"mark_as_read":{"type":"boolean","description":"Update a message as read. Must be true if set."},"reaction":{"type":"string","description":"Reaction to add to this message. Must be one of supported_reactions."}}},"attachment_image":{"type":"object","properties":{"url":{"type":"string","description":"Image URL."}},"description":"Image attachment."},"attachment_video":{"type":"object","properties":{"mp4_uri":{"type":"string","description":"Video MP4 URL."},"hls_uri":{"type":"string","description":"Video HLS (playlist file) URL."},"status":{"type":"string","description":"Status for the video.","enum":["initialized","processing","ready","failed","removed"]}},"description":"Video attachment."},"attachment_media":{"type":"array","description":"Image or video attachments.","items":{"type":"object","properties":{"image":{"$ref":"#/components/schemas/attachment_image"},"video":{"$ref":"#/components/schemas/attachment_video"}}}},"message":{"type":"object","properties":{"id":{"type":"string","description":"Message ID."},"thread_id":{"type":"string","description":"Thread ID."},"parent_message_id":{"type":"string","description":"Parent thread ID."},"message":{"type":"string","description":"Message text. This will be an empty string if images are attached."},"translated_message":{"type":"string","description":"Message text translated into the authorized user's preferred language. This will be null if the user has translation disabled in their account settings, and for messages which were sent by the user themselves."},"created_at":{"type":"string","description":"The date and time this message was created in [ISO-8601](https://www.iso.org/iso-8601-date-and-time-format.html) format."},"edited_at":{"type":"string","description":"The date and time this message was edited in [ISO-8601](https://www.iso.org/iso-8601-date-and-time-format.html) format."},"deleted_at":{"type":"string","description":"The date and time this message was deleted in [ISO-8601](https://www.iso.org/iso-8601-date-and-time-format.html) format."},"attachment_media":{"$ref":"#/components/schemas/attachment_media"},"user_id":{"type":"string","description":"Message sender's Airbnb user ID."},"reactions":{"type":"array","description":"Reactions to this message.","items":{"$ref":"#/components/schemas/reaction"}}}},"last_message_read":{"type":"object","properties":{"message_id":{"type":"string","description":"The ID of the last message read by a given user."},"user_id":{"type":"string","description":"The ID of the user who last read the message."},"created_at":{"type":"string","description":"The date and time this message was read at in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format."}}},"reaction":{"type":"object","properties":{"reaction_id":{"type":"string","description":"The ID of the reaction."},"reaction_creator":{"type":"string","description":"The ID of the user who created the reaction."},"emoji":{"type":"string","description":"The reaction emoji Unicode string."},"updated_at":{"type":"string","description":"The date and time this reaction was updated at in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format."}}},"send_message_response":{"type":"object","properties":{"id":{"type":"string","description":"Message ID."}}}},"securitySchemes":{"Authorization":{"type":"apiKey","description":"Authorization string","name":"Authorization","in":"header"},"ApiAccessToken":{"type":"apiKey","description":"API key to authorize requests. Only Airbnb Partners can retrieve this information from their test accounts.","name":"X-Airbnb-OAuth-Token","in":"header"},"ApiKey":{"type":"apiKey","description":"API key to authorize requests. Only Airbnb Partners can retrieve this information from their test accounts.","name":"X-Airbnb-API-Key","in":"header"},"ApiVersion":{"type":"apiKey","description":"API key to specify API Version","name":"X-Airbnb-Req-Api-Version","in":"header"}}}}