curl --request GET \
--url https://app.sahlfinancial.com/api/v1/bank-connections/{connection_id}/analysis \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.sahlfinancial.com/api/v1/bank-connections/{connection_id}/analysis', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.sahlfinancial.com/api/v1/bank-connections/{connection_id}/analysis"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"income_regularity": {
"score": 0.93,
"pattern": "monthly_25th",
"employer": "OCP GROUP",
"day_of_month": 25,
"consecutive_months": 9,
"risk": "low"
},
"risk_flags": {
"overdrafts": 0,
"bounced_checks": 0,
"gambling_transactions": 0,
"large_cash_withdrawals": 1,
"debt_payments_detected": 2,
"flagged_items": [
"Large cash withdrawal of 5000 MAD on 14/02"
]
},
"savings_rate": 0.35,
"estimated_dti": 0.31,
"avg_end_of_month_balance": 9000,
"avg_balance": 21000,
"monthly_income": 18000,
"monthly_expenses": 11700
}{
"detail": "Invalid or expired token"
}{
"detail": "Insufficient permissions"
}{
"detail": "Bank connection not found"
}{
"detail": {
"code": "bank_connect_unavailable",
"message": "Bank connection is not available yet. No bank data provider is live for this workspace."
}
}{
"detail": [
{
"type": "missing",
"loc": [
"body",
"bank_code"
],
"msg": "Field required",
"input": {}
}
]
}{
"code": "rate_limit_exceeded",
"message": "Too many requests. Please slow down."
}Get the cash-flow analysis of a bank connection
Who can call it: Any signed-in member of the workspace.
Income regularity, risk flags, savings rate and debt-to-income, generated from the connection id.
Production behaviour. No open-banking provider is live. This route answers 409 with the code bank_connect_unavailable unless the request is made in the Sandbox: send X-Sahl-Environment: sandbox (or ?environment=sandbox). In the Sandbox the data is simulated and derived from the connection id; it is not read from a bank. A request with no environment is also refused.
Auth: dashboard session (Authorization: Bearer <access token>). Not available with a partner API key.
curl --request GET \
--url https://app.sahlfinancial.com/api/v1/bank-connections/{connection_id}/analysis \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.sahlfinancial.com/api/v1/bank-connections/{connection_id}/analysis', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.sahlfinancial.com/api/v1/bank-connections/{connection_id}/analysis"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"income_regularity": {
"score": 0.93,
"pattern": "monthly_25th",
"employer": "OCP GROUP",
"day_of_month": 25,
"consecutive_months": 9,
"risk": "low"
},
"risk_flags": {
"overdrafts": 0,
"bounced_checks": 0,
"gambling_transactions": 0,
"large_cash_withdrawals": 1,
"debt_payments_detected": 2,
"flagged_items": [
"Large cash withdrawal of 5000 MAD on 14/02"
]
},
"savings_rate": 0.35,
"estimated_dti": 0.31,
"avg_end_of_month_balance": 9000,
"avg_balance": 21000,
"monthly_income": 18000,
"monthly_expenses": 11700
}{
"detail": "Invalid or expired token"
}{
"detail": "Insufficient permissions"
}{
"detail": "Bank connection not found"
}{
"detail": {
"code": "bank_connect_unavailable",
"message": "Bank connection is not available yet. No bank data provider is live for this workspace."
}
}{
"detail": [
{
"type": "missing",
"loc": [
"body",
"bank_code"
],
"msg": "Field required",
"input": {}
}
]
}{
"code": "rate_limit_exceeded",
"message": "Too many requests. Please slow down."
}Authorizations
The access token (JWT) of a signed-in console user, from POST /v1/auth/login. It lasts 30 minutes. It is not an API key: a partner API key is refused here. There is no cookie.