Skip to content
Navigation

List chats in the caller's inbox

GET
https://api.nicer.travel/chat

Lists chats ordered by last activity with participant summaries, unread counts, archive state and whether the trip has an open order. fields names the parts of a row to return (dotted for nested, - to remove one); omitted, a row carries everything but the trip's destination photo galleries, which are three quarters of the body and which no screen reads. The default scope is the caller's own chats; company scope requires a company admin and all-chats scope requires a superadmin, returning 403 otherwise.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Query parameters

  • fields
    optional
    string

    The parts of a row to return, comma-separated, dotted for nested ones and applied to every row: title,chat.chatId,travelersTrip.travelersTripId. A leading - removes one. Omitted, a row carries everything but the trip's destination photo galleries.

  • includeChat
    optional
    all
    or
    active
    or
    archived

    Which of the caller's own chats to include: active (the default) leaves out the ones they archived, archived lists only those, all lists both. Only applies to scope=mine.

  • scope
    optional
    mine
    or
    company
    or
    all

    Whose chats to list: mine (the default), the caller's own chats, for every role; company, the whole agency's trip chats, for its admins; all, every trip chat on the platform, for Nicer staff. A broader scope than the caller may read answers 403.

Returns

200

OK

JSON
  • chat
    object
    required
    • chatId
      string
      required
    • chatTitle
      required

      Any of the following:

      • string
      • null
    • companyName
      string
      required
    • kind
      trip
      or
      direct
      required
    • lastMessageTimestamp
      required

      Any of the following:

      • string
      • null
    • participantUserIds
      array of
      string
      required
    • suggestionsEnabled
      boolean
      required
    • travelersTripId
      required

      The trip this chat belongs to, when it is a trip chat.

      Any of the following:

      • string
      • null
    • type
      string
      required
    • createdAt
      optional
      string
    • updatedAt
      optional
      string

      The time of the last message; absent before the first one.

  • chatUpdatedAt
    string
    required

    The time of the last message, or of the last write to the chat.

  • hasOpenOrder
    boolean
    required
  • isArchived
    boolean
    required
  • seen
    boolean
    required

    Nothing has arrived since the caller last opened the chat.

  • title
    required

    The trip's title, or the direct chat's.

    Any of the following:

    • string
    • null
  • travelersTrip
    required

    The trip, null for a direct chat. Its destinations carry no photos unless fields asks for travelersTrip.destinations.photos.

    Any of the following:

    • object
      • associatedUserIds
        array of
        string
        required
      • companyName
        string
        required
      • createdAt
        string
        required
      • destinations
        array of
        object
        required
        • endDateTime
          string
          required
          pattern: ^\d{4}-\d{2}-\d{2}$
        • startDateTime
          string
          required
          pattern: ^\d{4}-\d{2}-\d{2}$
        • address
          optional

          Any of the following:

          • string
          • null
        • amenities
          optional
          array of
          string
        • city
          optional

          Any of the following:

          • string
          • null
        • country
          optional
          string
        • countryCode
          optional
          string
        • description
          optional
          string
        • distanceFromSearch
          optional
          object
          • unit
            km
            or
            mi
            required
          • value
            number
            required
        • features
          optional
          array of
          string
        • fullAddress
          optional
          string
        • gate
          optional

          Any of the following:

          • string
          • null
        • iataCode
          optional

          Any of the following:

          • string
          • null
        • internovaId
          optional
          string
        • latitude
          optional
          number
        • longitude
          optional
          number
        • name
          optional
          string
        • photos
          optional
          array of
          object
          • name
            string
            required
          • key
            optional
            string
          • url
            optional
            string
        • placeId
          optional
          string
        • region
          optional
          string
        • source
          optional
          string
        • state
          optional

          Any of the following:

          • string
          • null
        • terminal
          optional

          Any of the following:

          • string
          • null
        • timeZone
          optional
          string
        • zipCode
          optional

          Any of the following:

          • string
          • null
        • headerImageUrl
          optional
          string
      • primaryTravelerUserId
        string
        required
      • travelersTripId
        string
        required
      • tripEndDate
        string
        required
      • tripStartDate
        string
        required
      • tripTitle
        string
        required
      • type
        string
        required
      • updatedAt
        string
        required
      • associatedChatId
        optional

        Any of the following:

        • string
        • null
      • associatedTripItineraryId
        optional

        Any of the following:

        • string
        • null
      • lastMessageTimestamp
        optional

        Any of the following:

        • string
        • null
      • suggestionsEnabled
        optional
        boolean
    • null
  • unreadCount
    number
    required
  • users
    array of
    object
    required

    The chat's participants.

    • familyName
      string
      required
    • fullName
      required

      Any of the following:

      • string
      • null
    • givenName
      string
      required
    • type
      string
      required
    • userId
      string
      required
    • avatar
      optional
      string
    • deleted
      optional
      boolean

400

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

401

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

403

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close