IngestIQ

Documents

Document management endpoints

List Documents#

Get all documents in a knowledge base.

curl "http://localhost:3000/api/v2/knowledgebases/{kbId}/documents?page=1&limit=20" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Query Parameters#

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger20Items per page
statusstring-Filter by status
pipelineIdstring-Filter by pipeline

Response#

{
  "documents": [
    {
      "id": "doc-uuid",
      "filename": "product-guide.pdf",
      "status": "processed",
      "size": 1048576,
      "pageCount": 25,
      "pipelineId": "pipeline-uuid",
      "createdAt": "2024-01-28T12:00:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150
  }
}

Get Document#

Get document details.

curl http://localhost:3000/api/v2/knowledgebases/{kbId}/documents/{docId} \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response#

{
  "id": "doc-uuid",
  "fileId": "s3-file-id",
  "filename": "product-guide.pdf",
  "author": "Product Team",
  "size": 1048576,
  "pageCount": 25,
  "status": "processed",
  "metadata": {
    "title": "Product Guide",
    "keywords": ["guide", "product", "documentation"],
    "processingCompleted": "2024-01-28T12:05:00.000Z"
  },
  "pipelineId": "pipeline-uuid",
  "knowledgebaseId": "kb-uuid",
  "createdAt": "2024-01-28T12:00:00.000Z",
  "updatedAt": "2024-01-28T12:05:00.000Z"
}

Reprocess Document#

Re-run processing on a document.

curl -X POST http://localhost:3000/api/v2/knowledgebases/{kbId}/documents/{docId}/reprocess \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response#

{
  "documentId": "doc-uuid",
  "status": "reprocessing",
  "message": "Document queued for reprocessing"
}

Reprocessing replaces all existing embeddings for the document.


Delete Document#

Delete a document and its embeddings.

curl -X DELETE http://localhost:3000/api/v2/knowledgebases/{kbId}/documents/{docId} \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response#

{
  "message": "Document deleted successfully"
}

Document Status Values#

StatusDescription
uploadedFile received, awaiting processing
processingCurrently being processed
processedSuccessfully processed
failedProcessing failed
reprocessingBeing reprocessed

Error Responses#

ErrorStatusDescription
DOCUMENT_NOT_FOUND404Document not found
REPROCESS_FAILED500Reprocessing failed
DOCUMENT_PROCESSING409Document already processing
Documentation