> ## 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 intent rule

> Create a draft or published Rulebook intent rule.

Creates an intent rule. Use `status: "DRAFT"` for a reviewable draft or `status: "PUBLISHED"` for a live version.

## 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>
  Natural-language routing description used by the planner.
</ParamField>

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

<ParamField body="status" type="string">
  `DRAFT` or `PUBLISHED`. Defaults to `PUBLISHED`. `ARCHIVED` is rejected.
</ParamField>

<ParamField body="flowConfig" type="RuleNodeConfig">
  Rule tree. See the shared [RuleNodeConfig](/en/api-reference/rules#rulenodeconfig-object) shape.
</ParamField>

<ParamField body="botIds" type="string[]">
  Agent IDs to assign to a published rule. Drafts cannot include agent assignments.
</ParamField>

## Response

Returns the created [`Rule`](/en/api-reference/rules#rule-object). Draft responses have `botIds: []`.

## Errors

<AccordionGroup>
  <Accordion title="400 Bad Request" icon="circle-exclamation">
    The body is malformed, a draft includes agent assignments, an agent ID is invalid, or `flowConfig` references a missing action or widget form.
  </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>
