# Tire and brake wear update

The tire and brake wear estimator returns the level of wear expressed in percent and the autonomy in kilometer.

It is possible to update the distance and the wear percentage based on observations made by a mechanic or during a technical inspection or a maintenance intervention on the vehicle.&#x20;

In the case of a replacement, the distance and the wear must be set back to 0 km and 0% for the new component.

{% hint style="info" %}
If you have your **admin API key**, you can try the API via this [**link**](https://drivequant.stoplight.io/docs/drivequant-public/reference/Vehicles.yaml/paths/~1drivekit~1admin~1vehicles~1%7BvehicleId%7D~1wear/put).
{% endhint %}

## PUT /drivekit/admin/vehicles/{vehicleId}/wear

> Update vehicle wear

```json
{"openapi":"3.0.3","info":{"title":"DKAdminVehiclesV3","version":"1.0"},"servers":[{"url":"https://service.drivequant.com/v3","description":"Prod"}],"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"name":"DriveKit-Admin-API-Key","type":"apiKey","in":"header"}},"schemas":{"ErrorResponse":{"title":"ErrorResponse","type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"messageKey":{"type":"string"}}}}},"paths":{"/drivekit/admin/vehicles/{vehicleId}/wear":{"put":{"summary":"Update vehicle wear","operationId":"put-drivekit-admin-vehicles-vehicleId-wear","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"description":"","type":"object","properties":{"analyzedDistance":{"type":"number","description":"Analyzed distance with the app"},"distance":{"type":"number","description":"total distance travelled by the vehicle"},"offsetDistance":{"type":"number","description":"offset between the total distance and the analyzed distance"},"changeDate":{"type":"string","format":"date"},"wear":{"type":"number"},"autonomy":{"type":"number"},"wearRate":{"type":"number"}},"required":["analyzedDistance","distance","offsetDistance","changeDate","wear","autonomy","wearRate"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"schema":{"type":"string"},"in":"header","name":"DriveKit-Admin-API-Key","required":true,"description":"Admin API Key"},{"schema":{"type":"string","default":"application/json"},"in":"header","name":"Content-Type","required":true}],"requestBody":{"content":{"application/json":{"schema":{"description":"","type":"object","properties":{"component":{"type":"integer","description":"Component to update. Component considered for the update: \n(1) Tires \n(2) Brakes"},"distance":{"type":"number","description":"Distance traveled with the component in kilometer \nmin. = 0 km / max. = 300 000 km"},"drive":{"type":"integer","description":"Drivetrain considered for the update:\n(1) Front drive\n(2) Rear drive"},"wear":{"type":"number","description":"Level of wear observed for the considered component. \nThis value is in percent (min. = 0% / max. = 100%)"}},"required":["component","distance","drive","wear"]}}}},"description":""}}}}
```

## Request body

The table below summarizes the content of a request body.

<table><thead><tr><th width="122.046875">Field</th><th width="115.66666666666666">Type</th><th>Description</th></tr></thead><tbody><tr><td>component</td><td><code>integer</code></td><td><p>Component considered for the update</p><p><em>Allowed values: <code>1</code> (tires), <code>2</code> (brakes)</em></p></td></tr><tr><td>drive</td><td><code>integer</code></td><td><p>Drivetrain considered for the update</p><p><em>Allowed values: <code>1</code> (front drive), <code>2</code> (rear drive)</em></p></td></tr><tr><td>wear</td><td><code>number</code></td><td><p>Level of wear observed for the considered component (in %)</p><p><em>Min: 0%</em><br><em>Max: 100%</em></p></td></tr><tr><td>distance</td><td><code>number</code></td><td><p>Distance traveled with the component (in km)</p><p><em>Min: 0</em><br><em>Max: 300 000</em> </p></td></tr></tbody></table>

### **Recalibration Guidelines**

* The recalibration date is set to the request date.
* The parameters **wear** and **distance** are required fields.
* When a component is replaced:
  * `wearPct` is set to 0%
  * `declaredDistance` is set to 0 km
  * All synthesis data is reset automatically

{% hint style="warning" %}
**Important Notes**

To reset axle components, submit separate requests for the front and rear axles. Simultaneous reset requests are not allowed.
{% endhint %}

### Body samples

To declare that the front tires of the vehicle have a wear level of 40% after 14,000 km, the body of the request is as follows:

```javascript
{
  "component": 1,
  "distance": 14000,
  "drive": 1,
  "wear": 40
}
```

To declare that the rear brakes of the vehicle have just been changed, the body of the request must be as shown below:

```javascript
{
  "component": 2,
  "distance": 0,
  "drive": 2,
  "wear": 0
}
```
