Get conversation by id
curl --request GET \
--url https://api.example.com/api/v1/chat/conversations/:idimport requests
url = "https://api.example.com/api/v1/chat/conversations/:id"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/chat/conversations/:id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/chat/conversations/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/chat/conversations/:id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/chat/conversations/:id")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/chat/conversations/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyChat
Get conversation by id
Returns a single conversation row by id. Caller must be a participant.
GET
/
api
/
v1
/
chat
/
conversations
/
:id
Get conversation by id
curl --request GET \
--url https://api.example.com/api/v1/chat/conversations/:idimport requests
url = "https://api.example.com/api/v1/chat/conversations/:id"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/chat/conversations/:id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/chat/conversations/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/chat/conversations/:id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/chat/conversations/:id")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/chat/conversations/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyOverview
Returns a single conversation document. The caller is authorised iff their userId appears inparticipantIds; otherwise the endpoint returns 403 FORBIDDEN rather than 404 NOT_FOUND, so an attacker cannot probe for valid conversation ids by status code.
Used by:
- The conversation screen when opening from a deep link.
- After a
chat:opensocket event, to fetch the latestlastMessage/unreadCountsnapshot. - Re-fetching the conversation when reconciling stale local state.
Authentication
Bearer <accessToken> required. requireOnboarded middleware applied.
Path parameters
| Name | Type | Required | Notes | Example |
|---|---|---|---|---|
id | string | yes | 24-char hex ObjectId of the conversation. | 66400a8f1c2b4d5e6f7a9000 |
Query parameters
None.Request body
None.Response — 200 OK
| Field | Type | Notes | Example |
|---|---|---|---|
conversation | object | See Conversation object. |
Example response
{
"conversation": {
"id": "66400a8f1c2b4d5e6f7a9000",
"matchId": "66400a8f1c2b4d5e6f7a8e00",
"participantIds": [
"66400a8f1c2b4d5e6f7a8b00",
"66400a8f1c2b4d5e6f7a8b01"
],
"lastMessage": {
"text": "Hi! Loved your kitchen.",
"senderId": "66400a8f1c2b4d5e6f7a8b01",
"sentAt": "2026-05-22T14:35:12.001Z"
},
"lastMessageAt": "2026-05-22T14:35:12.001Z",
"participantState": [
{
"userId": "66400a8f1c2b4d5e6f7a8b00",
"unreadCount": 1,
"lastReadMessageId": null,
"mutedAt": null,
"blockedAt": null
},
{
"userId": "66400a8f1c2b4d5e6f7a8b01",
"unreadCount": 0,
"lastReadMessageId": null,
"mutedAt": null,
"blockedAt": null
}
],
"status": "ACTIVE", // enum: "ACTIVE" | "ARCHIVED" | "BLOCKED"
"createdAt": "2026-05-22T14:32:08.412Z",
"updatedAt": "2026-05-22T14:35:12.001Z",
"peer": {
"id": "66400a8f1c2b4d5e6f7a8b01",
"firstName": "Bob",
"avatarUrl": "https://cdn.swappr.co.uk/avatars/bob.jpg"
},
"property": {
"id": "66400a8f1c2b4d5e6f7a8c01",
"address": "12 Camden High St",
"postcode": "NW1 0JH",
"coverUrl": "https://cdn.swappr.co.uk/homes/cover.jpg"
}
}
}
The
peer (firstName + avatar) and property (the peer’s listing) fields are enriched server-side — the conversation screen’s header renders the peer’s name, avatar, and the matched property without a follow-up call. See the Conversation object for the full reference.Error responses
| Status | Code | Meaning |
|---|---|---|
| 401 | UNAUTHENTICATED | Missing, malformed, or expired access token. |
| 403 | ONBOARDING_INCOMPLETE | Caller has not finished onboarding. |
| 403 | FORBIDDEN | Caller is not a participant of this conversation. |
| 404 | NOT_FOUND | No conversation with that id (or id is not a 24-char hex ObjectId). |
Example error — 403
{
"type": "https://api.swappr.co.uk/errors/forbidden",
"title": "Forbidden",
"status": 403,
"code": "FORBIDDEN",
"detail": "caller is not a participant of this conversation",
"instance": "/api/v1/chat/conversations/66400a8f1c2b4d5e6f7a9000",
"requestId": "01HZQ7K3M4N5P6Q7R8S9T0V1W2"
}
Side effects
None — pure read.See also
- List conversations — fetch the whole inbox.
- List messages — fetch the history for this conversation.
- Socket events —
chat:opento subscribe to live updates for this conversation.
curl
curl -X GET https://api.swappr.co.uk/api/v1/chat/conversations/66400a8f1c2b4d5e6f7a9000 \
-H "Authorization: Bearer $ACCESS_TOKEN"