> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usefini.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Business Rules

> Create and manage widget-escalation Business Rules through the public API.

Business Rules are the workflows configured under [Automations → Business Rules](/en/automations/business-rules). Send `type: "business"` when creating them and `type=business` when listing them.

Business Rules are not versioned. They are stored and updated directly, and currently run for `source: "widget"` with `triggerType: "on_escalation"`.

## Business-rule endpoints

### Endpoints shared with intent rules

| Method   | Path                                 | Scope   | Business-rule usage                                                      |
| -------- | ------------------------------------ | ------- | ------------------------------------------------------------------------ |
| `GET`    | `/v2/hc-rules/public`                | `read`  | List with `type=business` and optional `source=widget`.                  |
| `GET`    | `/v2/hc-rules/fields-context/public` | `read`  | Get fields with `type=business`, including Business Rule context fields. |
| `GET`    | `/v2/hc-rules/:id/public`            | `read`  | Get one Business Rule with its full tree.                                |
| `POST`   | `/v2/hc-rules/public`                | `write` | Create a custom or template-based Business Rule.                         |
| `PATCH`  | `/v2/hc-rules/:id/public`            | `write` | Update the stored rule directly.                                         |
| `DELETE` | `/v2/hc-rules/:id/public`            | `write` | Delete the rule and its agent assignments.                               |

### Business-only endpoint

| Method | Path                          | Scope  | Purpose                                     |
| ------ | ----------------------------- | ------ | ------------------------------------------- |
| `GET`  | `/v2/hc-rules/default/public` | `read` | List Fini-provided Business Rule templates. |

## Custom and template-based rules

| Mode           | Create request                                                                                                                                                                      |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Custom         | Send `type: "business"`, `source: "widget"`, `triggerType: "on_escalation"`, and a `flowConfig`.                                                                                    |
| Template-based | Send `type: "business"` and a `defaultRuleId` from [List default rules](/en/api-reference/list-default-rules). Do not send `flowConfig`. Use `inputSchema` to bind template inputs. |

<Warning>
  Business Rules cannot be drafts. Do not send `status: "DRAFT"`, and do not call draft-generation, version, publish, or restore endpoints for them.
</Warning>

## Business-rule response fields

Business Rules use the shared [`Rule`](/en/api-reference/rules#rule-object) shape. The relevant Business Rule fields are `type`, `source`, `triggerType`, `defaultRuleId`, `inputSchema`, `flowConfig`, and `botIds`. Intent-rule version fields do not apply.
