Create Document
documentos_vehiculos table.
Request Body
The request body should contain document information. While the exact schema depends on your database structure, common fields include:ID of the vehicle this document belongs to
Document type:
SOAT, RTM, or PólizaDocument issue date (YYYY-MM-DD format)
Document expiration date (YYYY-MM-DD format)
Document number or policy number
Insurance company or issuing entity name
URL to the PDF document in storage
Additional notes or observations
SOAT-Specific Fields
For SOAT (Mandatory Traffic Accident Insurance) documents:SOAT policy number
Insurance company name
SOAT premium amount
RTM-Specific Fields
For RTM (Technical-Mechanical Review) documents:Name of the inspection center
RTM certificate number
Inspection result (e.g., “Aprobado”, “Rechazado”)
Insurance Policy Fields
For Póliza (Insurance Policy) documents:Policy number
Coverage type (e.g., “Todo Riesgo”, “Responsabilidad Civil”)
Insured value amount
Premium amount
Response
Returns the created document object with all fields including the generatedid.
Unique identifier of the newly created document
Vehicle ID
Document type
Expiration date
PDF document URL
Example Response
Error Response
Document Upload Workflow
For a complete document creation workflow:- Upload PDF to storage (using your storage provider’s API)
- Get the PDF URL from the upload response
- Create the document record with the PDF URL
Example: Complete SOAT Creation
Validation
The API performs the following validations:- Required fields must be present
- Date formats must be valid ISO 8601 (YYYY-MM-DD)
- Vehicle ID must reference an existing vehicle
- Document type must be one of the supported types
Auto-Generated Fields
These fields are automatically generated:id- Auto-incremented primary keycreated_at- Timestamp of creationupdated_at- Timestamp of last update