Skip to content
Navigation

Get a chat with messages and users

GET
https://api.nicer.travel/chat/{chatId}

Returns the chat view, a page of messages with per-participant seen flags, and the user records of participants, past authors and synthetic system senders, and marks the chat read for the caller. The caller must have access to the channel.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Path parameters

  • chatId
    string
    required

Query parameters

  • limit
    optional
    string

    How many messages a page holds, the latest ones: 20 when absent, zero or not a number.

  • nextToken
    optional
    string

    The nextToken of the previous page, to read older messages.

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.

  • conversations
    array of
    object
    required

    One page of messages, oldest first.

    • attachmentUrls
      array of
      string
      required
    • authorId
      string
      required
    • chatId
      string
      required
    • createdBy
      string
      required
    • lastModifiedBy
      string
      required
    • message
      string
      required
    • conversationId
      string
      required
    • createdAt
      string
      required
    • updatedAt
      string
      required
    • type
      string
      required
    • seen
      map of
      boolean
      required

      Per participant userId, whether they have read up to this message.

    • messageHtml
      optional
      string

      The text as HTML.

    • needsAiResponse
      optional
      boolean
  • nextToken
    required

    Send it back as nextToken to read the older messages; null on the last page.

    Any of the following:

    • string
    • null
  • travelersTrip
    required

    The chat's trip, null for a direct chat or when the trip cannot be read.

    Any of the following:

    • object
      • associatedUserIds
        array of
        string
        required
      • createdAt
        string
        required
      • primaryTravelerUserId
        string
        required
      • travelersTripId
        string
        required
      • tripTitle
        string
        required
      • type
        string
        required
      • assignedAdvisorUserId
        optional

        Any of the following:

        • string
        • null
      • associatedChatId
        optional

        Any of the following:

        • string
        • null
      • associatedTripItineraryId
        optional

        Any of the following:

        • string
        • null
      • hasActivity
        optional
        boolean
    • null
  • users
    array of
    object
    required

    The participants, the past authors of these messages, and the system senders, which carry role, tenantId and timestamps.

    • 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
    • createdAt
      optional
      string
    • role
      optional
      advisor
      or
      traveler
      or
      admin
      or
      superadmin
    • tenantId
      optional
      string
    • updatedAt
      optional
      string

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