curl --request POST \ --url 'https://api-prod.usefini.com/v2/hc-rules/generate/public' \ --header 'Authorization: Bearer fini_your_api_key' \ --header 'Content-Type: application/json' \ --data '{ "instructions": "Create a draft rule that escalates refund requests with order context.", "name": "Refund policy", "description": "Refund-policy conversations to re-check before prompt changes.", "currentFlowConfig": { "type": "reply", "message": "Escalate refund requests with order context." }}'
const response = await fetch('https://api-prod.usefini.com/v2/hc-rules/generate/public', { method: 'POST', headers: { Authorization: 'Bearer fini_your_api_key', 'Content-Type': 'application/json' }, body: JSON.stringify({ 'instructions': 'Create a draft rule that escalates refund requests with order context.', 'name': 'Refund policy', 'description': 'Refund-policy conversations to re-check before prompt changes.', 'currentFlowConfig': { 'type': 'reply', 'message': 'Escalate refund requests with order context.' }} )});const data = await response.json();
import requestsresponse = requests.post( "https://api-prod.usefini.com/v2/hc-rules/generate/public", headers={"Authorization": "Bearer fini_your_api_key", "Content-Type": "application/json"}, json={ "instructions": "Create a draft rule that escalates refund requests with order context.", "name": "Refund policy", "description": "Refund-policy conversations to re-check before prompt changes.", "currentFlowConfig": { "type": "reply", "message": "Escalate refund requests with order context." }},)data = response.json()
{ "name": "Refund escalation", "description": "Escalate refund requests with order context.", "flowConfig": { "type": "reply", "message": "Escalate refund requests with order context." }}
Intent Rules
Generate intent-rule draft with AI
Generate or refine intent-rule draft content with natural-language instructions and an LLM.
POST
/
v2
/
hc-rules
/
generate
/
public
curl --request POST \ --url 'https://api-prod.usefini.com/v2/hc-rules/generate/public' \ --header 'Authorization: Bearer fini_your_api_key' \ --header 'Content-Type: application/json' \ --data '{ "instructions": "Create a draft rule that escalates refund requests with order context.", "name": "Refund policy", "description": "Refund-policy conversations to re-check before prompt changes.", "currentFlowConfig": { "type": "reply", "message": "Escalate refund requests with order context." }}'
const response = await fetch('https://api-prod.usefini.com/v2/hc-rules/generate/public', { method: 'POST', headers: { Authorization: 'Bearer fini_your_api_key', 'Content-Type': 'application/json' }, body: JSON.stringify({ 'instructions': 'Create a draft rule that escalates refund requests with order context.', 'name': 'Refund policy', 'description': 'Refund-policy conversations to re-check before prompt changes.', 'currentFlowConfig': { 'type': 'reply', 'message': 'Escalate refund requests with order context.' }} )});const data = await response.json();
import requestsresponse = requests.post( "https://api-prod.usefini.com/v2/hc-rules/generate/public", headers={"Authorization": "Bearer fini_your_api_key", "Content-Type": "application/json"}, json={ "instructions": "Create a draft rule that escalates refund requests with order context.", "name": "Refund policy", "description": "Refund-policy conversations to re-check before prompt changes.", "currentFlowConfig": { "type": "reply", "message": "Escalate refund requests with order context." }},)data = response.json()
{ "name": "Refund escalation", "description": "Escalate refund requests with order context.", "flowConfig": { "type": "reply", "message": "Escalate refund requests with order context." }}
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".