post
https://{yourinstance}.makaira.io/search-query-hook
Creates a new search query hook. Search query hooks allow an external webhook URL to intercept and modify search requests or results at different stages of the search pipeline.
Requires authentication.
Request
POST /search-query-hook
Headers
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Content-Type | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | When the hook is executed. One of: pre-search (before the search query is sent), post-search (after results are returned), modify-result (to transform the result). |
target | string | Yes | Where the hook applies. One of: search, recommendation. |
url | string | Yes | The URL of the external webhook endpoint that will receive and process the hook request. |
priority | integer | No | Execution priority when multiple hooks of the same type are configured. Higher values execute first. |
Example Request
{
"type": "post-search",
"target": "search",
"url": "https://my-service.example.com/hooks/search",
"priority": 10
}Response
Returns the created search query hook object.
Example Response
{
"id": 3,
"type": "post-search",
"target": "search",
"url": "https://my-service.example.com/hooks/search",
"priority": 10
} 200Created

