> For the complete documentation index, see [llms.txt](https://docs.tendar.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tendar.co/documentation/credit-scoring/risk-assessment.md). Agents can also search and read this documentation through its [MCP server](https://docs.tendar.co/~gitbook/mcp).

# Risk Assessment

Read a customer's bank statement to see their chance of default, what they can afford each month, and warning signs to check.

A credit report shows how someone has handled credit. Their bank statement shows how they live: what they earn and how regularly, what they already repay to other lenders, whether payments bounce, and whether they bet. For customers with little credit history, it's often the best evidence you have.

All endpoints need your secret key. See [Authentication](https://docs.tendar.co/documentation/getting-started/authentication.md).

### How it works

***

1. **Get a statement.** [Upload the file](#upload-a-statement) the customer gave you, or [link their bank account](#link-a-bank-account) and pull it through open banking (Mono).
2. **Assess them.** Tendar reads the statement with their [Credit Score](https://docs.tendar.co/documentation/credit-scoring/credit-score.md) and their borrowing across Tendar, and returns a **probability of default** (`pd`), a **grade** from A to E, the **monthly instalment they can afford**, flags, and a plain-English summary.
3. **Decide.** Read the assessment yourself, or let your [credit policy](https://docs.tendar.co/documentation/credit-scoring/eligibility.md) apply it to every loan request.

### Upload a statement

***

```
POST /api/v1/risk/statements/upload
```

Send `multipart/form-data` with the customer's `user_id` and the statement as `file`. CSV and Excel files (`.csv`, `.xlsx`, `.xlsm`) up to 10 MB work, as exported by Nigerian banks: the columns are found whatever the bank calls them. PDFs aren't supported. Uploading is free.

**Response** `200 OK`

```json
{
  "data": {
    "id": "6709a1b2c3d4e5f6a7b8c9d0",
    "user_id": "usr-kqhzwmtrpa",
    "source": "upload",
    "file_name": "gtbank-apr-sep.csv",
    "from": "2026-04-01T00:00:00Z",
    "to": "2026-09-30T00:00:00Z",
    "transactions": 144,
    "skipped_lines": 3,
    "integrity": {
      "balance_checked": 143,
      "balance_breaks": 0,
      "duplicates": 0,
      "longest_gap_days": 6,
      "suspicious": false
    },
    "created_at": "2026-10-10T12:00:00Z"
  },
  "error": false,
  "message": "statement uploaded successfully"
}
```

* `skipped_lines` are lines without a date or amount, such as totals and page footers.
* `integrity` checks the statement wasn't edited: `balance_breaks` counts lines where the running balance doesn't add up, and `suspicious` is `true` when too many don't. Check a suspicious statement with the customer.

List a customer's statements with `GET /api/v1/risk/statements/list/:user_id`, or get one with `GET /api/v1/risk/statements/fetch/:id`.

### Link a bank account

***

Read the statement straight from the customer's bank instead. They log in to their bank on Mono's page and give access.

```
POST /api/v1/risk/bank/link
```

```json
{
  "user_id": "usr-kqhzwmtrpa",
  "redirect_url": "https://yourapp.com/bank-linked"
}
```

**Response** `200 OK`

```json
{
  "data": {
    "mono_url": "https://link.mono.co/ACRqZn...",
    "reference": "bnk_01JA8Z..."
  },
  "error": false,
  "message": "bank account link created successfully"
}
```

Send the customer to `mono_url`. When they finish, Tendar links the account and sends you the `bank_connection.linked` [webhook](#webhooks), or `bank_connection.failed` if it doesn't work.

* **Billed** (`risk.bank_link`) once the account is linked. The fee is held on your wallet when you create the link, and released if linking fails or the customer doesn't finish within 24 hours.
* If you embed Mono's Connect widget in your app instead of using `mono_url`, send the `code` it gives you to `POST /api/v1/risk/bank/connect` with the `user_id`.
* List a customer's links with `GET /api/v1/risk/bank/connections/:user_id`. Each has a `status` (`pending`, `linked`, `failed` or `unlinked`) and a `data_status`, which says whether the bank's data is ready: `AVAILABLE`, `PARTIAL`, `PROCESSING`, `UNAVAILABLE` or `FAILED`.

#### Pull a statement

```
POST /api/v1/risk/statements/pull
```

```json
{
  "user_id": "usr-kqhzwmtrpa",
  "months": 6
}
```

Reads 1 to 12 months (default 6) from the linked account, and returns a statement with `source: "mono"` and the account's `account_name`. **Billed** (`risk.bank_statement`) when the bank returns the data. Straight after linking, the data may still be `PROCESSING`; the pull then returns `400` with `the bank account's data is not ready yet, try again in a few minutes`.

### Assess a customer

***

```
POST /api/v1/risk/assess
```

```json
{
  "user_id": "usr-kqhzwmtrpa",
  "statement_id": "6709a1b2c3d4e5f6a7b8c9d0"
}
```

Leave out `statement_id` to use the customer's newest statement from the last 90 days. **Billed** (`risk.statement_analysis`) when a statement is assessed. With no statement, the assessment reads only the Credit Score and their borrowing across Tendar, and is free.

**Response** `200 OK`

```json
{
    "data": {
        "id": "6709b1c2d3e4f5a6b7c8d9e0",
        "user_id": "usr-kqhzwmtrpa",
        "statement": "6709a1b2c3d4e5f6a7b8c9d0",
        "pd": 0.0412,
        "grade": "B",
        "factors": [
            { "code": "R01_TENDAR_SCORE", "log_odds": -3.08, "detail": "Tendar Score 680 (good)" },
            { "code": "R03_DEBT_TO_INCOME", "log_odds": 0.35, "detail": "34% of income already goes to other lenders" },
            { "code": "R07_REGULAR_SALARY", "log_odds": -0.4, "detail": "salary of about ₦250,000 for 6 months, around day 25" }
        ],
        "flags": [],
        "affordable_installment": 15000,
        "summary": "Grade B: an estimated 4.1% chance of default. Income of about ₦250,000 a month (salary) over 6.0 months of statement. Repays other lenders ₦85,000 a month (34% of income). Can afford about ₦15,000 a month towards a new loan. Watch: 34% of income already goes to other lenders.",
        "cash_flow": {
            "from": "2026-04-01T00:00:00Z",
            "to": "2026-09-30T00:00:00Z",
            "months": 6,
            "transactions": 144,
            "total_inflow": 1910000,
            "total_outflow": 1845000,
            "monthly_income": 262000,
            "median_monthly_income": 255000,
            "income_volatility": 0.08,
            "months_with_income": 6,
            "salary": { "monthly": 250000, "months": 6, "day": 25 },
            "estimated_income": 250000,
            "loan_inflow_monthly": 25000,
            "debt_service_monthly": 85000,
            "lenders": ["carbon", "fairmoney"],
            "debt_to_income": 0.34,
            "gambling_monthly": 15000,
            "gambling_share": 0.05,
            "reversals": 1,
            "reversals_per_month": 0.17,
            "cash_withdrawal_share": 0.12,
            "net_monthly": 10833.33,
            "average_balance": 48210.55,
            "lowest_balance": 320.1,
            "low_balance_days": 0.14,
            "by_category": { "salary": 1500000, "loan_repayment": 510000, "gambling": 90000, "transfer": 610000, "other": 400000 },
            "integrity": { "balance_checked": 143, "balance_breaks": 0, "duplicates": 0, "longest_gap_days": 6, "suspicious": false }
        },
        "network": { "lenders": 1, "active_loans": 1, "outstanding": 45000, "new_loans_30d": 0, "new_loans_90d": 1, "current_dpd": 0 },
        "identity": { "name_matches": null },
        "credit_score": "6709d1e2f3a4b5c6d7e8f9a0",
        "score": 680,
        "band": "good",
        "model": "risk-1",
        "created_at": "2026-10-10T12:00:00Z"
    },
    "error": false,
    "message": "risk assessment completed successfully"
}
```

#### The assessment

| Field                                            | Type           | Description                                                                                                                                                             |
| ------------------------------------------------ | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                                             | string         | The assessment's ID.                                                                                                                                                    |
| `statement`                                      | string \| null | The statement assessed; `null` when none.                                                                                                                               |
| `pd`                                             | number         | The probability of default, from 0 to 1.                                                                                                                                |
| `grade`                                          | string         | `A` (under 3%), `B` (under 7%), `C` (under 15%), `D` (under 30%) or `E`.                                                                                                |
| `factors[]`                                      | array          | Every signal: a stable `code`, its effect (`log_odds` — positive raises the risk, negative lowers it) and a `detail` in plain words.                                    |
| `flags[]`                                        | array          | Warnings to check before you lend, whatever the grade (see below).                                                                                                      |
| `affordable_installment`                         | number \| null | What the borrower can put towards a new loan each month, after what they already repay. `null` without a statement.                                                     |
| `summary`                                        | string         | The assessment in plain words.                                                                                                                                          |
| `cash_flow`                                      | object \| null | What the statement shows (see below); `null` without a statement.                                                                                                       |
| `network`                                        | object         | The borrower's loans at other Tendar lenders: `lenders`, `active_loans`, `outstanding`, `new_loans_30d`, `new_loans_90d`, `current_dpd`. Other lenders are never named. |
| `identity.account_name`, `identity.name_matches` |                | For pulled statements: the account's name, and whether it shares the borrower's first or last name (`null` when there was nothing to compare).                          |
| `credit_score`, `score`, `band`                  |                | The [Credit Score](https://docs.tendar.co/documentation/credit-scoring/credit-score.md) calculated for the assessment.                                                  |
| `model`                                          | string         | The assessment model.                                                                                                                                                   |

**`cash_flow`** (amounts in naira)

| Field                                                           | Description                                                                                                                                                           |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `months`, `transactions`, `from`, `to`                          | What the statement covers.                                                                                                                                            |
| `total_inflow`, `total_outflow`, `net_monthly`                  | Money in and out, and the average monthly difference.                                                                                                                 |
| `monthly_income`, `median_monthly_income`, `months_with_income` | Income per month (excluding loans received and reversals).                                                                                                            |
| `income_volatility`                                             | How much income varies month to month — 0 is steady, higher is more irregular.                                                                                        |
| `salary`                                                        | A salary seen in the statement: `monthly`, over how many `months`, and the usual `day` it arrives. `null` when none.                                                  |
| `estimated_income`                                              | The monthly income the assessment relies on.                                                                                                                          |
| `lenders`, `loan_inflow_monthly`, `debt_service_monthly`        | Other lenders seen in the statement, money received from them, and repaid to them per month.                                                                          |
| `debt_to_income`                                                | Repayments to other lenders as a share of income.                                                                                                                     |
| `gambling_monthly`, `gambling_share`                            | Spending on betting per month, and as a share of all spending.                                                                                                        |
| `reversals`, `reversals_per_month`                              | Failed or reversed transactions.                                                                                                                                      |
| `cash_withdrawal_share`                                         | Cash withdrawals as a share of spending.                                                                                                                              |
| `average_balance`, `lowest_balance`, `low_balance_days`         | End-of-day balances, and the share of days with a very low balance. `null` when the statement shows no balances.                                                      |
| `by_category`                                                   | Money per category: `salary`, `loan_disbursement`, `loan_repayment`, `gambling`, `reversal`, `cash_withdrawal`, `bank_charges`, `bills_airtime`, `transfer`, `other`. |
| `integrity`                                                     | As on the statement.                                                                                                                                                  |

#### Flags

| Flag                                | Meaning                                                           |
| ----------------------------------- | ----------------------------------------------------------------- |
| `statement_balance_does_not_add_up` | The statement's running balance breaks — it may have been edited. |
| `account_name_does_not_match_user`  | The bank account is in another person's name.                     |
| `several_loans_in_30_days`          | Several loans taken at Tendar lenders in the last 30 days.        |
| `heavy_gambling`                    | A large share of spending goes to betting.                        |

#### Factor codes

| Code                            | Meaning                                               |
| ------------------------------- | ----------------------------------------------------- |
| `R01_TENDAR_SCORE`              | The borrower's Credit Score — the starting point.     |
| `R02_THIN_FILE`                 | No Credit Score yet.                                  |
| `R03_DEBT_TO_INCOME`            | A large share of income already repays other lenders. |
| `R04_GAMBLING`                  | Spending on betting.                                  |
| `R05_BOUNCED_TRANSACTIONS`      | Failed or reversed transactions.                      |
| `R06_IRREGULAR_INCOME`          | Income varies a lot from month to month.              |
| `R07_REGULAR_SALARY`            | A regular salary (lowers the risk).                   |
| `R08_MANY_LENDERS_IN_STATEMENT` | Money received from several lenders.                  |
| `R09_SPENDS_MORE_THAN_EARNS`    | More money going out than coming in.                  |
| `R10_LOW_BALANCES`              | The balance is very low on most days.                 |
| `R11_STATEMENT_DOES_NOT_ADD_UP` | The statement's running balance breaks.               |
| `R12_LOANS_AT_OTHER_LENDERS`    | Several loans running at Tendar lenders.              |
| `R13_RECENT_BORROWING_SPREE`    | Several loans taken recently at Tendar lenders.       |
| `R14_OVERDUE_AT_TENDAR_LENDER`  | A long-overdue installment at another Tendar lender.  |
| `R15_ACCOUNT_NAME_MISMATCH`     | The bank account is in another name.                  |
| `R16_NO_INCOME_SEEN`            | No income in the statement.                           |
| `R17_SHORT_STATEMENT`           | The statement covers less than 3 months.              |

New codes may be added; treat an unknown code as information and show its `detail`.

### Read assessments

***

| Endpoint                                        | Returns                                                               |
| ----------------------------------------------- | --------------------------------------------------------------------- |
| `GET /api/v1/risk/assessments/:user_id`         | The customer's latest assessment. Nothing is recalculated.            |
| `GET /api/v1/risk/assessments/history/:user_id` | Every assessment, newest first, paged.                                |
| `GET /api/v1/risk/assessments/fetch/:id`        | One assessment. An eligibility decision's `risk_assessment` names it. |

### Webhooks

***

Tendar tells you when a bank link changes.

| Event                      | Sent when                                                               |
| -------------------------- | ----------------------------------------------------------------------- |
| `bank_connection.linked`   | The borrower's account is linked. You can pull a statement.             |
| `bank_connection.failed`   | The borrower couldn't link their account.                               |
| `bank_connection.unlinked` | The account is no longer linked. Link it again to pull a new statement. |

`data` is the bank connection.

**`bank_connection.linked`**

```json
{
  "data": {
    "id": "6709c1d2e3f4a5b6c7d8e9f0",
    "user_id": "usr-kqhzwmtrpa",
    "provider": "mono",
    "status": "linked",
    "reference": "bnk_01JA8Z",
    "account_name": "JOHN DOE",
    "account_number": "******6789",
    "bank_name": "GTBank",
    "bank_code": "058",
    "bvn_last4": "1234",
    "data_status": "PROCESSING",
    "linked_at": "2026-10-10T12:00:00Z",
    "created_at": "2026-10-10T11:58:10Z",
    "updated_at": "2026-10-10T12:00:00Z"
  },
  "event": "bank_connection.linked"
}
```

**`bank_connection.failed`** has `status: "failed"` and no account details. **`bank_connection.unlinked`** has `status: "unlinked"` and keeps the account details.

See [Webhooks](https://docs.tendar.co/documentation/getting-started/webhooks.md) to verify and acknowledge them.

### Errors

***

| Status | Message                                                                         | Cause                                                        |
| ------ | ------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| 400    | `the statement must be a CSV or Excel (.xlsx) file`                             | Ask for a CSV or Excel export, or link the bank account.     |
| 400    | `could not find the statement's columns: a date, a description and the amounts` | Upload the bank's transaction export, not a summary.         |
| 400    | `the statement has no transactions`                                             | Check the file, or pull a longer period.                     |
| 400    | `the statement must be at most 10 MB`                                           | Export a shorter period.                                     |
| 400    | `the user_id field is required`                                                 | A required field is missing. Other fields work the same way. |
| 400    | `the months field must be between 1 and 12`                                     | Pull 1 to 12 months.                                         |
| 400    | `the user has no linked bank account, link one first`                           | [Link the bank account](#link-a-bank-account) first.         |
| 400    | `the bank account's data is not ready yet, try again in a few minutes`          | The bank is still preparing it. Retry shortly.               |
| 400    | `the bank account could not be read, link it again`                             | Ask the customer to link it again.                           |
| 400    | `you dont have permission to access this resource`                              | Your plan doesn't include this.                              |
| 400    | `insufficient balance, please top up your wallet.`                              | Your wallet can't cover it.                                  |
| 404    | `user not found` / `statement not found` / `assessment not found`               | No record with that ID, or not yours.                        |
| 404    | `risk assessment not found, assess the user first`                              | The customer has never been assessed.                        |
| 503    | `the bank data provider is unavailable, try again later`                        | Mono couldn't be reached. Not billed; retry later.           |

See [Error](https://docs.tendar.co/documentation/getting-started/error.md) for the error format.

### Next steps

***

* [Eligibility](https://docs.tendar.co/documentation/credit-scoring/eligibility.md) — apply the assessment to every loan request, with `affordability.max_pd` and `affordability.max_dti`.
* [Credit Score](https://docs.tendar.co/documentation/credit-scoring/credit-score.md) — the score each assessment starts from.
* [Credit Bureau](https://docs.tendar.co/documentation/credit-scoring/credit-bureau.md) — add the customer's credit report.
