> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hibonsai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hits

> Track search hits and user interaction events

## Endpoint

`POST /rest/hits/`

## Request Body Parameters

<ParamField body="organization" type="string" required>
  Organization UUID associated with the event.
</ParamField>

<ParamField body="eventDate" type="timestamp" required>
  ISO 8601 event timestamp.
</ParamField>

<ParamField body="classification" type="string" required>
  Event classification (for example, `search`).
</ParamField>

<ParamField body="method" type="string">
  HTTP method of the request (for example, `GET`, `POST`).
</ParamField>

<ParamField body="path" type="string">
  Request path (for example, `/search`).
</ParamField>

<ParamField body="url" type="string">
  Full URL of the request including query parameters.
</ParamField>

<ParamField body="userAgent" type="string">
  User agent string from the request header.
</ParamField>

<ParamField body="clientIp" type="string">
  IP address of the client making the request.
</ParamField>

<ParamField body="botScore" type="number">
  Bot detection score between 0 and 1. Higher values indicate greater likelihood of bot traffic.
</ParamField>

<ParamField body="verifiedBot" type="boolean">
  Whether the request is from a verified bot (for example, search engine crawlers).
</ParamField>

<ParamField body="headers" type="object">
  Request headers object.
</ParamField>

<ParamField body="cf" type="object">
  Cloudflare-specific metadata object.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.hibonsai.com/rest/hits/" \
    -H "X-API-Key: YOUR_API_KEY_HERE" \
    -H "Content-Type: application/json" \
    -d '{"organization":"organization-uuid","eventDate":"2024-01-01T00:00:00Z","classification":"search"}'
  ```
</RequestExample>

<RequestExample>
  ```json Request body theme={null}
  {
    "organization": "organization-uuid",
    "eventDate": "2024-01-01T00:00:00Z",
    "method": "GET",
    "path": "/search",
    "url": "https://example.com/search?q=query",
    "userAgent": "Mozilla/5.0...",
    "classification": "search",
    "clientIp": "192.168.1.1",
    "botScore": 0.95,
    "verifiedBot": false,
    "headers": {},
    "cf": {}
  }
  ```
</RequestExample>

## Response

Returns the created hit record with `id`, `createdAt`, and `updatedAt` fields.
