Knowledge

Get a document

GET
/api/v1/knowledge/documents/{doc_id}

The document with its ingestion report: what happened to it, stage by stage, and why it failed if it did; while it is read or indexed, how far it has got (progress).

More in Knowledge API.

apiKey
headerAuthorizationBearer <token>

An API key, sk-syn- and 32 characters. On SynapseOrch Cloud an owner or admin makes it under Settings → Developer; on a self-hosted install, under Settings → API Keys.

doc_id*string

Response Body

Successful Response

application/json
  1. response
id*string
kb_id*string
path*string
source*string
Value in"upload""web""record""vault"
source_url?string|null
status*string
Value in"queued""parsing""indexing""indexed""partial""failed""skipped""paused""blocked""deleting"
status_reason?string|null
error?string|null
version?integer
Default0
sha256?string|null
size_bytes?integer|null
mime?string|null
title?string|null
doc_date?string|null
metadata?
pages?integer|null
chunks?integer|null
tokens?integer|null
created_at?string|null
updated_at?string|null
indexed_at?string|null
progress?|null
report?|null
curl -X GET "https://api.synapseorch.com/api/v1/knowledge/documents/kdoc_01a10f6c8e0a2c4e6a8c0e2a4c6e8a0c" \  -H "Authorization: Bearer sk-syn-..."
{  "id": "string",  "kb_id": "string",  "path": "string",  "source": "upload",  "source_url": "string",  "status": "queued",  "status_reason": "string",  "error": "string",  "version": 0,  "sha256": "string",  "size_bytes": 0,  "mime": "string",  "title": "string",  "doc_date": "string",  "metadata": {},  "pages": 0,  "chunks": 0,  "tokens": 0,  "created_at": "string",  "updated_at": "string",  "indexed_at": "string",  "progress": {    "stage": "parse",    "done": 0,    "total": 0,    "unit": "pages",    "eta_s": 0,    "waiting": {      "reason": "rate_limited",      "provider": "string",      "provider_id": "string",      "until": "string"    },    "updated_at": "string"  },  "report": {    "report_version": 1,    "doc_id": "string",    "path": "string",    "sha256": "string",    "attempt": 1,    "started_at": "string",    "finished_at": "string",    "outcome": "queued",    "status_reason": "string",    "stages": [      {        "stage": "fetch",        "status": "ok",        "started_at": "string",        "duration_ms": 0,        "detail": {},        "error": {          "code": "string",          "message": "string",          "retryable": false        }      }    ],    "pages": {      "total": 0,      "with_text": 0,      "no_text_layer": 0,      "ocr_applied": 0,      "ocr_failed": 0,      "skipped": [        0      ]    },    "chunks": {      "count": 0,      "by_kind": {        "property1": 0,        "property2": 0      },      "tokens": 0    },    "warnings": [      {        "code": "no_text_layer",        "message": "string",        "page": 0,        "block_id": "string",        "count": 1      }    ],    "cost": {      "est_usd": 0,      "charged_microusd": 0,      "by_stage": {        "property1": 0,        "property2": 0      }    },    "parser": {      "name": "string",      "version": "string",      "options_hash": ""    },    "snapshot_id": "string",    "retry": {      "allowed": true,      "hint": "string"    }  }}