Messaging

Buyer-to-seller conversations on the marketplace, and the older lead-scoped message threads.

Base URL
https://api.caroom.us

Conversations

Buyer-to-seller chat on the marketplace. A conversation is scoped to a listing and its participants; messages are posted into the conversation and read state is tracked per participant. Listing results are cursor-paginated and every response echoes the filters and sorting that were applied.

List conversations

GET/chats/conversations

Returns the conversations the caller participates in, each with its participants, last-read message and listing. The metadata object carries the pagination cursors, the total count, and a read-back of the filters and sorting applied.

Authentication Bearer token

Query parameters

userIdinteger

Scope the list to one user’s conversations.

listingIdinteger

Only conversations about this listing.

unreadOnlyboolean

Only conversations with messages the caller has not read. Defaults to false.

sortBystring

Field to sort on — createdAt or updatedAt. Defaults to updatedAt.

sortOrderenum

Sort direction. Defaults to DESC.

afterstring

Cursor from metadata.after, for the next page.

beforestring

Cursor from metadata.before, for the previous page.

  • The default page size is 10.
cURL
1curl "https://api.caroom.us/chats/conversations?listingId=11775&unreadOnly=true&sortBy=updatedAt&sortOrder=DESC" \
2  -H "Authorization: Bearer $CAROOM_ACCESS_TOKEN"
Response
{
  "conversations": [
    {
      "id": "3dac8289-67ab-4b5e-a092-6abcd55a4a0b",
      "userId": 2,
      "conversationId": "296beda4-6800-4a7e-b602-063e2c5be35c",
      "lastReadMessageID": "b7e58087-22fa-4650-ab63-7159dc535e48",
      "participantType": null,
      "createdAt": "2023-10-30T18:24:25.074Z",
      "updatedAt": "2023-10-30T18:24:25.074Z",
      "conversation": {
        "id": "296beda4-6800-4a7e-b602-063e2c5be35c",
        "listingId": 2,
        "lastMessageId": "b7e58087-22fa-4650-ab63-7159dc535e48",
        "userId": 21,
        "summary": "New communication with seller",
        "active": true,
        "createdAt": "2023-10-30T17:10:57.606Z",
        "updatedAt": "2023-10-30T18:24:24.648Z",
        "user": { "id": 21, "name": "Demo User" },
        "participants": [],
        "listing": null
      }
    }
  ],
  "metadata": {
    "after": null,
    "before": null,
    "limit": 10,
    "total_count": 4,
    "filters_applied": { "listingId": null, "unreadOnly": false },
    "sorting": { "sortBy": "updatedAt", "sortOrder": "DESC" }
  }
}
Response schema
{
  "conversations": [
    {
      "id": string,
      "userId": integer,
      "conversationId": string,
      "lastReadMessageID": string,
      "participantType": enum,
      "updatedAt": string,
      "createdAt": string,
      "conversation": {
        "id": string,
        "listingId": integer,
        "lastMessageId": string,
        "userId": integer,
        "summary": string,
        "updatedAt": string,
        "createdAt": string,
        "user": {
          "id": integer,
          "name": string
        },
        "participants": [
          {
            "id": string,
            "userId": integer,
            "conversationId": string,
            "lastReadMessageID": string,
            "participantType": enum,
            "updatedAt": string
            "createdAt": string,
          },
        ],
        "listing": {
          "id": integer,
          "uniqueId": string,
          "name": string,
          "status": enum,
          "report": {
            "id": integer,
            "thumbnail": string,
            "car": {
              "year": integer
              "make": string,
              "model": string,
              "trim": string,
            }
          }
        }
      },
      "car": {
        "year": integer
        "make": string,
        "model": string,
        "trim": string,
      },
      "leadId": integer,
      "sellerName": string
    }
  ],
  "metadata": {
    "after": string,
    "before": string,
    "limit": integer,
    "total_count": integer
  }
}

Retrieve a conversation

GET/chats/conversations/:conversation_id

Returns one conversation with its messages and participants.

Authentication Bearer token

Path parameters

conversation_idstringRequired

UUID of the conversation.

cURL
1curl "https://api.caroom.us/chats/conversations/35c7d5f4-dd34-4b88-b30d-c7b034541c34" \
2  -H "Authorization: Bearer $CAROOM_ACCESS_TOKEN"
Response schema
{
  "id": string,
  "userId": integer,
  "listingId": integer,
  "lastMessageId": string,
  "summary": string,
  "updatedAt": string,
  "createdAt": string,
  "participants": [
    {
      "id": string,
      "userId": integer,
      "conversationId": string,
      "lastReadMessageID": string,
      "participantType": enum,
      "updatedAt": string,
      "createdAt": string,
      "user": {
        "name": string
      }
    },
  ],
  "messages": [
    {
      "id": string,
      "conversationId": string,
      "senderId": integer,
      "content": string,
      "createdAt": string
    }
  ],
  "listing": {
    "id": integer,
    "uniqueId": string,
    "name": string,
    "status": enum,
    "report": {
      "id": integer,
      "thumbnail": string,
      "car": {
        "year": integer
        "make": string,
        "model": string,
        "trim": string,
        "postcode": string,
      }
    }
  },
  "car": {
    "year": integer,
    "make": string,
    "model": string,
    "trim": string,
    "postcode": string,
    "postcodeState": string
  }
}

