> ## 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 Business Rule test fields
> Preview test fields for an unsaved Business Rule flow configuration.
Derives test fields from a flow configuration payload without requiring the rule to be saved first. Use this while building or editing a Business Rule.
## 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>
Business Rule flow configuration to inspect.
</ParamField>
## Response
<RequestExample>
~~~bash cURL theme={null}
curl --request POST \
--url 'https://api-prod.usefini.com/v2/business-rules/test-fields/preview/public' \
--header 'Authorization: Bearer fini_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"flowConfig": {
"root": "send-escalation-message",
"nodes": {
"send-escalation-message": {
"id": "send-escalation-message",
"name": "Send escalation message",
"type": "ACTION",
"subtype": "SEND_MESSAGE",
"message": "Thanks, we escalated this to a teammate."
}
}
}
}'
~~~
~~~javascript Node.js theme={null}
const response = await fetch('https://api-prod.usefini.com/v2/business-rules/test-fields/preview/public', {
method: 'POST',
headers: {
Authorization: 'Bearer fini_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'flowConfig': {
'root': 'send-escalation-message',
'nodes': {
'send-escalation-message': {
'id': 'send-escalation-message',
'name': 'Send escalation message',
'type': 'ACTION',
'subtype': 'SEND_MESSAGE',
'message': 'Thanks, we escalated this to a teammate.'
}
}
}
}
)
});
const data = await response.json();
~~~
~~~python Python theme={null}
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/business-rules/test-fields/preview/public",
headers={"Authorization": "Bearer fini_your_api_key", "Content-Type": "application/json"},
json={
"flowConfig": {
"root": "send-escalation-message",
"nodes": {
"send-escalation-message": {
"id": "send-escalation-message",
"name": "Send escalation message",
"type": "ACTION",
"subtype": "SEND_MESSAGE",
"message": "Thanks, we escalated this to a teammate."
}
}
}
},
)
data = response.json()
~~~
</RequestExample>
<ResponseExample>
~~~json 200 OK theme={null}
[
{
"path": "interactionHistoryTranscript",
"dataType": "string",
"testValue": "User: Hi, I need help with my account"
},
{
"path": "formattedUserAttributes",
"dataType": "string",
"testValue": "Plan: Premium"
}
]
~~~
</ResponseExample>
Returns an array of test field definitions.
## Errors
<AccordionGroup>
<Accordion title="400 Bad Request" icon="circle-exclamation">
The body is malformed or `flowConfig` is not a valid Business Rule tree.
</Accordion>
<Accordion title="401 Unauthorized" icon="lock">
The API key is missing, malformed, revoked, or invalid.
</Accordion>
<Accordion title="403 Forbidden" icon="shield-halved">
The API key does not include the `read` scope required for this route.
</Accordion>
</AccordionGroup>
## Related topics
- [Overview](/en/api-reference/business-rules.md)
- [Preview rule test paths](/en/api-reference/preview-rule-test-paths.md)
- [Get Business Rule test fields](/en/api-reference/get-business-rule-test-fields.md)
This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.
Business Rules

