Create a new 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

HeaderValue
AuthorizationBearer <token>
Content-Typeapplication/json

Request Body

FieldTypeRequiredDescription
typestringYesWhen 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).
targetstringYesWhere the hook applies. One of: search, recommendation.
urlstringYesThe URL of the external webhook endpoint that will receive and process the hook request.
priorityintegerNoExecution 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
}
Body Params
integer

The priority of the hook, if we have multiple hooks of a same type, the one with higher priority will be executed first

string
enum

The type of the webhook, it will determine when the hook is executed

Allowed:
string
enum

The target of the webhook, it will determine where the hook is executed

Allowed:
string

The url of the webhook, where the result of search/recommendation is modified

Headers
string
required

Makaira Instance ID

Response
200

Created

Language
Credentials
Bearer
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here!