---
title: "Explicitly enroll the subject into an experiment"
method: POST
path: "/v1/experiments/{key}/enroll"
tags: ["Experiments"]
---

# Explicitly enroll the subject into an experiment

`POST /v1/experiments/{key}/enroll`

Idempotent. Used both by the authenticated app and the unauthenticated funnel (the latter must pass `firebaseUid` in the body).

## Path parameters

- `key` string, required

## Request body

- EnrollExperimentDto
  - `firebaseUid` string, nullable — Required when the request is unauthenticated (funnel). Ignored when the caller is authenticated — the UID is taken from the auth context.
  - `context` object, nullable — Free-form metadata about the trigger event.

## Response `200`

- EnrollResponseDto
  - `variantId` string, nullable, required
  - `assignedAt` string, date-time, nullable

---

[API](https://skmtc.dev/miaai/apis/backend-template-api.md) · [All operations](https://skmtc.dev/miaai/apis/backend-template-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/miaai/backend-template-api/revisions/2a8d88a5124f/schema)
