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

# Delete a loan

> Permanently remove a pending loan.

Only loans in **submitted and pending approval** state can be deleted.
Because `POST /v1/loans` always lands at `Active`, reaching a deletable
state requires first calling [undo disbursal](/loans/undo-disbursal)
and then [undo approval](/loans/undo-approval). To stop an active
loan without removing it from the record, use
[Write off](/loans/writeoff) instead.

Two equivalent forms — prefer the externalId form for partner integrations.

```bash theme={null}
# By loan externalId (recommended)
curl -X DELETE "$BASE/v1/loans/external/loan-ext-12345" \
  -H "Authorization: Bearer $TOKEN"

# Same effect, by LMS id
curl -X DELETE "$BASE/v1/loans/501" \
  -H "Authorization: Bearer $TOKEN"
```

## Path parameters

<ParamField path="loan_id" type="string" required />

## Example

```bash theme={null}
curl -sf -X DELETE "$BASE/v1/loans/501" \
  -H "Authorization: Bearer $TOKEN"
```

## Response

`204 No Content` with an empty body.

## Errors

| Code                | When                                                                                                                     |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `not_found`         | No loan with that ID                                                                                                     |
| `permission_denied` | Loan is not in `Submitted and pending approval` state (e.g. `Active`, `Closed`, `Overpaid`). The loan is left untouched. |
