- List inboxes GET
- Create an inbox POST
- Retrieve an inbox GET
- Update an inbox PATCH
- Delete an inbox DELETE
- List an inbox's threads GET
- Retrieve a thread GET
- Delete a thread DELETE
- List an inbox's messages GET
- Send a message from an inbox POST
- Retrieve a message GET
- Download an attachment of a message GET
- Reply to a message POST
Retrieve a thread
The conversation with its latest messages, oldest first, each with its text and extracted_text (its own words, without the quoted conversation): what an agent reads before it replies. HTML is the sender's: sanitize it before showing it to anyone.
bearerAuthAuthorizationBearer <token>A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.
inbox_id*stringThe inbox's id.
thread_id*stringThe thread's id.
Coss-Version?"2026-10-10"The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.
"2026-10-10"The thread.
application/json- response
- response
- …
object*"inbox_thread""inbox_thread"id*stringinbox_id*stringsubject*|The first message's subject.
participants*array<string>Addresses of everyone in the conversation but the inbox (Bcc'd ones never).
message_count*integerpreview*|The start of the latest message.
last_message_at*stringdate-timelast_inbound_at*|When its latest inbound message arrived: later than last_message_at's outbound one means the conversation awaits a reply.
date-timecreated_at*stringdate-timemessages*array<>The thread's messages, oldest first: its latest 50 (see message_count; list the inbox's messages for older ones).
import { Coss } from "coss";const coss = new Coss({ apiKey: process.env.COSS_API_KEY, baseUrl: "https://api.coss.com",});const { data, error } = await coss.inboxes.threads.get("inbox_01k7c8m4q2f3e9v6t5r1n0p8yz", "thread_01k7c8m4r0c2b8w9y3d5f6g7h8");{ "object": "inbox_thread", "id": "thread_01k7c8m4r0c2b8w9y3d5f6g7h8", "inbox_id": "inbox_01k7c8m4q2f3e9v6t5r1n0p8yz", "subject": "My order arrived damaged", "participants": [ "jane@example.com" ], "message_count": 2, "preview": "Sorry about that, Jane! A new one is on its way.", "last_message_at": "2026-10-10T12:01:00.000Z", "last_inbound_at": "2026-10-10T12:00:00.000Z", "created_at": "2026-10-10T12:00:00.000Z", "messages": [ { "object": "inbox_message", "id": "imsg_01k7c8m4s1d3c9x0z4e6g7h8j9", "inbox_id": "inbox_01k7c8m4q2f3e9v6t5r1n0p8yz", "thread_id": "thread_01k7c8m4r0c2b8w9y3d5f6g7h8", "direction": "inbound", "status": "received", "from": "Jane Doe <jane@example.com>", "to": [ "support-agent@k3j9x2m7qp4l.inbound.coss.com" ], "cc": [], "subject": "My order arrived damaged", "preview": "Hi, the order arrived damaged. Can you send a new one?", "attachments": [ { "id": "rcvdatt_01k7c8m4r0c2b8w9y3d5f6g7h8", "filename": "photo.jpg", "content_type": "image/jpeg", "content_id": null, "disposition": "attachment", "size": 48213 } ], "spam": false, "received_email_id": "rcvd_01k7c8m4q2f3e9v6t5r1n0p8yz", "email_id": null, "created_at": "2026-10-10T12:00:00.000Z", "reply_to": [], "message_id": "<CAF3k2m9qp4ld8sv@mail.example.com>", "in_reply_to": null, "references": [], "text": "Hi, the order arrived damaged. Can you send a new one?\n\nJane", "extracted_text": "Hi, the order arrived damaged. Can you send a new one?\n\nJane", "html": null, "truncated": false }, { "object": "inbox_message", "id": "imsg_01k7c8m5t2e4d0y1a5f7h8j9k0", "inbox_id": "inbox_01k7c8m4q2f3e9v6t5r1n0p8yz", "thread_id": "thread_01k7c8m4r0c2b8w9y3d5f6g7h8", "direction": "outbound", "status": "queued", "from": "\"Acme Support\" <support-agent@k3j9x2m7qp4l.inbound.coss.com>", "to": [ "jane@example.com" ], "cc": [], "subject": "Re: My order arrived damaged", "preview": "Sorry about that, Jane! A new one is on its way.", "attachments": [], "spam": false, "received_email_id": null, "email_id": "email_01k7c8m5t2e4d0y1a5f7h8j9k0", "created_at": "2026-10-10T12:01:00.000Z", "reply_to": [], "message_id": null, "in_reply_to": "<CAF3k2m9qp4ld8sv@mail.example.com>", "references": [ "<CAF3k2m9qp4ld8sv@mail.example.com>" ], "text": "Sorry about that, Jane! A new one is on its way.", "extracted_text": "Sorry about that, Jane! A new one is on its way.", "html": null, "truncated": false } ]}