curl --request POST \
--url 'https://api-prod.usefini.com/v2/test-suite/criteria/public' \
--header 'Authorization: Bearer fini_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {
"left": {
"path": "escalated",
"dataType": "boolean"
},
"operator": "==",
"right": {
"value": false
}
}
},
"blocking": true
}'
const body = {
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {
"left": {
"path": "escalated",
"dataType": "boolean"
},
"operator": "==",
"right": {
"value": false
}
}
},
"blocking": true
};
const response = await fetch("https://api-prod.usefini.com/v2/test-suite/criteria/public", {
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
import requests
import json
body = json.loads('''
{
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {
"left": {
"path": "escalated",
"dataType": "boolean"
},
"operator": "==",
"right": {
"value": false
}
}
},
"blocking": true
}
''')
response = requests.request(
"POST",
"https://api-prod.usefini.com/v2/test-suite/criteria/public",
headers={"Authorization": "Bearer fini_your_api_key"},
json=body,
)
response.raise_for_status()
result = response.json()
{
"id": "00000000-0000-4000-8000-000000000012",
"companyId": "00000000-0000-4000-8000-000000000011",
"defaultCriterionId": null,
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {"left": {"path": "escalated", "dataType": "boolean"}, "operator": "==", "right": {"value": false}}
},
"blocking": true,
"judgePrompt": null,
"passPrompt": null,
"failPrompt": null,
"isActive": true,
"createdAt": "2026-10-12T10:00:00.000Z",
"updatedAt": "2026-10-12T10:00:00.000Z"
}
Test Suite
Create library criterion
Save a new custom criterion to the workspace library.
POST
/
v2
/
test-suite
/
criteria
/
public
curl --request POST \
--url 'https://api-prod.usefini.com/v2/test-suite/criteria/public' \
--header 'Authorization: Bearer fini_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {
"left": {
"path": "escalated",
"dataType": "boolean"
},
"operator": "==",
"right": {
"value": false
}
}
},
"blocking": true
}'
const body = {
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {
"left": {
"path": "escalated",
"dataType": "boolean"
},
"operator": "==",
"right": {
"value": false
}
}
},
"blocking": true
};
const response = await fetch("https://api-prod.usefini.com/v2/test-suite/criteria/public", {
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
import requests
import json
body = json.loads('''
{
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {
"left": {
"path": "escalated",
"dataType": "boolean"
},
"operator": "==",
"right": {
"value": false
}
}
},
"blocking": true
}
''')
response = requests.request(
"POST",
"https://api-prod.usefini.com/v2/test-suite/criteria/public",
headers={"Authorization": "Bearer fini_your_api_key"},
json=body,
)
response.raise_for_status()
result = response.json()
{
"id": "00000000-0000-4000-8000-000000000012",
"companyId": "00000000-0000-4000-8000-000000000011",
"defaultCriterionId": null,
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {"left": {"path": "escalated", "dataType": "boolean"}, "operator": "==", "right": {"value": false}}
},
"blocking": true,
"judgePrompt": null,
"passPrompt": null,
"failPrompt": null,
"isActive": true,
"createdAt": "2026-10-12T10:00:00.000Z",
"updatedAt": "2026-10-12T10:00:00.000Z"
}
Save a new custom criterion to the workspace library.
This route does not accept
defaultCriterionId. For type-specific validation and condition shape, see Criterion definitions.
Headers
string
required
Bearer token containing your workspace API key. The key needs
write scope.Body parameters
string
required
Nonblank criterion name.
enum
required
deterministic, basic_judge or complex_judge.object
Required for deterministic criteria. Must be absent or null for judge criteria.
string
Required nonblank judge instructions for either judge type.
string
Required nonblank pass definition for either judge type.
string
Required nonblank fail definition for either judge type.
boolean
Whether failure makes the case fail. Defaults to true for new custom criteria.
Response
Returns the saved criterion definition.curl --request POST \
--url 'https://api-prod.usefini.com/v2/test-suite/criteria/public' \
--header 'Authorization: Bearer fini_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {
"left": {
"path": "escalated",
"dataType": "boolean"
},
"operator": "==",
"right": {
"value": false
}
}
},
"blocking": true
}'
const body = {
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {
"left": {
"path": "escalated",
"dataType": "boolean"
},
"operator": "==",
"right": {
"value": false
}
}
},
"blocking": true
};
const response = await fetch("https://api-prod.usefini.com/v2/test-suite/criteria/public", {
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
import requests
import json
body = json.loads('''
{
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {
"left": {
"path": "escalated",
"dataType": "boolean"
},
"operator": "==",
"right": {
"value": false
}
}
},
"blocking": true
}
''')
response = requests.request(
"POST",
"https://api-prod.usefini.com/v2/test-suite/criteria/public",
headers={"Authorization": "Bearer fini_your_api_key"},
json=body,
)
response.raise_for_status()
result = response.json()
{
"id": "00000000-0000-4000-8000-000000000012",
"companyId": "00000000-0000-4000-8000-000000000011",
"defaultCriterionId": null,
"name": "No handoff",
"type": "deterministic",
"condition": {
"scope": "SCALAR",
"predicate": {"left": {"path": "escalated", "dataType": "boolean"}, "operator": "==", "right": {"value": false}}
},
"blocking": true,
"judgePrompt": null,
"passPrompt": null,
"failPrompt": null,
"isActive": true,
"createdAt": "2026-10-12T10:00:00.000Z",
"updatedAt": "2026-10-12T10:00:00.000Z"
}
Was this page helpful?

