Skip to main content
POST
/
v1
/
loans
/
{loan_id}
/
undo-approval
Undo approval
curl --request POST \
  --url https://api-staging.bsa.ai/v1/loans/{loan_id}/undo-approval \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "note": "<string>"
}
'

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.

Reverses a prior approval. The loan returns to submitted and pending approval so it can be modified or deleted. Cannot be used while the loan is disbursed (which is the default state after POST /v1/loans) — call Undo disbursal first.
Because partners always create loans via the single-call POST /v1/loans, walking back to a pending state takes two steps: undo-disbursal, then undo-approval. This endpoint exists for admin/operational reversals and is part of the rollback sequence after a wallet failure.
Two equivalent forms — prefer the externalId form for partner integrations.
# By loan externalId (recommended)
curl -X POST "$BASE/v1/loans/external/halotel-tx-12345/undo-approval" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"note":"Rolling back failed disbursal"}'

# Same effect, by LMS id
curl -X POST "$BASE/v1/loans/501/undo-approval" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"note":"Rolling back failed disbursal"}'

Path parameters

loan_id
string
required

Request body

note
string
Optional free-text note explaining the reversal.
The body is optional — POST with no body is valid.

Example

curl -sf -X POST "$BASE/v1/loans/501/undo-approval" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"note": "Compliance review pending"}'

Response

200 OK returns the loan object with status reset to submitted.

Errors

CodeWhen
not_foundNo loan with that ID
abortedLoan was never approved, or has already been disbursed