---
title: "Create an analytics event"
method: POST
path: "/analytics/events"
tags: ["analytics"]
---

# Create an analytics event

`POST /analytics/events`

Submit a single analytics event. The event must correspond to an existing analytics rule by name.

## Request body

- AnalyticsEvent
  - `name` string, required — Name of the analytics rule this event corresponds to
  - `event_type` string, required — Type of event (e.g., click, conversion, query, visit)
  - `data` object, required — Event payload
    - `user_id` string
    - `doc_id` string
    - `doc_ids` string[]
    - `q` string
    - `analytics_tag` string

## Response `200`

Analytics event successfully created

- AnalyticsEventCreateResponse
  - `ok` boolean, required

## Other responses

- `400` — Bad request, see error message for details

## Changes

- **2025-10-14** `3bc6fc9b6132` — 1 info
  - endpoint added
- **2022-08-04** `6c2fe01b69bc` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/typesense/apis/typesense-api/changes/analytics/events/post.md)

---

[API](https://skmtc.dev/typesense/apis/typesense-api.md) · [All operations](https://skmtc.dev/typesense/apis/typesense-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/typesense/typesense-api/revisions/1d9b3b61638e/schema)
