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."
}
}
}
}'
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();
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()
[
{
"path": "interactionHistoryTranscript",
"dataType": "string",
"testValue": "User: Hi, I need help with my account"
},
{
"path": "formattedUserAttributes",
"dataType": "string",
"testValue": "Plan: Premium"
}
]
Business Rules
Preview Business Rule test fields
Preview test fields for an unsaved Business Rule flow configuration.
POST
/
v2
/
business-rules
/
test-fields
/
preview
/
public
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."
}
}
}
}'
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();
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()
[
{
"path": "interactionHistoryTranscript",
"dataType": "string",
"testValue": "User: Hi, I need help with my account"
},
{
"path": "formattedUserAttributes",
"dataType": "string",
"testValue": "Plan: Premium"
}
]
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.
Returns an array of test field definitions.
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
Business Rule flow configuration to inspect.
Response
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."
}
}
}
}'
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();
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()
[
{
"path": "interactionHistoryTranscript",
"dataType": "string",
"testValue": "User: Hi, I need help with my account"
},
{
"path": "formattedUserAttributes",
"dataType": "string",
"testValue": "Plan: Premium"
}
]
Errors
400 Bad Request
400 Bad Request
The body is malformed or
flowConfig is not a valid Business Rule tree.401 Unauthorized
401 Unauthorized
The API key is missing, malformed, revoked, or invalid.
403 Forbidden
403 Forbidden
The API key does not include the
read scope required for this route.Was this page helpful?

