Loan Approvals
Revoke Loan Approval
Take back an approval that is still on chain
POST
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
loan-requests
/
{ref}
/
revoke
Revoke Loan Approval
curl --request POST \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"signerAddress": "<string>",
"txHash": "<string>"
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke"
payload = {
"signerAddress": "<string>",
"txHash": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({signerAddress: '<string>', txHash: '<string>'})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'signerAddress' => '<string>',
'txHash' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke"
payload := strings.NewReader("{\n \"signerAddress\": \"<string>\",\n \"txHash\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signerAddress\": \"<string>\",\n \"txHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signerAddress\": \"<string>\",\n \"txHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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
}
{
"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
}
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.
Who can call
The lender of record.Path Parameters
Body Parameters
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 answers409 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
APPROVEDis returned unchanged.
Response Fields
Show child attributes
Show child attributes
The loan request. See Get Loan Request for every field.
{ endpoint, field }: the call that confirms this transaction, and txHash as the body field that carries the hash. Returned when txHash is omitted.{
"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
}
{
"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 |
⌘I
Revoke Loan Approval
curl --request POST \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"signerAddress": "<string>",
"txHash": "<string>"
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke"
payload = {
"signerAddress": "<string>",
"txHash": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({signerAddress: '<string>', txHash: '<string>'})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'signerAddress' => '<string>',
'txHash' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke"
payload := strings.NewReader("{\n \"signerAddress\": \"<string>\",\n \"txHash\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signerAddress\": \"<string>\",\n \"txHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests/{ref}/revoke")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signerAddress\": \"<string>\",\n \"txHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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
}
{
"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
}
