---
title: "Send Hit Event"
method: POST
path: "/event/hit"
tags: ["Event"]
---

# Send Hit Event

`POST /event/hit`

Send a hit event to register a user view or interaction.

## Headers

- `User-Agent` string
- `Accept-Language` string

## Request body

- union — Website hit event.
  - EventLoad — Page view load event.
    - `b` string, required — Beacon ID generated for each user to link multiple events on the same page together.
    - `u` string, uri, required — Page URL including query parameters.
    - `r` string — Referrer URL.
    - `p` boolean, required — If the user is a unique user or not.
    - `q` boolean, required — If the user has visited this page before or not.
    - `t` string — Timezone of the user.
    - `d` object — Custom event properties.
  - EventUnload — Page view unload event.
    - `b` string, required — Beacon ID generated for each user to link multiple events on the same page together.
    - `m` integer, required — Time spent on page in milliseconds.
  - EventCustom — Event with custom properties.
    - `b` string — Optional Beacon ID generated for each user to link multiple events on the same page together.
    - `g` string, required — Group name of events. Currently, only the hostname is supported.
    - `d` object, required — Custom event properties.

## Response `204`

OK.

## Other responses

- `400` — 400 Bad Request.
- `404` — 404 Not Found.
- `500` — 500 Unexpected Internal Server Error.

## Changes

- **2024-09-04** `251a51c1c932` — 3 warning
  - the optional response header `X-API-Commit` removed for the status `400`
  - the optional response header `X-API-Commit` removed for the status `404`
  - the optional response header `X-API-Commit` removed for the status `500`
- **2024-09-02** `bb102f2b5cf8` — 1 info
  - added the new optional request property `oneOf[subschema #1: EventLoad]/d`
- **2024-08-04** `8b407c0621f4` — 1 breaking, 2 warning, 1 info
  - added the new required request property `oneOf[subschema #3: EventCustom]/d`
  - removed the request property `oneOf[subschema #3: EventCustom]/n`
  - removed the request property `oneOf[subschema #3: EventCustom]/p`
  - added the new optional request property `oneOf[subschema #3: EventCustom]/b`
- **2024-07-31** `54763fb045c7` — 2 info
  - added `custom` mapping keys to the request discriminator
  - added `#/components/schemas/EventCustom` to the request body `oneOf` list
- **2024-06-30** `860d419093ef` — 2 info
  - api tag `Event` added
  - api tag `event` removed

[Full history](https://skmtc.dev/medama-io/apis/medama-analytics-api/changes/event/hit/post.md)

---

[API](https://skmtc.dev/medama-io/apis/medama-analytics-api.md) · [All operations](https://skmtc.dev/medama-io/apis/medama-analytics-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/medama-io/medama-analytics-api/revisions/77bbbf562f15/schema)
