Get the library
The whole library at once: every folder and every document, sorted as arranged. Bodies stay home; read one with GET /knowledge/documents/{id}.
GET
/knowledgeAuthorization
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.
Responses
200Folders and documents.
foldersFolder[]Show propertiesHide properties
Array of
Folderidstringnamestringdescriptionstring | nulliconUrlstring | nullparentIdstring | nullordernumberdocumentsKnowledgeDoc[]Show propertiesHide properties
Array of
KnowledgeDocidstringtitlestringsourcestringAllowed:
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 | nullordernumberupdatedAtinteger401The bearer token is missing, revoked, or expired.
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" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.median.sh/v1/knowledge", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});Response
{
"folders": [
{
"id": "string",
"name": "string",
"description": "string",
"iconUrl": "string",
"parentId": "string",
"order": 0
}
],
"documents": [
{
"id": "string",
"title": "string",
"source": "upload",
"status": "indexing",
"error": "string",
"origin": "string",
"url": "string",
"folderId": "string",
"order": 0,
"updatedAt": 0
}
]
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}