Hooks
View list of hooks by type
List hooks by type with the Go SDK.
GET
/hooksUse client.Hooks.List to fetch registered webhooks, optionally filtered by type.
Call the method
hooks, _, _ := client.Hooks.List(
&blnkgo.ListHooksOptions{
Type: blnkgo.HookTypePreTransaction,
},
)
| Field | Type | Description |
|---|---|---|
options.Type | blnkgo.HookType | Optional filter: blnkgo.HookTypePreTransaction or blnkgo.HookTypePostTransaction. Pass nil to list all hooks. |
Use the hook list
Iterate over hooks to find hooks by type or active status. Save hook IDs you need for updates or deletion.
Response
[
{
"id": "hk_890bdbc4-467f-4670-8424-5667e41daf29",
"name": "Pre-transaction validation",
"url": "https://api.example.com/validate",
"type": "PRE_TRANSACTION",
"active": true,
"timeout": 30,
"retry_count": 3,
"created_at": "2024-11-26T08:36:36.238244338Z",
"last_run": "2024-11-26T09:12:00.000000000Z",
"last_success": true
}
]Go response ([]blnkgo.HookResponse)
| Field | Type | Description |
|---|---|---|
| return value | []blnkgo.HookResponse | Slice of hook records returned by Core. |
[].ID | string | Unique hook ID. |
[].Type | blnkgo.HookType | Hook timing, such as PRE_TRANSACTION or POST_TRANSACTION. |
[].Active | bool | Whether the hook is enabled. |