Get conversation by id
Chat
Get conversation by id
Returns a single conversation row by id. Caller must be a participant.
GET
Get conversation by id
Overview
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
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
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.