---
title: "Experiment Assign"
method: POST
path: "/v1/experiments/assign"
---

# Experiment Assign

`POST /v1/experiments/assign`

## Request

- Base URL: `https://api.storyflo.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.storyflo.com/v1/experiments/assign`
- Auth: none declared

Return the sticky variant assignment for a subject. Creates one
on first call (deterministic hash → variant index), reads the
existing row on subsequent calls so the listener never flickers
between variants.

Subject hashing:
  - listener_token (when present) → primary key
  - request IP hash (otherwise) → anonymous fallback

Variants are caller-supplied so the same endpoint serves any
experiment without server-side config — keeps the framework
homegrown and dead-simple.

## Request body

- AssignBody
  - `experiment_key` string, required
  - `variants` string[], required
  - `listener_token` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/storyflo/apis/storyflo-inference-router.md) · [All operations](https://skmtc.dev/storyflo/apis/storyflo-inference-router/llms.txt) · [OpenAPI document](https://skmtc.dev/storyflo/apis/storyflo-inference-router/revisions/c3a1a735ac7a?raw)
