Introduction
The Document Management API provides comprehensive functionality for creating, storing, and managing pharmacovigilance documentation in the VIGIA platform. It supports document versioning, template-based generation, and multiple file formats.Base URL
All document management endpoints are prefixed with:Authentication
All endpoints require authentication using the Bearer token obtained from the login endpoint.Core Features
Document CRUD Operations
- Create documents with file uploads
- List and filter documents by code, title, category, or area
- Update document metadata and files
- Toggle document validity status
Version Management
- Create new document versions
- View version history
- Download specific versions
- Switch between document versions
Template System
- Predefined templates for common pharmacovigilance documents
- Dynamic field mapping for automated document generation
- Support for DOCX, PDF, and TXT formats
- Template CRUD operations
Document Preview
- PDF preview generation from DOCX files
- Inline or attachment download options
- Automatic conversion using LibreOffice or MS Word
Document Categories
The system supports various document categories:- Formato: Forms and notification templates (e.g., FO-FMV-002, FO-FMV-008)
- Procedimiento: Standard operating procedures (e.g., PD-FMV-010)
- Custom categories as needed
File Formats Supported
| Format | Extension | MIME Type | Use Case |
|---|---|---|---|
| Microsoft Word | .docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Primary document format with template support |
| application/pdf | Generated previews and exports | ||
| Plain Text | .txt | text/plain | Fallback format |
Storage Structure
Documents are stored in a versioned directory structure:Response Models
DocumentoRead
DocumentoVersion
Error Handling
The API uses standard HTTP status codes:200 OK: Successful request201 Created: Resource created successfully400 Bad Request: Invalid parameters or duplicate code404 Not Found: Document or version not found500 Internal Server Error: Server-side processing error
Rate Limiting
API requests are subject to rate limiting based on user role and authentication.Next Steps
Upload Documents
Learn how to create and upload documents
Digital Signatures
Add digital signatures to documents
Export Formats
Export documents in various formats