Hooks
List Hooks
List every hook configured on a lending market
GET
/
lending-external-securities-v2
/
api
/
hooks
/
{marketId}
curl "https://api.trusset.org/lending-external-securities-v2/api/hooks/{marketId}" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/hooks/${marketId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"hooks": [
{
"id": "hook_001",
"marketId": "clx_secmarket_001",
"hookType": "monitorRisk",
"name": "NAV Publication Monitor",
"active": true,
"riskUri": "https://nav.example.com/funds/NYF1",
"riskFields": [{ "path": "ageHours", "operator": "<", "threshold": 36 }],
"riskThreshold": null,
"checkFrequency": "6h",
"parameterChecks": [],
"triggerHookIds": [],
"actionType": null,
"maxBuyPrice": null,
"webhookUrl": null,
"webhookPayload": null,
"signerAddress": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"signerFunded": false,
"lastExecutedAt": "2026-09-25T06:00:00.000Z",
"lastResult": true,
"executionCount": 142,
"createdAt": "2026-09-01T09:00:00.000Z",
"updatedAt": "2026-09-25T06:00:00.000Z",
"signed": true
}
]
},
"error": null,
"metadata": {
"timestamp": "2026-09-25T12:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "inst_abc123"
}
}
{
"success": false,
"data": null,
"error": {
"code": "MARKET_NOT_FOUND",
"message": "Market not found. marketId is the id of a market of this instance as GET /lending-external-securities-v2/api/markets returns it."
}
}
Returns every hook on the market, newest first. A hook is a rule Trusset stores and evaluates off-chain. It never signs or broadcasts a transaction.
Only
monitorRisk hooks run on a schedule. Liquidating a loan of the market runs its active beforeLiquidation and afterLiquidation hooks, and no hook result blocks a liquidation. An afterLiquidation hook also runs when a monitor it lists in triggerHookIds evaluates to false, and every type runs when Execute Hook is called. See When each hook type runs.
Path Parameters
string
required
Response Fields
object
Show child attributes
Show child attributes
array
Hook records ordered by
createdAt, newest first.Show child attributes
Show child attributes
string
Hook ID.
string
Market the hook belongs to.
string
monitorRisk, beforeLiquidation or afterLiquidation.string
Display name.
boolean
Whether the scheduler, liquidations and chained triggers use the hook. Execute Hook runs it either way.
string | null
URL a monitor polls.
array
Field checks applied to the
riskUri response. Each has path, and optionally operator and threshold.number | null
Stored as sent. No evaluation reads it.
string | null
A monitor’s schedule, or
null when it runs only on demand.array
Checks a
beforeLiquidation hook applies to the loan data it is given. Each has parameter, operator and threshold.string[]
Hooks whose last result must be
false before this afterLiquidation hook acts.string | null
buy or inform on an afterLiquidation hook.string | null
Price ceiling for a
buy action.string | null
Destination of an
inform action.object | null
Extra fields merged into the
inform body.boolean
true when the hook holds a signing secret, so its deliveries carry x-webhook-signature. The secret itself is never listed. See Signed deliveries, and Rotate Hook Secret to issue one.string | null
The instance’s registered wallet when the hook was created, or
null when none was registered. Informational: no run reads it.boolean
Nothing on this surface sets it, so it reads
false.string | null
Time of the last counted run, as defined under
executionCount.boolean | null
Outcome of the last counted run.
null before the first run, and after a monitor run that could not fetch or parse its riskUri. A buy run that returned steps records false.integer
Counted runs: an evaluated monitor or check, returned
buy steps, or an inform delivery once it is delivered or has failed for good. A monitor that could not fetch its riskUri also counts. Refusals, unmet triggers and skipped bids do not.string
Creation time.
string
Last change to the record, including a run.
curl "https://api.trusset.org/lending-external-securities-v2/api/hooks/{marketId}" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/hooks/${marketId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"hooks": [
{
"id": "hook_001",
"marketId": "clx_secmarket_001",
"hookType": "monitorRisk",
"name": "NAV Publication Monitor",
"active": true,
"riskUri": "https://nav.example.com/funds/NYF1",
"riskFields": [{ "path": "ageHours", "operator": "<", "threshold": 36 }],
"riskThreshold": null,
"checkFrequency": "6h",
"parameterChecks": [],
"triggerHookIds": [],
"actionType": null,
"maxBuyPrice": null,
"webhookUrl": null,
"webhookPayload": null,
"signerAddress": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"signerFunded": false,
"lastExecutedAt": "2026-09-25T06:00:00.000Z",
"lastResult": true,
"executionCount": 142,
"createdAt": "2026-09-01T09:00:00.000Z",
"updatedAt": "2026-09-25T06:00:00.000Z",
"signed": true
}
]
},
"error": null,
"metadata": {
"timestamp": "2026-09-25T12:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "inst_abc123"
}
}
{
"success": false,
"data": null,
"error": {
"code": "MARKET_NOT_FOUND",
"message": "Market not found. marketId is the id of a market of this instance as GET /lending-external-securities-v2/api/markets returns it."
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
MISSING_MARKET_ID | 400 | marketId is longer than 100 characters |
MARKET_NOT_FOUND | 404 | No market with this ID belongs to your instance |
⌘I
curl "https://api.trusset.org/lending-external-securities-v2/api/hooks/{marketId}" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/hooks/${marketId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"hooks": [
{
"id": "hook_001",
"marketId": "clx_secmarket_001",
"hookType": "monitorRisk",
"name": "NAV Publication Monitor",
"active": true,
"riskUri": "https://nav.example.com/funds/NYF1",
"riskFields": [{ "path": "ageHours", "operator": "<", "threshold": 36 }],
"riskThreshold": null,
"checkFrequency": "6h",
"parameterChecks": [],
"triggerHookIds": [],
"actionType": null,
"maxBuyPrice": null,
"webhookUrl": null,
"webhookPayload": null,
"signerAddress": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"signerFunded": false,
"lastExecutedAt": "2026-09-25T06:00:00.000Z",
"lastResult": true,
"executionCount": 142,
"createdAt": "2026-09-01T09:00:00.000Z",
"updatedAt": "2026-09-25T06:00:00.000Z",
"signed": true
}
]
},
"error": null,
"metadata": {
"timestamp": "2026-09-25T12:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "inst_abc123"
}
}
{
"success": false,
"data": null,
"error": {
"code": "MARKET_NOT_FOUND",
"message": "Market not found. marketId is the id of a market of this instance as GET /lending-external-securities-v2/api/markets returns it."
}
}
