A Document in R2R represents a piece of content that has been ingested into the system, resulting in downstream Chunks, Entities, and more. Documents are the fundamental unit of content management and can be:

  • Text files, PDFs, images, audio files, and other supported formats
  • Broken down into chunks for efficient retrieval
  • Processed to extract entities and relationships for knowledge graph creation
  • Associated with metadata and collections
  • Tracked for ingestion and knowledge graph extraction status

Available Endpoints

MethodEndpointDescription
POST/documentsIngest a new document from a file or text content. Supports multipart/form-data.
POST/documents/{id}Update an existing document with new content or metadata.
GET/documentsList documents with pagination. Can filter by IDs.
GET/documents/{id}Get details of a specific document.
GET/documents/{id}/chunksRetrieve the chunks generated from a document.
GET/documents/{id}/downloadDownload the original document file.
DELETE/documents/{id}Delete a specific document.
DELETE/documents/by-filterDelete multiple documents using filters.
GET/documents/{id}/collectionsList collections containing a document (superuser only).
POST/documents/{id}/extractExtract entities and relationships from a document for knowledge graph creation.
GET/documents/{id}/entitiesRetrieve entities extracted from the document.
GET/documents/{id}/relationshipsList relationships between entities found in the document.
Was this page helpful?
Built with