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

# Revoke Loan Approval

> Take back an approval that is still on chain

Builds the `revoke` transaction on the market's approvals contract, and confirms it on a second call with `txHash`. Trusset never signs: the market admin or a wallet holding `LOAN_APPROVER_ROLE` signs the calldata. Once confirmed, an `APPROVED` request is `REVOKED`.

To void every approval of the market at once, for example when an approver wallet is lost or replaced, use [Revoke All Loan Approvals](https://docs.trusset.org/endpoints/lending/revoke-all-loan-approvals.md).

## Who can call

The lender of record.

## Path Parameters

**marketId** `string` *required*

The market's record ID on your instance.

**ref** `string` *required*

The loan request reference: `lrq_` followed by 20 characters.

## Body Parameters

**signerAddress** `string`

The wallet that will sign.

**txHash** `string`

Hash of the transaction you broadcast. Send it to confirm the transaction and record the result. Omit it to receive the calldata.

## The revoke follows the chain

The revoke follows the chain, not the request status. The transaction is built whenever an approval is on chain for the request's borrower and loan, also when the request was withdrawn or declined after the approval was mined. When no approval is on chain, the build answers `409 APPROVAL_NOT_ON_CHAIN`.

On the confirm call:

* The signer has to be a verified wallet of your instance. Otherwise the confirm answers `403 APPROVAL_NOT_INSTANCE_BOUND`.
* A revoke older than the approval recorded on the request did not revoke it, and answers `400 TX_NOT_VERIFIED`.
* A request that is not `APPROVED` is returned unchanged.

## Response Fields

**data** `object`

**action** `string`

`SIGN_TRANSACTION`. Returned when `txHash` is omitted.

**transaction** `object`

`{ to, data }`, the unsigned `revoke` call. Returned when `txHash` is omitted.

**functionName** `string`

`revoke`. Returned when `txHash` is omitted.

**signer** `string`

The wallet that signs. Returned when `txHash` is omitted.

**requiredRole** `string`

`LOAN_APPROVER_ROLE`. Returned when `txHash` is omitted.

**request** `object`

The loan request. See [Get Loan Request](https://docs.trusset.org/endpoints/lending/get-loan-request.md#response-fields) for every field.

**confirmWith** `object`

`{ endpoint, field }`: the call that confirms this transaction, and `txHash` as the body field that carries the hash. Returned when `txHash` is omitted.

**txHash** `string`

Transaction hash. Returned when confirming.

**marketId** `string`

The market's record ID on your instance.

```json 200 Calldata theme={null}
{
  "success": true,
  "data": {
    "action": "SIGN_TRANSACTION",
    "transaction": {
      "to": "0x5d2e8c1a7f4b3960e2d1c8a7b6f5e4d3c2b1a098",
      "data": "0x..."
    },
    "functionName": "revoke",
    "signer": "0x7712db30a7b4ffd9c445793089118b60e56d752a",
    "requiredRole": "LOAN_APPROVER_ROLE",
    "request": {
      "ref": "lrq_k3vx7q2mwd4h5pn6tr2a",
      "kind": "OPEN",
      "loanId": null,
      "status": "APPROVED",
      "marketAddress": "0x41b9c4d5dee70a5e3682094462e5065275e728a9",
      "borrowerWallet": "0x7c1e3a5f2b9d4e6a8c0f1b3d5e7a9c2b4d6f8e1a",
      "externalReference": "CASE-2026.11_042",
      "amount": "25000",
      "amountRaw": "25000000000",
      "collateralAmount": "40",
      "symbol": "USDC",
      "decimals": 6,
      "approvedAmount": "25000",
      "approvedAmountRaw": "25000000000",
      "validUntil": "2026-11-24T16:40:00.000Z",
      "approver": "0x7712db30a7b4ffd9c445793089118b60e56d752a",
      "approveTxHash": "0x9f2c41d8b7e05a3164c2870fbd935e1a4c7802db6135ea9048f7c21b5d3ea41b",
      "decidedAt": "2026-11-21T16:41:07.000Z",
      "usedTxHash": null,
      "usedAt": null,
      "createdAt": "2026-11-21T16:02:11.000Z",
      "updatedAt": "2026-11-21T16:41:07.000Z",
      "requestedByThisInstance": false,
      "viewerRole": {
        "bank": true,
        "borrower": false
      },
      "nextStep": "WAIT_FOR_BORROWER"
    },
    "confirmWith": {
      "endpoint": "POST /lending-external-securities-v2/api/markets/cmwfk2h7x0003jw9w4q8b2n1c/loan-requests/lrq_k3vx7q2mwd4h5pn6tr2a/revoke",
      "field": "txHash"
    },
    "marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
  },
  "error": null
}
```

```json 200 Confirmed theme={null}
{
  "success": true,
  "data": {
    "request": {
      "ref": "lrq_k3vx7q2mwd4h5pn6tr2a",
      "kind": "OPEN",
      "loanId": null,
      "status": "REVOKED",
      "marketAddress": "0x41b9c4d5dee70a5e3682094462e5065275e728a9",
      "borrowerWallet": "0x7c1e3a5f2b9d4e6a8c0f1b3d5e7a9c2b4d6f8e1a",
      "externalReference": "CASE-2026.11_042",
      "amount": "25000",
      "amountRaw": "25000000000",
      "collateralAmount": "40",
      "symbol": "USDC",
      "decimals": 6,
      "approvedAmount": "25000",
      "approvedAmountRaw": "25000000000",
      "validUntil": "2026-11-24T16:40:00.000Z",
      "approver": "0x7712db30a7b4ffd9c445793089118b60e56d752a",
      "approveTxHash": "0x9f2c41d8b7e05a3164c2870fbd935e1a4c7802db6135ea9048f7c21b5d3ea41b",
      "decidedAt": "2026-11-21T16:41:07.000Z",
      "usedTxHash": null,
      "usedAt": null,
      "createdAt": "2026-11-21T16:02:11.000Z",
      "updatedAt": "2026-11-21T16:41:07.000Z",
      "requestedByThisInstance": false,
      "viewerRole": {
        "bank": true,
        "borrower": false
      },
      "nextStep": "NONE"
    },
    "txHash": "0x6d1a4f82c3b95e07a1d6c4f8e2b7093a5c8d1e6f4b2a7093c5e8d1f6a4b2c7e9",
    "marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
  },
  "error": null
}
```

## Error Codes

| Code | HTTP | Cause |
| - | - | - |
| `TX_REVERTED` | `400` | The transaction reverted on chain |
| `TX_NOT_VERIFIED` | `400` | The transaction emits no `LoanApprovalRevoked` for this borrower and loan from the market's approvals contract, or the revoke is older than the approval recorded on the request |
| `LOAN_APPROVAL_BANK_ONLY` | `403` | Only the lender of record revokes |
| `SIGNER_NOT_AUTHORIZED` | `403` | `signerAddress` is not a verified wallet of your instance that holds `DEFAULT_ADMIN_ROLE` or `LOAN_APPROVER_ROLE` on the market |
| `APPROVAL_NOT_INSTANCE_BOUND` | `403` | The revoke was signed by a wallet that is not verified for your instance |
| `TX_NOT_FOUND` | `404` | The transaction is not found or not mined yet |
| `APPROVAL_NOT_ON_CHAIN` | `409` | No approval is on chain for this borrower and loan: it was used, revoked or never signed. Nothing to sign |
| `APPROVAL_WOULD_REVERT` | `409` | The approvals contract would refuse this as it stands, so nothing was built |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.