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

# Create Business Rule

> Create a custom or template-based Business Rule.

Creates a Business Rule. Business Rules are stored directly and do not have a draft lifecycle.

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token containing your Fini workspace API key. Format: `Bearer fini_...` The key needs `write` scope.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Body parameters

<ParamField body="name" type="string" required>
  Rule name.
</ParamField>

<ParamField body="description" type="string" required>
  Description of the escalation workflow.
</ParamField>

<ParamField body="type" type="string" required>
  Send `business`.
</ParamField>

<ParamField body="source" type="string">
  Business Rule source. The current enum value is `widget`.
</ParamField>

<ParamField body="triggerType" type="string">
  Business Rule trigger. The current enum value is `on_escalation`.
</ParamField>

<ParamField body="flowConfig" type="RuleNodeConfig">
  Required for a custom Business Rule. Do not send it for a template-based rule.
</ParamField>

<ParamField body="defaultRuleId" type="string">
  Template ID from [List default Business Rules](/en/api-reference/list-default-rules). A template-based rule cannot also define `flowConfig`.
</ParamField>

<ParamField body="inputSchema" type="InputSchemaField[]">
  Runtime bindings for Business Rule inputs, including template inputs.
</ParamField>

<ParamField body="botIds" type="string[]">
  Agent IDs to assign after creation.
</ParamField>

## Response

Returns the created [`Rule`](/en/api-reference/rules#rule-object).

## Errors

<AccordionGroup>
  <Accordion title="400 Bad Request" icon="circle-exclamation">
    The body is malformed, a custom rule has no `flowConfig`, a template is invalid, a template-based rule also defines `flowConfig`, or a referenced agent, action, or widget form is invalid.
  </Accordion>

  <Accordion title="401 Unauthorized" icon="lock">
    The API key is missing, malformed, revoked, or invalid.
  </Accordion>

  <Accordion title="403 Forbidden" icon="shield-halved">
    The API key does not include the `write` scope required for this route.
  </Accordion>
</AccordionGroup>
