Skip to main content
POST
Generate intent-rule draft with AI
Generates intent-rule draft content from natural-language instructions and the workspace’s current fields context. The LLM returns a draft name, description, and rule tree.
This endpoint supports intent rules only. It generates against the intent-rule fields context.
The generated draft is not saved automatically. Persist the returned content with Create intent rule or Update intent rule, using status: "DRAFT".

Headers

string
required
Bearer token containing your Fini workspace API key. Format: Bearer fini_... The key needs write scope.
string
required
application/json

Body parameters

string
required
Natural-language instructions describing the rule to create or the changes to make. The value cannot be empty.
string
Current rule name. Used as context when refining currentFlowConfig.
string
Current rule description. Used as context when refining currentFlowConfig.
RuleNodeConfig
Existing rule tree to refine. Omit it to generate a new draft from scratch.

Response

object
Generated draft content with name, description, and flowConfig.

Errors

instructions is empty, or currentFlowConfig is invalid.
The API key is missing, malformed, revoked, or invalid.
The API key does not include the write scope required for this route.
Fini could not generate the draft content.