Update a vehicle
Partial update following the design philosophy:
- Omitted JSON keys leave the corresponding entity fields untouched.
- Explicit JSON null clears the field (SQL NULL).
- Concrete values overwrite the entity field.
model and manufacturer_id are NOT NULL in the schema; sending either as null is a 422 parameter_invalid error.
custom_fields is patched as a whole-object replacement (omit = unchanged, null = clear, object = overwrite). Per-key merging is intentionally not supported. Keys and values are validated against the company's definitions — see VehicleCustomFieldValues.
Deadline dates keep their agenda events in step: moving a date moves its event, clearing one removes it, and a request that does not change a date touches no event. This covers next_inspection_at and every custom date field whose definition sets reminder_days_before. Because custom_fields is replaced wholesale, omitting a visible field's key that held a date clears it — and removes that event. Hidden fields keep their values (and events) unless their key is sent; null for the whole object clears visible fields only.
Rental fields are read-only here — use the rental setup flow to change them.
Returns the fully materialized post-update vehicle.
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/{id}
- Auth: HTTP bearer
Request body
Example request
{
"custom_fields": {
"cf_8a2d6f": "Rosso",
"cf_3f9b1c": "2027-03-31"
}
}Response
Vehicle updated. Returns the full post-update entity.
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.