Get a customer
The whole person: their history, the browser context the widget noticed, and the facts learned from resolved conversations.
GET
/customers/{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 customer id.
Responses
200The customer.
idstringnamestring | nullcustomerNumberinteger | nullemailstring | nullisVerifiedbooleanThe host's site vouched for who this is.
firstSeenAtintegerlastSeenAtinteger | nullconversationCountintegerhasMoreConversationsbooleanmetadataobjectcontextobject | nullWhat the widget noticed about their browser, or null.
Show propertiesHide properties
timeZonestringlocalestringbrowserstringosstringdevicestringAllowed:
desktoptabletmobilescreenstringconversationsobject[]Show propertiesHide properties
Array of
objectidstringthreadIdstring | nullsubjectstringpreviewstringstatusstringaiStatusstringlastMessageAtintegerfactsobject[]Show propertiesHide properties
Array of
objectidstringkindstringAllowed:
identitysetupbillingpreferencepromisetextstringlearnedAtinteger401The 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/customers/string" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.median.sh/v1/customers/string", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});Response
{
"id": "string",
"name": "string",
"customerNumber": 0,
"email": "string",
"isVerified": true,
"firstSeenAt": 0,
"lastSeenAt": 0,
"conversationCount": 0,
"hasMoreConversations": true,
"metadata": {},
"context": {
"timeZone": "string",
"locale": "string",
"browser": "string",
"os": "string",
"device": "desktop",
"screen": "string"
},
"conversations": [
{
"id": "string",
"threadId": "string",
"subject": "string",
"preview": "string",
"status": "string",
"aiStatus": "string",
"lastMessageAt": 0
}
],
"facts": [
{
"id": "string",
"kind": "identity",
"text": "string",
"learnedAt": 0
}
]
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}