Get a document
One document in full, body included, plus a download URL when it arrived as a file.
GET
/knowledge/documents/{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 document id.
Responses
200The document.
idstringtitlestringsourcestringAllowed:
uploadmanualgithubnotionweblearnedstatusstringAllowed:
indexingreadyerrorerrorstring | nulloriginstring | nullA repository path, a filename, or a page URL, when it came from one.
urlstring | nullThe published page a customer can open, when the document has one. Null for words with no public home, which the agent never links.
folderIdstring | nullordernumberupdatedAtintegerbodystringfileUrlstring | nullconversationIdstring | 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/knowledge/documents/string" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.median.sh/v1/knowledge/documents/string", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});Response
{
"id": "string",
"title": "string",
"source": "upload",
"status": "indexing",
"error": "string",
"origin": "string",
"url": "string",
"folderId": "string",
"order": 0,
"updatedAt": 0,
"body": "string",
"fileUrl": "string",
"conversationId": "string"
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}