Send a message

POST/chats/conversations/:conversation_id

Posts a message into a conversation. If no conversation exists yet between the two users for that listing, this call opens one.

Authentication Bearer token

Path parameters

conversation_idstringRequired

UUID of the conversation to post into.

Parameters

listingIdintegerRequired

Listing the conversation is about.

recipientIdintegerRequired

User receiving the message.

messagestringRequired

Message body.

cURL
1curl -X POST "https://api.caroom.us/chats/conversations/fc0f1160-14d6-44a3-9114-688fb235e635" \
2  -H "Authorization: Bearer $CAROOM_ACCESS_TOKEN" \
3  -H "Content-Type: application/json" \
4  -d '{
5    "listingId": 2,
6    "recipientId": 10934,
7    "message": "Thanks for the gesture!"
8  }'
Response schema
{
  "id": string,
  "listingId": integer,
  "userId": integer,
  "lastMessageId": string,
  "summary": string,
  "updatedAt": string,
  "createdAt": string,
  "participants": [
    {
      "id": string,
      "userId": integer,
      "conversationId": string,
      "lastReadMessageID": string,
      "participantType": enum,
      "updatedAt": string,
      "createdAt": string,
      "user": {
        "name": string
      }
    }
  ],
  "messages": [
    {
      "id": string,
      "conversationId": string,
      "senderId": integer,
      "content": string,
      "createdAt": string
    }
  ],
  "listing": {
    "id": integer,
    "uniqueId": string,
    "name": string,
    "status": enum,
    "report": {
      "id": integer,
      "thumbnail": string,
      "car": {
        "year": integer
        "make": string,
        "model": string,
        "trim": string,
        "postcode": string,
      }
    }
  },
  "car": {
    "year": integer,
    "make": string,
    "model": string,
    "trim": string,
    "postcode": string,
    "postcodeState": string
  }
}

Mark a conversation read

PATCH/chats/conversations/:conversation_id/read

Moves a participant’s last-read marker to the newest message, which clears the conversation from unreadOnly listings.

Authentication Bearer token

Path parameters

conversation_idstringRequired

UUID of the conversation.

Parameters

userIdintegerRequired

Participant whose read marker moves.

cURL
1curl -X PATCH "https://api.caroom.us/chats/conversations/bd1e66a0-b5c5-48e3-b091-76c151b4749c/read" \
2  -H "Authorization: Bearer $CAROOM_ACCESS_TOKEN" \
3  -H "Content-Type: application/json" \
4  -d '{ "userId": 1 }'
Response schema
{
  "id": string,
  "listingId": integer,
  "userId": integer,
  "lastMessageId": string,
  "summary": string,
  "updatedAt": string
  "createdAt": string
}

Lead messages

The older, lead-scoped messaging used by partners and by sellers replying from a capture link. A seller with only a session key can reply without an account.

Base URL https://api.reportauto.eu

Send a message about a lead

POST/api/leads/messages

Sends a message to the other party on a lead. Buyers address the seller with lead_id and recipient_id; a seller replying from a capture link answers an existing message with message_id and session_key instead.

Authentication API key

Parameters

messagestringRequired

Message body.

lead_idinteger

Lead the message is about. Use with recipient_id.

recipient_idinteger

User receiving the message.

message_idstring

Message being replied to, when answering from a capture link.

session_keystring

Session key that authorises the reply.

cURL
1curl -X POST "https://api.reportauto.eu/api/leads/messages" \
2  -H "Authorization: API_KEY $CAROOM_API_KEY" \
3  -H "Content-Type: application/json" \
4  -d '{
5    "lead_id": 2829,
6    "recipient_id": 2062,
7    "message": "Is the car still available?"
8  }'

List lead messages

GET/api/leads/messages

Returns the messages visible to the authenticated partner, with filters for read state and who started the thread.

Authentication API key

Query parameters

buyer_read_statusboolean

Filter on whether the buyer has read the message.

seller_read_statusboolean

Filter on whether the seller has read the message.

message_initiated_bystring

BUYER or SELLER.

sort_bystring

Field to sort on, e.g. seller_read_status.

limitinteger

Maximum number of messages to return.

pageinteger

Page number, 1-based.

afterstring

Opaque cursor for the next page.

cURL
1curl "https://api.reportauto.eu/api/leads/messages?seller_read_status=false&message_initiated_by=BUYER&limit=25&page=1" \
2  -H "Authorization: API_KEY $CAROOM_API_KEY"

Retrieve a lead message thread

GET/api/leads/messages/:message_id

Returns one message thread in full.

Authentication API key

Path parameters

message_idstringRequired

UUID of the message.

Query parameters

per_pageinteger

Messages per page within the thread.

cURL
1curl "https://api.reportauto.eu/api/leads/messages/60352228-ac21-40ff-bb42-712392ad28a4" \
2  -H "Authorization: API_KEY $CAROOM_API_KEY"