---
title: "Create Fault"
method: POST
path: "/faults"
tags: ["Faults"]
---

# Create Fault

`POST /faults`

## Request

- Base URL: `https://secure.fleetio.com/api`
- URL: `https://secure.fleetio.com/api/faults`
- Auth: API key in header `Authorization` and API key in header `Account-Token`
- TypeScript: <https://skmtc.dev/fleetio/apis/fleetio-developer-api/docs/faults/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new Fault Record. If you need to create many Faults at once, use
the [Bulk API](/docs/overview/bulk-api) to avoid [Rate Limiting
errors](/docs/overview/rate-limiting).

## Request body

- object
  - `vehicle_id` integer, required
  - `code` string, required: The diagnostic trouble code. Must correspond with an existing [Fault Rule](/docs/api/fault-rules).
  - `count` integer: The number of times this Fault has occurred.
  - `description` string: A short description about the problem.
  - `external_id` string: An external identifier for the Fault, if applicable.
  - `last_occurred_at` string, date-time: The date and time when the Fault last occurred. We recommend using [ISO-8601](/docs/overview/date-formatting) formatted dates to avoid ambiguity.
  - `name` string: The name or label for the Fault.
  - `status` 'open' | 'resolved' | 'ignored': The status of the Fault.
  - `source` string: The source or origin of the Fault.

## Response `201`

OK

- Fault, nullable: A Fault
  - `id` integer, required
  - `created_at` string, date-time: The date and time at which this record was created.
  - `updated_at` string, date-time: The date and time at which this record was most recently updated.
  - `account_id` integer, required
  - `vehicle_id` integer, nullable, required
  - `code` string, required: The diagnostic trouble code.
  - `count` integer, nullable, required: The number of times this Fault has occurred.
  - `description` string, nullable, required: A short description about the problem.
  - `external_id` string, nullable, required: An external identifier for the Fault, if applicable.
  - `last_occurred_at` string, date-time, nullable, required: The date and time when the Fault last occurred.
  - `name` string, nullable, required: The name or label for the Fault.
  - `status` 'open' | 'resolved' | 'ignored', required: The status of the Fault.
  - `source` string, nullable: The source or origin of the Fault.
  - `vehicle_archived_at` string, date-time, nullable, required: The date and time when the associated `Vehicle` was archived, if applicable.
  - `fault_rule_id` integer, nullable
  - `is_sample` boolean: Indicates if the Fault is sample data.
  - `idempotency_key` string, nullable: An optional key for idempotent operations.

## Other responses

- `401`: Request could not be authenticated
- `403`: Insufficient permission to perform this operation
- `422`: Unprocessable Entity
- `500`: Something unexpected happened

---

[API](https://skmtc.dev/fleetio/apis/fleetio-developer-api.md) - [All operations](https://skmtc.dev/fleetio/apis/fleetio-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fleetio/apis/fleetio-developer-api/revisions/49558d744bd7?raw)
