> ## 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.
# Preview rule test paths
> Generate deterministic test paths for an unsaved Rulebook flow configuration.
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
<ParamField header="Authorization" type="string" required>
Bearer token containing your Fini workspace API key. Format: `Bearer fini_...`
The key needs `read` scope.
</ParamField>
<ParamField header="Content-Type" type="string" required>
`application/json`
</ParamField>
## Body parameters
<ParamField body="flowConfig" type="object" required>
Rulebook flow configuration to inspect.
</ParamField>
## Response
Returns an array of rule test path objects.
<RequestExample>
~~~bash cURL theme={null}
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."
}
}
}
}'
~~~
~~~javascript Node.js theme={null}
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();
~~~
~~~python Python theme={null}
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()
~~~
</RequestExample>
<ResponseExample>
~~~json 200 OK theme={null}
[
{
"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."]
}
]
~~~
</ResponseExample>
## Related topics
- [Run rule test path from config](/en/api-reference/run-rule-test-path-config.md)
- [Preview Business Rule test fields](/en/api-reference/preview-business-rule-test-fields.md)
- [Get rule version test paths](/en/api-reference/get-rule-version-test-paths.md)
This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.
Intent Rules

