---
title: "Create Fault Rule"
method: POST
path: "/fault_rules"
tags: ["Fault Rules"]
---

# Create Fault Rule

`POST /fault_rules`

## Request

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

Creates a new Fault Rule

## Request body

- object
  - `code` string, required: The diagnostic trouble code.
  - `description` string: A short description about the problem.
  - `name` string: A short name for the alert.

## Response `201`

OK

- FaultRule: A Fault Rule
  - `id` integer
  - `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
  - `code` string, required: The diagnostic trouble code.
  - `description` string, nullable, required: A short description about the problem.
  - `priority_handling` 'off' | 'ignore' | 'critical', nullable, required: The priority handling for the alert. This is configurable through the Fleetio dashboard under [Fault Rules](https://help.fleetio.com/s/article/Faults-Overview#add-rules).
  - `name` string, nullable, required: A short name for the alert.

## 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)
