Overview
The Documents API provides comprehensive document management with AI-powered features including semantic search, automatic metadata extraction, OCR processing, and document relationships. Base Path:/documentos/
Document Search
Standard Search
Search documents by metadata and content.Search query for document title, code, or content
Filter by document type ID
Filter by discipline ID
Filter by status: BORRADOR, REVISION, APROBADO, ARCHIVADO
Filter by date from (YYYY-MM-DD)
Filter by date to (YYYY-MM-DD)
Response
Array of document objects
Vector Search (Semantic Search)
Perform AI-powered semantic search using embeddings.Natural language search query
Number of results to return
Minimum similarity score (0-1)
Filter by library/collection ID
Response
Array of search results with similarity scores
Document Details
Get Document Details
Retrieve comprehensive information about a document.Document ID
Response
Document ID
Document code
Document title
Document type information
Discipline information
Current status
Current revision details
Custom metadata fields
Array of comments
Related response documents
Responsible user information
Document Operations
Update Document Status
Change the status of a document.Document ID
New status: BORRADOR, REVISION, APROBADO, ARCHIVADO
Optional comment explaining the status change
Update Document Responsible
Assign a new responsible person.Document ID
User ID of new responsible person
Update Document Date
Update the document date.Document ID
New date (YYYY-MM-DD format)
Date type: emision, vencimiento, recepcion
Comments and Annotations
Add Comment
Add a comment to a document.Document ID
Comment text
X coordinate for pin comment on PDF
Y coordinate for pin comment on PDF
PDF page number for pin
Array of document IDs to link
Response
“success” or “error”
Created comment ID
Edit Comment
Update an existing comment.Comment ID
Updated comment text
Delete Comment
Remove a comment.Comment ID to delete
AI Processing
Trigger Text Extraction
Trigger n8n workflow to extract text from PDF.Document ID
This endpoint triggers an external n8n workflow for PDF text extraction using OCR.
Update Extracted Text
Callback endpoint to receive extracted text from n8n.Document ID
Extracted text content
Vectorize Document
Generate embeddings for semantic search.Document ID
Uses Google Gemini API to generate embeddings from extracted text. Configured via
GEMINI_API_KEY setting.Chat with AI
Ask questions about documents using AI.Natural language question
Specific document ID to query
Library/collection ID to search within
Response
AI-generated answer
Array of relevant document IDs
Confidence score (0-1)
Library Management
Get Document Libraries
Retrieve libraries/collections for a document.Document ID
Response
Array of library objects
Toggle Library Membership
Add or remove document from a library.Document ID
Library ID
Get Library Documents
Retrieve all documents in a library.Library ID
Page number for pagination
Metadata Management
Get Model Fields
Retrieve available fields for a content type (for metadata configuration).ContentType ID
Response
Array of field names available for the model
Update Metadata Value
Update a custom metadata field value.MetadataValue ID
New metadata value
Document Creation
Bulk Upload
Upload multiple documents at once.Array of file uploads (multipart/form-data)
Default document type ID
Default discipline ID
Automatically trigger AI processing
n8n Integration
Processing Callback
Webhook endpoint for n8n to return processing results.Revision ID
Extracted text from PDF
Extracted metadata (title, author, date, etc.)
Whether processing was successful
This endpoint is called by the n8n workflow after PDF processing completes.Configuration:
N8N_PROCESS_DOCUMENT_WEBHOOK_URL- Webhook URL to trigger processingINTERNAL_SITE_URL- URL for n8n to callback to Django
Configuration
Key Settings
Next Steps
Assets API
Asset management endpoints
Maintenance API
Work orders and maintenance