Conversation Attachments
Overview
List paginated file and media attachments shared in a conversation — for the shared media gallery, document browser, and attachment search inside the chat UI.
Filter by type, sender, date range, or free-text search. Each item includes download URL, dimensions, size, and sender info for grid or list rendering.
When to use this endpoint?
Use Conversation Attachments when:
- Opening the shared media panel from a group or DM info sheet.
- Showing image thumbnails, PDFs, or other files sent in the thread.
- Filtering the gallery to images only via
type=image, or narrowing by sender and date range. - Paginating through a long attachment history as the user scrolls.
Part of the Chat Conversation APIs for the chat package/SDK (not Platform → Conversations). Requires a chat user Access Token for the signed-in messaging participant.
Response Data
Each item in data.list typically includes:
{baseUrl}/api/{apiVersion}/conversation/attachments?conversationId={conversationId}&type=image&page=1&limit=20- Authentication
- Required (Bearer token)
- Tenant-scoped
- Yes (tenant DB - requires x-client-id)
Request Headers
Query Parameters
Success Response (HTTP 200 OK)
On success, the API returns a paginated list of attachments. The example includes one image and one PDF from the same conversation.
{ "success": true, "message": "Attachments fetched successfully", "data": { "list": [ { "_id": "665f...0001", "messageId": "665f...0001", "conversationId": "699fe...645c", "sender": { "_id": "665f...34cd", "name": "Smith William", "profileImage": null }, "url": "https://example.com/profile-image.png", "filename": "profile-photo.png", "fileType": "image/png", "size": 20480, "width": 800, "height": 600, "duration": null, "uploadedAt": "2026-06-19T08:58:00.000Z", "createdAt": "2026-06-19T08:58:00.000Z" }, { "_id": "665f...0001", "messageId": "665f...0001", "conversationId": "699fe...645c", "sender": { "_id": "665f...34cd", "name": "Smith William", "profileImage": null }, "url": "https://example.com/report.pdf", "filename": "report.pdf", "fileType": "application/pdf", "size": 20480, "width": null, "height": null, "duration": null, "uploadedAt": "2026-06-19T08:58:00.000Z", "createdAt": "2026-06-19T08:58:00.000Z" } ], "pagination": { "currentPage": 1, "totalCount": 2, "hasNextPage": false, "hasPreviousPage": false, "pageSize": 20 } }, "error": null}Common Errors
Attachments fail when the token is missing, the conversation does not exist, or the user is not allowed to view it.
HTTP 401 Unauthorized - No token
{ "success": false, "message": "No token, authorization denied", "data": null, "error": "Unauthorized"}HTTP 404 Not Found - Conversation missing
{ "success": false, "message": "Conversation not found", "data": null, "error": null}HTTP 403 Forbidden - Access denied
{ "success": false, "message": "Access denied: insufficient permissions", "data": null, "error": null}Best Practices
- Call Attachments Summary first for tab counts, then load this endpoint when the user opens a specific category.
- Use
typefilters in the gallery UI instead of filtering large lists client-side. - Lazy-load thumbnails; open full-size previews or downloads via
urlon user action. - Link each attachment to its
messageIdso users can jump to the original message in the thread. - Always send tenant headers with the chat user Bearer token over HTTPS.
Media gallery ready
Render the attachment grid or list from this response. Pair with Attachments Summary for category tabs and counts in the shared media panel.