Inbox Conversations

Get conversations

Changed on

Get conversations

get/communication/conversations

Request

  • Base URL
    https://open-api.guesty.com/v1
  • URL
    https://open-api.guesty.com/v1/communication/conversations
  • Auth
    API key in header authorization

Query parameters

filtersstring

Array of filters to query by.

field: Subject of the filter: status, type, guest._id, owner._id, reservation._id, reservation.status, read, assignee._id, listing._id

operator: Enhanced MongoDB comparison operator: $eq, $exists, $not, $contains, $notcontains, $gt, $lt, $between, $in, $nin

value: Value to filter by

fieldsstring

Selection of fields, separated by space

sortstring

Sorting, default: -createdAt

limitinteger

Pagination, max: 100, default is: 25

cursorAfterstring

Pagination cursor, default:'',

cursorAfter and cursorBefore are not allowed to be used at the same time in one request.

First request will require only limit parameter and in response you will get cursor object.

Use cursor.after to send in query params cursorAfter parameter in order to move forward.

Use cursor.before to send in query params cursorBefore parameter in order to move backwards.

An empty string in after or before cursor in response will indicate that there is no more documents in this direction.

If you sort buy something different than createdAt, please make sure include this parameter in fields, or you will get empty cursor.

cursorAfter and cursorBefore are not allowed to be used at the same time in one request.

cursorBeforestring

Pagination cursor, default:null

conversation types'guest' | 'owner' | 'owner-direct'

Deprecated — use the type query parameter instead. The legacy name contains a space and is not transmitted correctly by generated clients.

type'guest' | 'owner' | 'owner-direct'

The conversations API supports guest, owner, and owner-direct conversations.

The query parameter type (guest, owner, or owner-direct; default: guest) determines which conversations are returned.

  • guest — guest inbox conversations
  • owner — owner conversations (includes owner and owner-guest records)
  • owner-direct — direct owner conversations

Owner and owner-direct conversations do not support airbnb2 module type; messages sent with platform module type are delivered through Email.

Response

OK

statusnumber

Example response

{
  "status": 200,
  "data": {
    "count": 30,
    "countUnread": 2,
    "fields": "guest reservation status assignee priority createdAt",
    "limit": 25,
    "conversations": [
      {
        "_id": "6134a49cd450d300307794cb",
        "priority": 10,
        "meta": {
          "reservations": [
            {
              "_id": "61347d71d450d300307792a4",
              "status": "inquiry",
              "checkIn": "2021-09-04T21:00:00.000Z",
              "checkOut": "2021-09-05T20:00:00.000Z",
              "listing": {
                "tags": [
                  "Pool"
                ],
                "_id": "5fba2d97d8e638002d76d842",
                "picture": {
                  "_id": "615c0214cdf3370028883d3a",
                  "thumbnail": "https://res.cloudinary.com/guesty/image/upload/c_fit,h_200/v1606036872/preprod/5fb67280e39677002e6c2683/ephepadfvgopafgykxrc.jpg"
                },
                "address": {
                  "full": "Loma Mazamitla Sur, La Aurora, 44790 Guadalajara, Jal., Mexico",
                  "city": "Guadalajara",
                  "country": "Mexico",
                  "state": "Jalisco"
                },
                "nickname": "OPS-Listing",
                "title": "TEST"
              }
            }
          ],
          "guest": {
            "_id": "61347d70d450d300307792a3",
            "email": "asdasd@assadsa.com"
          }
        },
        "accountId": "5fb67280e39677002e6c2683",
        "createdAt": "2021-09-05T11:06:05.388Z",
        "state": {
          "status": "OPEN"
        }
      }
    ]
  }
}

Changes

    • breaking

      the query request parameter conversation types was restricted to a list of enum values

    • breaking

      for the query request parameter conversation types, default value guest was added

    • info

      added the new optional query request parameter type

    • info

      query request parameter conversation types was deprecated

    • info

      added the new enum value guest to the query request parameter conversation types

    • info

      added the new enum value owner to the query request parameter conversation types

    • info

      added the new enum value owner-direct to the query request parameter conversation types