> For the complete documentation index, see [llms.txt](https://docs.kuzquality.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kuzquality.com/resources/premium-resources/obd-device/api/server.md).

# Server

## Server exports

### AddFaultCode

Logs a new fault to a vehicle

Add a fault to a specific vehicle. Logging the same fault multiple times will simply update the "Last seen at" date on the fault

**Arguments:**

* entity: `int` The entity ID of the vehicle to which you want to log a fault
* faultData: `table`
  * name: `string` The name of the fault
  * description: `string` The description of the fault
  * component: `string` The vehicle component of which the fault is a part of (Engine, Electric, Brakes etc.)

<pre class="language-lua"><code class="lang-lua"><strong>-- Example
</strong>exports.kq_obd:AddFaultCode(entity, {
<strong>    name = 'P0300 - Engine misfire',
</strong>    description = 'Random/Multiple Cylinder Misfire Detected',
    component = 'engine'
})

-- Returns:
-- (boolean)
</code></pre>

### DeleteVehicleFaults

Deletes all vehicle faults

* entity: `int` The entity ID of which you want to clear the faults of

```lua
-- Example
exports.kq_obd:DeleteVehicleFaults(entity)

-- Returns:
-- (boolean)
```
