> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lead.bank/llms.txt
> Use this file to discover all available pages before exploring further.

# Validations

> Validating account files.

Beyond the standard required and optional field checks and data type validations, Lead performs additional validations. The list below is non-exhaustive — we aim to be thoughtful and robust in validations that ensure high data quality to enable us to provide effective oversight.

## Enforced Today

| Validation                                                          | Description                                                                                                                                                                                                           |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Missing Status Reason                                               | `status_reason` must be populated and consistent with `status`. Closed accounts must use a closed reason (`entity_closed`, `client_closed`, `paid_off`, `charged_off`, `canceled`).                                   |
| Missing Adverse Action Notice                                       | Adverse action notice fields (`aan_delivered_at`, `aan_reason`, `aan_delivery_method`) are required if `status_reason = client_closed`.                                                                               |
| Missing Credit Score Detail                                         | When you provide credit bureau data, include `credit_pulled_at`, `credit_report_source`, and exactly one of `credit_score` or `credit_report_non_score_value`. Provide all applicable fields or none.                 |
| Invalid Entity Reference on Closed Account                          | References to account holders, authorized signers, and authorized users by `client_customer_id` or `entity_id` must refer to entities that have already been submitted to Lead if the account is in a `closed` state. |
| May Not Change Closed Account                                       | Updates may not be made to accounts in a `closed` state. A closed account cannot be re-opened.                                                                                                                        |
| Entity Role Mismatch for Account                                    | Each entity referenced on the account must meet the role requirements for `account_holder`, `authorized_signer`, or `authorized_user` as appropriate.                                                                 |
| Previous Account Has effective\_at >= current Account effective\_at | On account update, `effective_at` must be greater than the previous instance of this record.                                                                                                                          |

## Future Enforcements

Lead expects partners to comply with the validations below; however we do not currently enforce them upon daily processing. We will provide you with 60 days notice before enforcing the following validations.

| Validation                                  | Description                                                                                                                                                       |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Invalid Namespace                           | `client_account_id` cannot start with `account_`, `subledgered_account_`, or `partner_ledgered_account_` (reserved for Lead-generated account IDs).               |
| Invalid Entities on Account                 | Account holders, authorized signers, and authorized users must have a valid `entity_id` or `client_customer_id` if the account is in a `closed` state.            |
| Credit Limit Cannot Exceed Max Credit Limit | `credit_limit <= max_credit_limit` if both are provided.                                                                                                          |
| Missing Adverse Action Notice Detail        | If `status_reason = client_closed`, either all three adverse action notice fields are provided or none (`aan_delivered_at`, `aan_reason`, `aan_delivery_method`). |
| Invalid Account Status Transition           | Updates to non-closed accounts must comply with valid status transitions.                                                                                         |
