Hooks
Delete Hook
Delete a hook and its execution history
DELETE
/
lending-external-securities-v2
/
api
/
hooks
/
{marketId}
/
{hookId}
curl -X DELETE "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}`,
{ method: 'DELETE', headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": { "deleted": true },
"error": null,
"metadata": {
"timestamp": "2026-09-25T12:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "inst_abc123"
}
}
Permanently removes the hook, every execution record written against it, and its deliveries, including any not yet sent, which are then never sent. This cannot be undone. To stop a hook without losing its history, use Toggle Hook instead.
Other hooks that list the deleted hook in
triggerHookIds keep its ID. An afterLiquidation hook with a deleted trigger never acts again, because its trigger check finds fewer hooks than it lists and records Trigger condition not met. Remove the ID from those hooks with Update Hook.Path Parameters
string
required
string
required
Hook ID.
Response Fields
curl -X DELETE "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}`,
{ method: 'DELETE', headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": { "deleted": 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 -X DELETE "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}`,
{ method: 'DELETE', headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": { "deleted": true },
"error": null,
"metadata": {
"timestamp": "2026-09-25T12:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "inst_abc123"
}
}
