curl --request POST \
--url 'https://api-prod.usefini.com/v2/hc-rules/test-paths/config/run/public' \
--header 'Authorization: Bearer fini_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"flowConfig": {
"root": "root",
"nodes": {
"root": {
"id": "root",
"name": "Refund workflow",
"type": "SEQUENCE",
"children": ["reply_escalate"]
},
"reply_escalate": {
"id": "reply_escalate",
"name": "Escalate refund",
"type": "ACTION",
"subType": "SEND_MESSAGE",
"message": "Escalate refund request with order context."
}
}
},
"pathId": "refund-escalation",
"expectedTerminalNodeId": "reply_escalate",
"inputContext": {
"message": {
"text": "I need a refund for my order."
}
},
"runtimeContext": {
"source": "zendesk",
"channel": "email"
},
"mockTextExtraction": true
}'
const response = await fetch(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/run/public",
{
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
flowConfig: {
root: "root",
nodes: {
root: {
id: "root",
name: "Refund workflow",
type: "SEQUENCE",
children: ["reply_escalate"],
},
reply_escalate: {
id: "reply_escalate",
name: "Escalate refund",
type: "ACTION",
subType: "SEND_MESSAGE",
message: "Escalate refund request with order context.",
},
},
},
pathId: "refund-escalation",
expectedTerminalNodeId: "reply_escalate",
inputContext: {
message: { text: "I need a refund for my order." },
},
runtimeContext: {
source: "zendesk",
channel: "email",
},
mockTextExtraction: true,
}),
}
);
const result = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/run/public",
headers={
"Authorization": "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
json={
"flowConfig": {
"root": "root",
"nodes": {
"root": {
"id": "root",
"name": "Refund workflow",
"type": "SEQUENCE",
"children": ["reply_escalate"],
},
"reply_escalate": {
"id": "reply_escalate",
"name": "Escalate refund",
"type": "ACTION",
"subType": "SEND_MESSAGE",
"message": "Escalate refund request with order context.",
},
},
},
"pathId": "refund-escalation",
"expectedTerminalNodeId": "reply_escalate",
"inputContext": {
"message": {"text": "I need a refund for my order."},
},
"runtimeContext": {"source": "zendesk", "channel": "email"},
"mockTextExtraction": True,
},
)
result = response.json()
{
"results": [
{
"id": "root",
"name": "Refund workflow",
"type": "SEQUENCE",
"success": true
},
{
"id": "reply_escalate",
"name": "Escalate refund",
"type": "ACTION",
"subType": "SEND_MESSAGE",
"success": true,
"terminate": true,
"result": {
"message": "Escalate refund request with order context."
}
}
],
"testContext": {
"inputContext": {
"message": {
"text": "I need a refund for my order."
}
},
"runtimeContext": {
"source": "zendesk",
"channel": "email"
},
"notes": ["Use a refund-related user message."]
},
"expectedTerminalNodeId": "reply_escalate",
"actualTerminalNodeId": "reply_escalate",
"matchedExpectedPath": true,
"message": "Matched expected terminal node reply_escalate."
}
Intent Rules
Run rule test path from config
Run one test path against an unsaved Rulebook flow configuration.
POST
/
v2
/
hc-rules
/
test-paths
/
config
/
run
/
public
curl --request POST \
--url 'https://api-prod.usefini.com/v2/hc-rules/test-paths/config/run/public' \
--header 'Authorization: Bearer fini_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"flowConfig": {
"root": "root",
"nodes": {
"root": {
"id": "root",
"name": "Refund workflow",
"type": "SEQUENCE",
"children": ["reply_escalate"]
},
"reply_escalate": {
"id": "reply_escalate",
"name": "Escalate refund",
"type": "ACTION",
"subType": "SEND_MESSAGE",
"message": "Escalate refund request with order context."
}
}
},
"pathId": "refund-escalation",
"expectedTerminalNodeId": "reply_escalate",
"inputContext": {
"message": {
"text": "I need a refund for my order."
}
},
"runtimeContext": {
"source": "zendesk",
"channel": "email"
},
"mockTextExtraction": true
}'
const response = await fetch(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/run/public",
{
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
flowConfig: {
root: "root",
nodes: {
root: {
id: "root",
name: "Refund workflow",
type: "SEQUENCE",
children: ["reply_escalate"],
},
reply_escalate: {
id: "reply_escalate",
name: "Escalate refund",
type: "ACTION",
subType: "SEND_MESSAGE",
message: "Escalate refund request with order context.",
},
},
},
pathId: "refund-escalation",
expectedTerminalNodeId: "reply_escalate",
inputContext: {
message: { text: "I need a refund for my order." },
},
runtimeContext: {
source: "zendesk",
channel: "email",
},
mockTextExtraction: true,
}),
}
);
const result = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/run/public",
headers={
"Authorization": "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
json={
"flowConfig": {
"root": "root",
"nodes": {
"root": {
"id": "root",
"name": "Refund workflow",
"type": "SEQUENCE",
"children": ["reply_escalate"],
},
"reply_escalate": {
"id": "reply_escalate",
"name": "Escalate refund",
"type": "ACTION",
"subType": "SEND_MESSAGE",
"message": "Escalate refund request with order context.",
},
},
},
"pathId": "refund-escalation",
"expectedTerminalNodeId": "reply_escalate",
"inputContext": {
"message": {"text": "I need a refund for my order."},
},
"runtimeContext": {"source": "zendesk", "channel": "email"},
"mockTextExtraction": True,
},
)
result = response.json()
{
"results": [
{
"id": "root",
"name": "Refund workflow",
"type": "SEQUENCE",
"success": true
},
{
"id": "reply_escalate",
"name": "Escalate refund",
"type": "ACTION",
"subType": "SEND_MESSAGE",
"success": true,
"terminate": true,
"result": {
"message": "Escalate refund request with order context."
}
}
],
"testContext": {
"inputContext": {
"message": {
"text": "I need a refund for my order."
}
},
"runtimeContext": {
"source": "zendesk",
"channel": "email"
},
"notes": ["Use a refund-related user message."]
},
"expectedTerminalNodeId": "reply_escalate",
"actualTerminalNodeId": "reply_escalate",
"matchedExpectedPath": true,
"message": "Matched expected terminal node reply_escalate."
}
Runs a simulated Rulebook evaluation directly from a
flowConfig payload. Use
this for draft builders, preview tools, or CI checks that need to test an
unsaved rule tree.
Headers
Bearer token containing your Fini workspace API key. Format:
Bearer fini_...
The key needs read scope.Body parameters
Optional simulated conversation history. Each item can include
role, type,
content, event_id, and metadata.content.Response
Returns a rule test path run result.curl --request POST \
--url 'https://api-prod.usefini.com/v2/hc-rules/test-paths/config/run/public' \
--header 'Authorization: Bearer fini_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"flowConfig": {
"root": "root",
"nodes": {
"root": {
"id": "root",
"name": "Refund workflow",
"type": "SEQUENCE",
"children": ["reply_escalate"]
},
"reply_escalate": {
"id": "reply_escalate",
"name": "Escalate refund",
"type": "ACTION",
"subType": "SEND_MESSAGE",
"message": "Escalate refund request with order context."
}
}
},
"pathId": "refund-escalation",
"expectedTerminalNodeId": "reply_escalate",
"inputContext": {
"message": {
"text": "I need a refund for my order."
}
},
"runtimeContext": {
"source": "zendesk",
"channel": "email"
},
"mockTextExtraction": true
}'
const response = await fetch(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/run/public",
{
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
flowConfig: {
root: "root",
nodes: {
root: {
id: "root",
name: "Refund workflow",
type: "SEQUENCE",
children: ["reply_escalate"],
},
reply_escalate: {
id: "reply_escalate",
name: "Escalate refund",
type: "ACTION",
subType: "SEND_MESSAGE",
message: "Escalate refund request with order context.",
},
},
},
pathId: "refund-escalation",
expectedTerminalNodeId: "reply_escalate",
inputContext: {
message: { text: "I need a refund for my order." },
},
runtimeContext: {
source: "zendesk",
channel: "email",
},
mockTextExtraction: true,
}),
}
);
const result = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/run/public",
headers={
"Authorization": "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
json={
"flowConfig": {
"root": "root",
"nodes": {
"root": {
"id": "root",
"name": "Refund workflow",
"type": "SEQUENCE",
"children": ["reply_escalate"],
},
"reply_escalate": {
"id": "reply_escalate",
"name": "Escalate refund",
"type": "ACTION",
"subType": "SEND_MESSAGE",
"message": "Escalate refund request with order context.",
},
},
},
"pathId": "refund-escalation",
"expectedTerminalNodeId": "reply_escalate",
"inputContext": {
"message": {"text": "I need a refund for my order."},
},
"runtimeContext": {"source": "zendesk", "channel": "email"},
"mockTextExtraction": True,
},
)
result = response.json()
{
"results": [
{
"id": "root",
"name": "Refund workflow",
"type": "SEQUENCE",
"success": true
},
{
"id": "reply_escalate",
"name": "Escalate refund",
"type": "ACTION",
"subType": "SEND_MESSAGE",
"success": true,
"terminate": true,
"result": {
"message": "Escalate refund request with order context."
}
}
],
"testContext": {
"inputContext": {
"message": {
"text": "I need a refund for my order."
}
},
"runtimeContext": {
"source": "zendesk",
"channel": "email"
},
"notes": ["Use a refund-related user message."]
},
"expectedTerminalNodeId": "reply_escalate",
"actualTerminalNodeId": "reply_escalate",
"matchedExpectedPath": true,
"message": "Matched expected terminal node reply_escalate."
}
Was this page helpful?

