---
title: "Track event for the given user."
method: POST
path: "/v1/track"
---

# Track event for the given user.

`POST /v1/track`

Send event and user details to Optimizely analytics backend, so you can see metrics for an experiment. You can view metrics either on your Results page or as a data export.

## Query parameters

- `eventKey` string, required

## Request body

- TrackContext
  - `eventTags` object
  - `userId` string
  - `userAttributes` object

## Response `200`

Valid response, event received

## Other responses

- `400` — Missing required parameters
- `401` — Unauthorized, invalid JWT
- `403` — You do not have necessary permissions for the resource

## Changes

- **2023-05-22** `b03cfe30eb69` — 2 breaking, 1 warning, 3 info
  - added the new required `query` request parameter `eventKey`
  - the request's body type/format changed from ``/`` to `object`/``
  - removed the optional property `error` from the response with the `403` status
  - added the media type `application/json` for the response with the status `200`
  - …2 more
- **2020-06-16** `aac6eef614eb` — 1 breaking, 1 info
  - removed the success response with the status `204`
  - added the success response with the status `200`
- **2020-03-24** `d515599808b8` — 1 info
  - removed the non-success response with the status `404`
- **2020-03-05** `cb780f560047` — 1 info
  - added the non-success response with the status `401`
- **2020-02-24** `a28eaa365557` — 1 info
  - added the non-success response with the status `400`

[Full history](https://skmtc.dev/optimizely/apis/optimizely-agent-api/changes/v1/track/post.md)

---

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