---
title: "Ab Test"
method: POST
path: "/api/experiment/ab-test"
tags: ["Experiment"]
---

# Ab Test

`POST /api/experiment/ab-test`

Get a user's treatment for an experiment. Auth'ed user must be an owner of the organization to get a user's treatment.

## Headers

- `TR-Dataset` string, uuid, required

## Request body

- AbTestReqBody
  - `experiment_id` string, uuid, required
  - `user_id` string, required

## Response `200`

User treatment response

- UserTreatmentResponse
  - `experiment_id` string, uuid, required
  - `treatment_name` string, required
  - `user_id` string, required

## Other responses

- `400` — Service error relating to getting the user's treatment

## Changes

- **2025-05-17** `38d9edf24348` — 1 info
  - endpoint added
- **2025-04-24** `661f8d6f359b` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/devflowinc/apis/trieve-api/changes/api/experiment/ab-test/post.md)

---

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