Documents
Documents are the core resource in DocLD. Upload a file and it is automatically parsed, chunked, and vectorized for search and chat.
The document object
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"object": "document",
"name": "invoice.pdf",
"status": "completed",
"file_type": "pdf",
"file_size": 204800,
"pages": 3,
"created": 1710000000
}Statuses
| Status | Description |
|---|---|
pending | Uploaded, waiting to be processed |
processing | Being parsed / OCR / chunked |
completed | Ready for search, chat, extraction |
failed | Processing failed |
Upload a document
POST /v1/documentsUpload a file as multipart/form-data. The document is processed asynchronously. Poll this document with GET /v1/documents/:id or check status with GET /v1/jobs/:id.
curl https://docld.com/api/v1/documents \
-H "Authorization: Bearer docld_..." \
-F file=@invoice.pdfResponse
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"object": "document",
"name": "invoice.pdf",
"status": "pending",
"file_type": "pdf",
"file_size": 204800,
"pages": null,
"created": 1710000000
}List documents
GET /v1/documents| Parameter | Type | Description |
|---|---|---|
limit | int | Max results (default 20, max 100) |
offset | int | Skip this many results (default 0) |
status | string | Filter by status |
curl "https://docld.com/api/v1/documents?limit=10" \
-H "Authorization: Bearer docld_..."Response
{
"object": "list",
"data": [
{
"id": "f47ac10b-...",
"object": "document",
"name": "invoice.pdf",
"status": "completed",
"file_type": "pdf",
"file_size": 204800,
"pages": 3,
"created": 1710000000
}
],
"has_more": false,
"total": 1
}Retrieve a document
GET /v1/documents/:idcurl https://docld.com/api/v1/documents/f47ac10b-... \
-H "Authorization: Bearer docld_..."Delete a document
DELETE /v1/documents/:idDeletes the document, its stored file, and all vector embeddings.
curl -X DELETE https://docld.com/api/v1/documents/f47ac10b-... \
-H "Authorization: Bearer docld_..."Response
{
"id": "f47ac10b-...",
"object": "document",
"deleted": true
}Get document content
GET /v1/documents/:id/contentReturns the parsed content. Use the response query parameter to control the shape (default is lean: text only).
| Parameter | Values | Default | Description |
|---|---|---|---|
response | text | text | Return only text (full text, lean) |
chunks | Return only chunks array | ||
full | Return both text and chunks |
# Default: text only (lean)
curl "https://docld.com/api/v1/documents/f47ac10b-.../content" \
-H "Authorization: Bearer docld_..."
# Chunks only
curl "https://docld.com/api/v1/documents/f47ac10b-.../content?response=chunks" \
-H "Authorization: Bearer docld_..."Response (default response=text)
{
"id": "f47ac10b-...",
"object": "document.content",
"name": "invoice.pdf",
"pages": 3,
"text": "Full document text..."
}Response (response=chunks or response=full)
With response=chunks the response has chunks only; with response=full it includes both text and chunks:
{
"id": "f47ac10b-...",
"object": "document.content",
"name": "invoice.pdf",
"pages": 3,
"text": "Full document text...",
"chunks": [
{
"id": "chunk_abc",
"index": 0,
"page": 1,
"content": "Chunk text..."
}
]
}Last updated on