Create a vehicle
Creates a new vehicle in the authenticated user's company. company_id is always derived from the bearer token and created_by from the authenticated user — neither can be set from the body.
Required: model, manufacturer_id.
Rental fields (is_rental, rental_*) are not accepted on create; rental setup is a separate flow.
Creating a vehicle also schedules its deadline events in the agenda: the revisione (next_inspection_at) and every custom date field whose definition sets reminder_days_before (see GET /v1/vehicle-field-settings).
custom_fields is keyed by definition id and validated against the company's definitions — see VehicleCustomFieldValues for the accepted value per type.
Returns the fully materialized vehicle (including the joined manufacturer_name and customer_name).
Foreign-key references in the body (customer_id, etc.) must resolve to resources owned by the authenticated user's company. Unreachable refs return 422 parameter_invalid pointing at the offending field.
Request
- Base URL: https://api.officina.it
- URL: https://api.officina.it/v1/vehicles
- Auth: HTTP bearer
Request body
Example request
{
"custom_fields": {
"cf_8a2d6f": "Rosso",
"cf_3f9b1c": "2027-03-31"
}
}Response
Vehicle created.
Example response
{
"id": "2200ab13-7c48-4d52-b6e9-0a4f81c27d3e",
"documents": [
{
"url": "/v1/vehicles/8821f0ac-5d2b-41e7-9a10-6c3f2b7d4e55/documents/3b91ee0c-19b4-4f0a-9c2e-7d51a0c88e14/download"
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.