Dashboard
DocsAPI ReferenceDocuments API

Documents API

Endpoints for uploading files, adding URLs, listing documents, and viewing processing status.

Note

File uploads follow a presigned URL flow: first request a presigned URL from the backend, upload directly to S3, then confirm the upload to trigger processing.

POST/api/projects/{project_id}/documents/upload-url
Get a presigned S3 URL for direct file upload.

Request Body

ParameterTypeDescription
file_name requiredstringOriginal file name with extension
file_type requiredstringMIME type (e.g., application/pdf)

Response

json
{
  "upload_url": "https://s3.amazonaws.com/bucket/...",
  "document_id": "uuid",
  "s3_key": "user_id/project_id/filename.pdf"
}
POST/api/projects/{project_id}/documents/confirm
Confirm file upload and trigger processing pipeline.

Request Body

ParameterTypeDescription
document_id requireduuidDocument ID returned from upload-url
s3_key requiredstringS3 key returned from upload-url
POST/api/projects/{project_id}/documents/process-url
Process a web URL — crawls the page and runs the ingestion pipeline.

Request Body

ParameterTypeDescription
url requiredstringPublic URL to crawl and process
GET/api/projects/{project_id}/documents
List all documents in a project with their processing status.

Response

json
[
  {
    "id": "uuid",
    "file_name": "research-paper.pdf",
    "file_type": "application/pdf",
    "status": "completed",
    "status_message": null,
    "created_at": "2025-01-01T00:00:00Z"
  }
]
GET/api/projects/{project_id}/documents/{document_id}
Get detailed information about a specific document, including its chunks.

Path Parameters

ParameterTypeDescription
document_id requireduuidID of the document
DELETE/api/projects/{project_id}/documents/{document_id}
Delete a document, its chunks, and its S3 file.

Path Parameters

ParameterTypeDescription
document_id requireduuidID of the document to delete
Was this page helpful?