curl --request POST \
--url 'https://api-prod.usefini.com/v2/business-rules/public' \
--header 'Authorization: Bearer fini_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"name": "Refund policy",
"description": "Refund-policy conversations to re-check before prompt changes.",
"source": "widget",
"triggerType": "on_escalation",
"inputSchema": [
{
"name": "Conversation URL",
"dataType": "string",
"path": "conversationUrl",
"required": true
}
],
"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."
}
}
},
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
]
}'
const response = await fetch('https://api-prod.usefini.com/v2/business-rules/public', {
method: 'POST',
headers: {
Authorization: 'Bearer fini_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'name': 'Refund policy',
'description': 'Refund-policy conversations to re-check before prompt changes.',
'source': 'widget',
'triggerType': 'on_escalation',
'inputSchema': [
{
'name': 'Conversation URL',
'dataType': 'string',
'path': 'conversationUrl',
'required': true
}
],
'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.'
}
}
},
'botIds': [
'2a1cf0f0-f35d-46ad-8e61-a15c86b2b312'
]
}
)
});
const data = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/business-rules/public",
headers={"Authorization": "Bearer fini_your_api_key", "Content-Type": "application/json"},
json={
"name": "Refund policy",
"description": "Refund-policy conversations to re-check before prompt changes.",
"source": "widget",
"triggerType": "on_escalation",
"inputSchema": [
{
"name": "Conversation URL",
"dataType": "string",
"path": "conversationUrl",
"required": true
}
],
"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."
}
}
},
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
]
},
)
data = response.json()
{
"id": "b8b8d87b-2f0c-47f6-8a8a-546da73e0820",
"name": "Refund escalation",
"description": "Route refund requests to the right workflow.",
"type": "business",
"isDraft": false,
"status": "PUBLISHED",
"source": "widget",
"triggerType": "on_escalation",
"defaultBusinessRuleId": null,
"defaultRuleId": null,
"inputSchema": [
{
"name": "Conversation URL",
"dataType": "string",
"path": "conversationUrl",
"required": true
}
],
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
],
"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."
}
}
},
"createdAt": "2026-07-28T08:55:32.000Z",
"updatedAt": "2026-07-28T09:10:18.000Z"
}
Business Rules
Create Business Rule
Create a custom or template-based Business Rule.
POST
/
v2
/
business-rules
/
public
curl --request POST \
--url 'https://api-prod.usefini.com/v2/business-rules/public' \
--header 'Authorization: Bearer fini_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"name": "Refund policy",
"description": "Refund-policy conversations to re-check before prompt changes.",
"source": "widget",
"triggerType": "on_escalation",
"inputSchema": [
{
"name": "Conversation URL",
"dataType": "string",
"path": "conversationUrl",
"required": true
}
],
"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."
}
}
},
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
]
}'
const response = await fetch('https://api-prod.usefini.com/v2/business-rules/public', {
method: 'POST',
headers: {
Authorization: 'Bearer fini_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'name': 'Refund policy',
'description': 'Refund-policy conversations to re-check before prompt changes.',
'source': 'widget',
'triggerType': 'on_escalation',
'inputSchema': [
{
'name': 'Conversation URL',
'dataType': 'string',
'path': 'conversationUrl',
'required': true
}
],
'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.'
}
}
},
'botIds': [
'2a1cf0f0-f35d-46ad-8e61-a15c86b2b312'
]
}
)
});
const data = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/business-rules/public",
headers={"Authorization": "Bearer fini_your_api_key", "Content-Type": "application/json"},
json={
"name": "Refund policy",
"description": "Refund-policy conversations to re-check before prompt changes.",
"source": "widget",
"triggerType": "on_escalation",
"inputSchema": [
{
"name": "Conversation URL",
"dataType": "string",
"path": "conversationUrl",
"required": true
}
],
"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."
}
}
},
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
]
},
)
data = response.json()
{
"id": "b8b8d87b-2f0c-47f6-8a8a-546da73e0820",
"name": "Refund escalation",
"description": "Route refund requests to the right workflow.",
"type": "business",
"isDraft": false,
"status": "PUBLISHED",
"source": "widget",
"triggerType": "on_escalation",
"defaultBusinessRuleId": null,
"defaultRuleId": null,
"inputSchema": [
{
"name": "Conversation URL",
"dataType": "string",
"path": "conversationUrl",
"required": true
}
],
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
],
"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."
}
}
},
"createdAt": "2026-07-28T08:55:32.000Z",
"updatedAt": "2026-07-28T09:10:18.000Z"
}
Creates a Business Rule. Business Rules are stored directly and do not have a draft lifecycle.
Headers
string
required
Bearer token containing your Fini workspace API key. Format:
Bearer fini_... The key needs write scope.string
required
application/jsonBody parameters
string
required
Rule name.
string
required
Description of the escalation workflow.
string
Business Rule source. The current enum value is
widget.string
Business Rule trigger. The current enum value is
on_escalation.RuleNodeConfig
Required for a custom Business Rule. Do not send it for a template-based rule.
string
Template ID from List default Business Rules. A template-based rule cannot also define
flowConfig.string
Alias for
defaultRuleId. Use one of the two fields when creating a template-based rule.InputSchemaField[]
Runtime bindings for Business Rule inputs, including template inputs.
string[]
Agent IDs to assign after creation.
Response
Returns the created Business Rule.curl --request POST \
--url 'https://api-prod.usefini.com/v2/business-rules/public' \
--header 'Authorization: Bearer fini_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"name": "Refund policy",
"description": "Refund-policy conversations to re-check before prompt changes.",
"source": "widget",
"triggerType": "on_escalation",
"inputSchema": [
{
"name": "Conversation URL",
"dataType": "string",
"path": "conversationUrl",
"required": true
}
],
"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."
}
}
},
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
]
}'
const response = await fetch('https://api-prod.usefini.com/v2/business-rules/public', {
method: 'POST',
headers: {
Authorization: 'Bearer fini_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'name': 'Refund policy',
'description': 'Refund-policy conversations to re-check before prompt changes.',
'source': 'widget',
'triggerType': 'on_escalation',
'inputSchema': [
{
'name': 'Conversation URL',
'dataType': 'string',
'path': 'conversationUrl',
'required': true
}
],
'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.'
}
}
},
'botIds': [
'2a1cf0f0-f35d-46ad-8e61-a15c86b2b312'
]
}
)
});
const data = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/business-rules/public",
headers={"Authorization": "Bearer fini_your_api_key", "Content-Type": "application/json"},
json={
"name": "Refund policy",
"description": "Refund-policy conversations to re-check before prompt changes.",
"source": "widget",
"triggerType": "on_escalation",
"inputSchema": [
{
"name": "Conversation URL",
"dataType": "string",
"path": "conversationUrl",
"required": true
}
],
"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."
}
}
},
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
]
},
)
data = response.json()
{
"id": "b8b8d87b-2f0c-47f6-8a8a-546da73e0820",
"name": "Refund escalation",
"description": "Route refund requests to the right workflow.",
"type": "business",
"isDraft": false,
"status": "PUBLISHED",
"source": "widget",
"triggerType": "on_escalation",
"defaultBusinessRuleId": null,
"defaultRuleId": null,
"inputSchema": [
{
"name": "Conversation URL",
"dataType": "string",
"path": "conversationUrl",
"required": true
}
],
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
],
"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."
}
}
},
"createdAt": "2026-07-28T08:55:32.000Z",
"updatedAt": "2026-07-28T09:10:18.000Z"
}
Errors
400 Bad Request
400 Bad Request
The body is malformed, a custom rule has no
flowConfig, a template is invalid, a template-based rule also defines flowConfig, or a referenced agent, action, or widget form is invalid.401 Unauthorized
401 Unauthorized
The API key is missing, malformed, revoked, or invalid.
403 Forbidden
403 Forbidden
The API key does not include the
write scope required for this route.Was this page helpful?

