curl --request POST \
--url 'https://api-prod.usefini.com/v2/hc-rules/test-paths/config/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."
}
}
}
}'
const response = await fetch(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/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.",
},
},
},
}),
}
);
const testPaths = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/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.",
},
},
}
},
)
test_paths = response.json()
[
{
"id": "refund-escalation",
"title": "Refund escalation",
"summary": "Refund requests reach the escalation reply node.",
"outcome": "reply",
"group": {
"id": "refunds",
"title": "Refund paths",
"summary": "Paths that handle refund requests.",
"pathCount": 1,
"nodeIds": ["root", "reply_escalate"]
},
"testContext": {
"inputContext": {
"message": {
"text": "I need a refund for my order."
}
},
"runtimeContext": {
"source": "zendesk",
"channel": "email"
},
"notes": ["Use a refund-related user message."]
},
"terminalNodeId": "reply_escalate",
"terminalNodeName": "Escalate refund",
"nodeIds": ["root", "reply_escalate"],
"steps": [
{
"nodeId": "root",
"nodeName": "Refund workflow",
"kind": "seq",
"label": "Start refund workflow",
"engineType": "SEQUENCE"
},
{
"nodeId": "reply_escalate",
"nodeName": "Escalate refund",
"kind": "reply",
"label": "Send escalation reply",
"engineType": "ACTION",
"engineSubType": "SEND_MESSAGE"
}
],
"requirements": ["Message should describe a refund request."],
"warnings": ["Path was generated from an unsaved config; save the rule before testing a version."]
}
]
Intent Rules
Preview rule test paths
Generate deterministic test paths for an unsaved Rulebook flow configuration.
POST
/
v2
/
hc-rules
/
test-paths
/
config
/
public
curl --request POST \
--url 'https://api-prod.usefini.com/v2/hc-rules/test-paths/config/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."
}
}
}
}'
const response = await fetch(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/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.",
},
},
},
}),
}
);
const testPaths = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/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.",
},
},
}
},
)
test_paths = response.json()
[
{
"id": "refund-escalation",
"title": "Refund escalation",
"summary": "Refund requests reach the escalation reply node.",
"outcome": "reply",
"group": {
"id": "refunds",
"title": "Refund paths",
"summary": "Paths that handle refund requests.",
"pathCount": 1,
"nodeIds": ["root", "reply_escalate"]
},
"testContext": {
"inputContext": {
"message": {
"text": "I need a refund for my order."
}
},
"runtimeContext": {
"source": "zendesk",
"channel": "email"
},
"notes": ["Use a refund-related user message."]
},
"terminalNodeId": "reply_escalate",
"terminalNodeName": "Escalate refund",
"nodeIds": ["root", "reply_escalate"],
"steps": [
{
"nodeId": "root",
"nodeName": "Refund workflow",
"kind": "seq",
"label": "Start refund workflow",
"engineType": "SEQUENCE"
},
{
"nodeId": "reply_escalate",
"nodeName": "Escalate refund",
"kind": "reply",
"label": "Send escalation reply",
"engineType": "ACTION",
"engineSubType": "SEND_MESSAGE"
}
],
"requirements": ["Message should describe a refund request."],
"warnings": ["Path was generated from an unsaved config; save the rule before testing a version."]
}
]
Returns the branch paths Fini can derive from a
flowConfig payload without
requiring the rule to be saved first. Use this while building or editing a
Rulebook draft.
Headers
string
required
Bearer token containing your Fini workspace API key. Format:
Bearer fini_...
The key needs read scope.string
required
application/jsonBody parameters
object
required
Rulebook flow configuration to inspect.
Response
Returns an array of rule test path objects.curl --request POST \
--url 'https://api-prod.usefini.com/v2/hc-rules/test-paths/config/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."
}
}
}
}'
const response = await fetch(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/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.",
},
},
},
}),
}
);
const testPaths = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/hc-rules/test-paths/config/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.",
},
},
}
},
)
test_paths = response.json()
[
{
"id": "refund-escalation",
"title": "Refund escalation",
"summary": "Refund requests reach the escalation reply node.",
"outcome": "reply",
"group": {
"id": "refunds",
"title": "Refund paths",
"summary": "Paths that handle refund requests.",
"pathCount": 1,
"nodeIds": ["root", "reply_escalate"]
},
"testContext": {
"inputContext": {
"message": {
"text": "I need a refund for my order."
}
},
"runtimeContext": {
"source": "zendesk",
"channel": "email"
},
"notes": ["Use a refund-related user message."]
},
"terminalNodeId": "reply_escalate",
"terminalNodeName": "Escalate refund",
"nodeIds": ["root", "reply_escalate"],
"steps": [
{
"nodeId": "root",
"nodeName": "Refund workflow",
"kind": "seq",
"label": "Start refund workflow",
"engineType": "SEQUENCE"
},
{
"nodeId": "reply_escalate",
"nodeName": "Escalate refund",
"kind": "reply",
"label": "Send escalation reply",
"engineType": "ACTION",
"engineSubType": "SEND_MESSAGE"
}
],
"requirements": ["Message should describe a refund request."],
"warnings": ["Path was generated from an unsaved config; save the rule before testing a version."]
}
]
Was this page helpful?

