---
title: "Create cohort"
method: POST
path: "/experiments/{experimentId}/cohorts"
tags: ["cohorts"]
---

# Create cohort

`POST /experiments/{experimentId}/cohorts`

Create a new cohort within an experiment.

The cohort will be initialized with:
- Public stage data for all stages
- Generated variables based on experiment's variableConfigs
- Stage unlock map based on stage progression requirements
- Mediators assigned to the cohort

## Path parameters

- `experimentId` string, required

## Request body

- object
  - `name` string, required — Cohort name
  - `description` string — Cohort description
  - `participantConfig` CohortParticipantConfig — Configuration for participants within a cohort
    - `minParticipantsPerCohort` integer — Minimum number of participants required
    - `maxParticipantsPerCohort` integer — Maximum number of participants allowed
    - `includeAllStagesInProgressBar` boolean — Whether to show all stages in the progress bar
    - `enableParticipantStageReset` boolean — Whether participants can reset stages
    - `showStageDescriptions` boolean — Whether to show stage descriptions to participants

## Response `201`

Cohort created successfully

- object
  - `cohort` Cohort — Cohort configuration
    - `id` string — Unique cohort identifier
    - `metadata` Metadata — Experiment metadata
      - `name` string — Experiment name
      - `publicName` string — Public-facing experiment name
      - `description` string — Experiment description
      - `tags` string[] — Tags for categorization
      - `creator` string — Experimenter ID who created the experiment
      - `starred` object — Maps experimenter IDs to starred status
      - `dateCreated` object — Firestore timestamp
      - `dateModified` object — Firestore timestamp
    - `participantConfig` CohortParticipantConfig — Configuration for participants within a cohort
      - `minParticipantsPerCohort` integer — Minimum number of participants required
      - `maxParticipantsPerCohort` integer — Maximum number of participants allowed
      - `includeAllStagesInProgressBar` boolean — Whether to show all stages in the progress bar
      - `enableParticipantStageReset` boolean — Whether participants can reset stages
      - `showStageDescriptions` boolean — Whether to show stage descriptions to participants
    - `stageUnlockMap` object — Maps stage ID to unlock status (managed internally)
    - `variableMap` object — Generated cohort-level variables (managed internally based on experiment's variableConfigs)

## Other responses

- `400` — Bad request - Invalid input
- `401` — Unauthorized - Missing or invalid API key
- `403` — Forbidden - Insufficient permissions or browser access attempted
- `404` — Not found - Resource doesn't exist
- `429` — Too many requests - Rate limit exceeded

---

[API](https://skmtc.net/pair-code/apis/deliberate-lab-api.md) · [All operations](https://skmtc.net/pair-code/apis/deliberate-lab-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pair-code/deliberate-lab-api/revisions/f58e6c25e4f8/schema)
