curl --request POST \
--url https://app.sahlfinancial.com/api/v1/partner/scoring/what-if \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "client-0001",
"inputs": {
"requested_amount": 150000,
"duration_months": 60,
"annual_rate_pct": 6.5
},
"approve_threshold": 650,
"refuse_threshold": 400
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference: 'client-0001',
inputs: {requested_amount: 150000, duration_months: 60, annual_rate_pct: 6.5},
approve_threshold: 650,
refuse_threshold: 400
})
};
fetch('https://app.sahlfinancial.com/api/v1/partner/scoring/what-if', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.sahlfinancial.com/api/v1/partner/scoring/what-if"
payload = {
"reference": "client-0001",
"inputs": {
"requested_amount": 150000,
"duration_months": 60,
"annual_rate_pct": 6.5
},
"approve_threshold": 650,
"refuse_threshold": 400
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"current": {
"score": 123,
"risk_level": "<string>",
"decision": "<string>"
},
"hypothetical": {
"reference": "<string>",
"case_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment": "sandbox",
"scored": true,
"subject_kind": "individual",
"model": "<string>",
"score": 123,
"risk_level": "<string>",
"coverage": 123,
"missing_documents": [
"<string>"
],
"blocks": [
{
"key": "<string>",
"label_fr": "<string>",
"label_en": "<string>",
"points": 123,
"max": 123,
"computed": true,
"status": "calculé",
"provisional": true,
"notes": "<string>"
}
],
"fraud_penalty": 123,
"summary": "<string>",
"sme": {},
"project_review": {},
"max_score": 1000
},
"decision": "<string>",
"applied": {
"policy_path": "kyc",
"weights": {},
"approve_threshold": 123,
"refuse_threshold": 123,
"inputs": {}
},
"persisted": false
}{
"detail": {
"code": "partner_identity_rejected",
"message": "The key is bound to a service account and X-Partner-Identity was missing or did not verify for it."
}
}{
"detail": "API key lacks the required scope"
}{
"detail": {
"code": "invalid_environment",
"message": "environment / X-Sahl-Environment must be 'sandbox' or 'production'."
}
}{
"detail": {
"code": "rate_limit_exceeded",
"message": "Too many calls a minute: per API key on the partner routes, or per key / per address at the edge. Wait for Retry-After."
}
}{
"detail": {
"code": "commit_failed",
"message": "The change could not be saved; nothing changed. Retry."
}
}Simulate a score without saving
Required scope: scoring:read.
The score a case would get with other loan inputs, factor weights or thresholds.
Runs the real scoring engine on the case’s stored extractions with the overrides applied, inside a transaction savepoint that is always rolled back: the case, the policy and the audit log are left exactly as they were.
Choose the environment with the X-Sahl-Environment header or the environment parameter or field; the Sandbox is the default. Two values that disagree are refused (422 environment_conflict).
curl --request POST \
--url https://app.sahlfinancial.com/api/v1/partner/scoring/what-if \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "client-0001",
"inputs": {
"requested_amount": 150000,
"duration_months": 60,
"annual_rate_pct": 6.5
},
"approve_threshold": 650,
"refuse_threshold": 400
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference: 'client-0001',
inputs: {requested_amount: 150000, duration_months: 60, annual_rate_pct: 6.5},
approve_threshold: 650,
refuse_threshold: 400
})
};
fetch('https://app.sahlfinancial.com/api/v1/partner/scoring/what-if', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.sahlfinancial.com/api/v1/partner/scoring/what-if"
payload = {
"reference": "client-0001",
"inputs": {
"requested_amount": 150000,
"duration_months": 60,
"annual_rate_pct": 6.5
},
"approve_threshold": 650,
"refuse_threshold": 400
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"current": {
"score": 123,
"risk_level": "<string>",
"decision": "<string>"
},
"hypothetical": {
"reference": "<string>",
"case_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment": "sandbox",
"scored": true,
"subject_kind": "individual",
"model": "<string>",
"score": 123,
"risk_level": "<string>",
"coverage": 123,
"missing_documents": [
"<string>"
],
"blocks": [
{
"key": "<string>",
"label_fr": "<string>",
"label_en": "<string>",
"points": 123,
"max": 123,
"computed": true,
"status": "calculé",
"provisional": true,
"notes": "<string>"
}
],
"fraud_penalty": 123,
"summary": "<string>",
"sme": {},
"project_review": {},
"max_score": 1000
},
"decision": "<string>",
"applied": {
"policy_path": "kyc",
"weights": {},
"approve_threshold": 123,
"refuse_threshold": 123,
"inputs": {}
},
"persisted": false
}{
"detail": {
"code": "partner_identity_rejected",
"message": "The key is bound to a service account and X-Partner-Identity was missing or did not verify for it."
}
}{
"detail": "API key lacks the required scope"
}{
"detail": {
"code": "invalid_environment",
"message": "environment / X-Sahl-Environment must be 'sandbox' or 'production'."
}
}{
"detail": {
"code": "rate_limit_exceeded",
"message": "Too many calls a minute: per API key on the partner routes, or per key / per address at the edge. Wait for Retry-After."
}
}{
"detail": {
"code": "commit_failed",
"message": "The change could not be saved; nothing changed. Retry."
}
}Authorizations
API key created in the console. Scopes: kyc:extract, kyc:verify, kyc:eid; kyb:onboard, kyb:ice; statements:read; webhooks:manage; requests:read, requests:write; bank:read, bank:write (Growth plan, enabled per workspace by Sahl); registry:read; cases:read; scoring:read, scoring:write; policy:read, policy:write; usage:read. The Sandbox specimen routes, GET /v1/partner/me and GET /v1/partner/errors need any valid key.
Headers
Body
Response
OK