Skip to main content

Update a vehicle

PUThttps://carchost.fieldcontrol.com.br/vehicles/{id}

Updates a vehicle. The body follows the same rules as creation. The success response uses status 201.

Requires the X-Api-Key, User-Agent and Content-Type: application/json headers. Limit: 1 request per second (learn more).

Request​

Path parameters

idstringrequired

Vehicle identifier.

Example: ZmEzZWIyYmQtNTIwYS00Yzc5LWIwZGMtZGQ4YWVmMWIwZjM3OjIyOTE1.

Headers

User-Agentstringrequired

Identification of your application.

Example: MinhaIntegracao/1.0.

Request body

JSON, sent with the Content-Type: application/json header.

namestringrequired

Vehicle name.

At least 5 characters.

licensePlatestringrequired

Vehicle license plate.

registerstring

Vehicle registration (e.g. Renavam).

typestringrequired

Vehicle type. A value outside the list results in a 500 error.

Accepted values: car, motorcycle, truck, nautical, semi_truck.

originstringrequired

Vehicle origin. A value outside the list results in a 500 error.

Accepted values: rented, company, employee.

statusstring

Vehicle status. Default available. A value outside the list results in a 500 error.

Accepted values: available, unavailable.

colorstring

Vehicle color. A value outside the list results in a 500 error.

Accepted values: yellow, blue, beige, white, bronze, gray, golden, undefined, orange, brown, silver, black, pink, purple, green, red, wine.

yearintegerrequired

Vehicle year. Numeric text ("2011") is also accepted and converted.

originalTravelingDistanceintegerrequired

Vehicle mileage at registration.

descriptionstring

Vehicle description.

imageUrlstring

URL of the vehicle photo.

qrCodestring

Vehicle QR code.

archivedboolean

Archives the vehicle.

brandobject

Brand, by id or by name (partial match, uses the first one found). See List brands.

Fields of brand
idstring

Brand identifier.

namestring

Brand name.

modelobject

Model, by id or by name (partial match, uses the first one found). With name, id can be omitted. See List models.

Fields of model
idstring

Model identifier.

namestring

Model name.

Responses

  • 201

    Vehicle updated.

  • 401

    API key missing (Missing API Key) or invalid (Invalid API Key). See Authentication.

  • 403

    Account blocked (Account blocked), expired (Account expired) or on a plan that does not allow integration (Account plan not allowed). See Authentication.

  • 422

    Invalid identifier, or one from another account, in the URL (uriValidationErr), nonexistent vehicle (resourceValidationErr with message: vehicle not found; there is no 404), invalid body or brand or model not found.

    resourceValidationErr →
  • 429

    Limit of 1 request per second exceeded. See Rate limit.

  • 500

    Unexpected server error. It also happens when type, origin, status or color are not in the accepted lists.