Hooks
Get Hook
Retrieve a single hook by ID
GET
/
lending-external-securities-v2
/
api
/
hooks
/
{marketId}
/
{hookId}
curl "https://api.trusset.org/lending-external-securities-v2/api/hooks/{marketId}/{hookId}" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/hooks/${marketId}/${hookId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data: hook } = await res.json();
{
"success": true,
"data": {
"id": "hook_002",
"marketId": "clx_secmarket_001",
"hookType": "beforeLiquidation",
"name": "Pre-Liquidation Check",
"active": true,
"riskUri": null,
"riskFields": [],
"riskThreshold": null,
"checkFrequency": null,
"parameterChecks": [
{ "parameter": "healthFactor", "operator": "<", "threshold": "0.95" }
],
"triggerHookIds": [],
"actionType": null,
"maxBuyPrice": null,
"webhookUrl": null,
"webhookPayload": null,
"signerAddress": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"signerFunded": false,
"lastExecutedAt": null,
"lastResult": null,
"executionCount": 0,
"createdAt": "2026-09-02T10:15:00.000Z",
"updatedAt": "2026-09-02T10:15: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": "HOOK_NOT_FOUND",
"message": "Hook not found"
}
}
Returns one hook record, with the fields List Hooks documents. The hook must belong to the market named in the path. A hook on another market returns
HOOK_NOT_FOUND, as an unknown ID does.
Path Parameters
string
required
string
required
Hook ID.
Response Fields
object
The hook record. See List Hooks for each field.
curl "https://api.trusset.org/lending-external-securities-v2/api/hooks/{marketId}/{hookId}" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/hooks/${marketId}/${hookId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data: hook } = await res.json();
{
"success": true,
"data": {
"id": "hook_002",
"marketId": "clx_secmarket_001",
"hookType": "beforeLiquidation",
"name": "Pre-Liquidation Check",
"active": true,
"riskUri": null,
"riskFields": [],
"riskThreshold": null,
"checkFrequency": null,
"parameterChecks": [
{ "parameter": "healthFactor", "operator": "<", "threshold": "0.95" }
],
"triggerHookIds": [],
"actionType": null,
"maxBuyPrice": null,
"webhookUrl": null,
"webhookPayload": null,
"signerAddress": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"signerFunded": false,
"lastExecutedAt": null,
"lastResult": null,
"executionCount": 0,
"createdAt": "2026-09-02T10:15:00.000Z",
"updatedAt": "2026-09-02T10:15: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": "HOOK_NOT_FOUND",
"message": "Hook not found"
}
}
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}" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/hooks/${marketId}/${hookId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data: hook } = await res.json();
{
"success": true,
"data": {
"id": "hook_002",
"marketId": "clx_secmarket_001",
"hookType": "beforeLiquidation",
"name": "Pre-Liquidation Check",
"active": true,
"riskUri": null,
"riskFields": [],
"riskThreshold": null,
"checkFrequency": null,
"parameterChecks": [
{ "parameter": "healthFactor", "operator": "<", "threshold": "0.95" }
],
"triggerHookIds": [],
"actionType": null,
"maxBuyPrice": null,
"webhookUrl": null,
"webhookPayload": null,
"signerAddress": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"signerFunded": false,
"lastExecutedAt": null,
"lastResult": null,
"executionCount": 0,
"createdAt": "2026-09-02T10:15:00.000Z",
"updatedAt": "2026-09-02T10:15: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": "HOOK_NOT_FOUND",
"message": "Hook not found"
}
}
