Get a conversation
The whole thread, up to the most recent 200 messages, team-only notes and system narration included.
GET
/conversations/{id}Authorization
AuthorizationBearer token · headerrequired`MEDIAN_KEY` from Settings under API, or an MCP OAuth access token. A key acts as the organization; a token acts as the person who approved it.
Path parameters
idstringrequiredA conversation id.
Responses
200The conversation and its messages, oldest first.
conversationConversationSummaryShow propertiesHide properties
idstringthreadIdstring | nullW-12: the workspace's initial and the thread's number, which is how the team refers to it. Null for a thread from before numbers existed.
subjectstringpreviewstringstatusstringAllowed:
openresolvedclosedaiStatusstringAllowed:
handlingdraftingneeds a personpausedchannelstringAllowed:
widgetemaildiscordsiteassigneestring | nullThe teammate holding it, by name, or null while the AI has it.
isUnreadbooleanisArchivedbooleansnoozedUntilinteger | nulllastMessageAtintegercreatedAtintegercustomerobjectShow propertiesHide properties
idstring | nullnamestring | nullcustomerNumberinteger | nullemailstring | nullpageobject | anyWhere the visitor was when they started it, or null.
Show propertiesHide properties
One of:
object
urlstringtitlestringreferrerstringany
anymessagesMessage[]Show propertiesHide properties
Array of
MessageidstringcreatedAtintegerauthorstring`visitor` is the customer, `ai` the agent, `human` a teammate, `system` the thread narrating itself, `note` team-only.
Allowed:
visitoraihumansystemnoteauthorNamestring | nullbodystringpendingbooleanattachmentsobject[]Show propertiesHide properties
Array of
objectidstringnamestringsizeintegertypestringurlstring | nulltoolCallsobject[]Show propertiesHide properties
Array of
objectnamestringinputstringoutputstring | nullaiErrorstring | null401The bearer token is missing, revoked, or expired.
errorobjectShow propertiesHide properties
codestringmessagestring404Not one of yours, or not there at all.
errorobjectShow propertiesHide properties
codestringmessagestring429Too many requests. Wait the seconds in `Retry-After`. Limits depend on the plan. See [rate limits](/api/errors-and-limits#rate-limits).
errorobjectShow propertiesHide properties
codestringmessagestringRequest
curl -X GET "https://api.median.sh/v1/conversations/string" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.median.sh/v1/conversations/string", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});Response
{
"conversation": {
"id": "string",
"threadId": "string",
"subject": "string",
"preview": "string",
"status": "open",
"aiStatus": "handling",
"channel": "widget",
"assignee": "string",
"isUnread": true,
"isArchived": true,
"snoozedUntil": 0,
"lastMessageAt": 0,
"createdAt": 0,
"customer": {
"id": "string",
"name": "string",
"customerNumber": 0,
"email": "string"
}
},
"page": {
"url": "string",
"title": "string",
"referrer": "string"
},
"messages": [
{
"id": "string",
"createdAt": 0,
"author": "visitor",
"authorName": "string",
"body": "string",
"pending": true,
"attachments": [
{
"id": "string",
"name": "string",
"size": 0,
"type": "string",
"url": "string"
}
],
"toolCalls": [
{
"name": "string",
"input": "string",
"output": "string"
}
],
"aiError": "string"
}
]
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}