Hooks
Get Hook Executions
Retrieve the execution log of a hook
GET
/
lending-external-securities-v2
/
api
/
hooks
/
{marketId}
/
{hookId}
/
executions
curl "https://api.trusset.org/lending-external-securities-v2/api/hooks/{marketId}/{hookId}/executions?limit=10" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/hooks/${marketId}/${hookId}/executions?limit=10&offset=0`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"executions": [
{
"id": "exec_002",
"hookId": "hook_003",
"marketId": "clx_secmarket_001",
"loanId": null,
"executionType": "monitorRisk",
"result": false,
"data": {
"fields": [
{ "path": "ageHours", "operator": "<", "threshold": 36, "value": 51, "pass": false }
]
},
"error": null,
"executedAt": "2026-09-25T06:00:00.000Z"
},
{
"id": "exec_001",
"hookId": "hook_003",
"marketId": "clx_secmarket_001",
"loanId": null,
"executionType": "monitorRisk",
"result": false,
"data": null,
"error": "Status 503",
"executedAt": "2026-09-25T00:00:00.000Z"
}
],
"total": 142,
"hasMore": true
},
"error": null,
"metadata": {
"timestamp": "2026-09-25T12:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "inst_abc123"
}
}
Returns the hook’s execution log, newest first, with pagination counters. Scheduled runs, liquidations, a monitor’s breach, finished deliveries and calls to Execute Hook all write to it.
The log is not the same count as the hook’s
What
A
executionCount. An unmet trigger, a skipped bid, a buy run without an auction, a breach a buy hook cannot act on and a short wallet balance each add a log entry without counting as a run. A refusal before anything is evaluated adds neither. A queued inform delivery adds its entry and its count when it is delivered or fails for good.
Path Parameters
string
required
string
required
Hook ID.
Query Parameters
integer
default:"50"
Records to return, 1 to 200. Out-of-range values are clamped rather than refused: above 200 returns 200, a negative value returns 1, and
0 or a non-number falls back to 50.integer
default:"0"
Records to skip. A negative value or a non-number counts as 0.
Response Fields
object
Show child attributes
Show child attributes
array
Log entries ordered by
executedAt, newest first.Show child attributes
Show child attributes
string
Entry ID.
string
Hook that ran.
string
Market the hook belongs to.
string | null
Loan ID from the data the run was given, or
null.string
The hook type:
monitorRisk, beforeLiquidation or afterLiquidation. An afterLiquidation hook’s entry for a monitor’s breach reads riskBreach.boolean
Outcome. A
buy run that returned steps is logged as false, because nothing was bought.object | null
What the run saw or did. Shapes are listed below.
string | null
Error message when the run failed.
string
Time of the run.
integer
Total log entries for this hook.
boolean
Whether more entries exist beyond this page.
What data holds
A monitorRisk entry holds { fields }, one { path, operator, threshold, value, pass } per field evaluated. It is null when the fetch failed, and error says why.
A beforeLiquidation entry holds { loanData, results }: the data the checks were given and one { parameter, value, pass } per check.
An afterLiquidation entry holds one of these, or null when the run raised an error:
{ action: "inform", deliveryId, status, attempts }when a delivery was delivered, withstatusthe HTTP status. A delivery that failed for good addserror, itsresultisfalse, andstatusisnullwhen no answer came.{ action: "buy", reason: "requires_wallet_signature", auctionId, currentPrice }after bid steps were returned.{ action: "buy", reason: "This liquidation opened no auction, so there is nothing to buy" }for abuyrun without anauctionId.{ reason: "Price exceeds max", currentPrice }when the price was abovemaxBuyPrice.{ reason: "Insufficient USDC" }when the registered wallet held too little of the borrow asset, named by its symbol.{ reason: "Trigger condition not met" }, withtriggerIdwhen a listed hook’s last result was notfalse.
riskBreach entry holds the outcome of the breach’s inform delivery, in the shape above. For a hook whose action is not inform it holds { action, monitorHookId, reason }, with result false, because a breach carries no auction to act on.
An entry a liquidation wrote can also carry the liquidation’s eventKey, which keeps the liquidation from running the hook twice.
curl "https://api.trusset.org/lending-external-securities-v2/api/hooks/{marketId}/{hookId}/executions?limit=10" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/hooks/${marketId}/${hookId}/executions?limit=10&offset=0`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"executions": [
{
"id": "exec_002",
"hookId": "hook_003",
"marketId": "clx_secmarket_001",
"loanId": null,
"executionType": "monitorRisk",
"result": false,
"data": {
"fields": [
{ "path": "ageHours", "operator": "<", "threshold": 36, "value": 51, "pass": false }
]
},
"error": null,
"executedAt": "2026-09-25T06:00:00.000Z"
},
{
"id": "exec_001",
"hookId": "hook_003",
"marketId": "clx_secmarket_001",
"loanId": null,
"executionType": "monitorRisk",
"result": false,
"data": null,
"error": "Status 503",
"executedAt": "2026-09-25T00:00:00.000Z"
}
],
"total": 142,
"hasMore": true
},
"error": null,
"metadata": {
"timestamp": "2026-09-25T12:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "inst_abc123"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
MISSING_MARKET_ID | 400 | marketId is longer than 100 characters |
MISSING_HOOK_ID | 400 | hookId is longer than 100 characters |
MARKET_NOT_FOUND | 404 | No market with this ID belongs to your instance |
HOOK_NOT_FOUND | 404 | No hook with this ID exists on this market |
⌘I
curl "https://api.trusset.org/lending-external-securities-v2/api/hooks/{marketId}/{hookId}/executions?limit=10" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/hooks/${marketId}/${hookId}/executions?limit=10&offset=0`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"executions": [
{
"id": "exec_002",
"hookId": "hook_003",
"marketId": "clx_secmarket_001",
"loanId": null,
"executionType": "monitorRisk",
"result": false,
"data": {
"fields": [
{ "path": "ageHours", "operator": "<", "threshold": 36, "value": 51, "pass": false }
]
},
"error": null,
"executedAt": "2026-09-25T06:00:00.000Z"
},
{
"id": "exec_001",
"hookId": "hook_003",
"marketId": "clx_secmarket_001",
"loanId": null,
"executionType": "monitorRisk",
"result": false,
"data": null,
"error": "Status 503",
"executedAt": "2026-09-25T00:00:00.000Z"
}
],
"total": 142,
"hasMore": true
},
"error": null,
"metadata": {
"timestamp": "2026-09-25T12:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "inst_abc123"
}
}
