---
title: "Create cohort"
method: POST
path: "/v2/cohorts"
tags: ["v2"]
---

# Create cohort

`POST /v2/cohorts`

This endpoint allows the creation of a new cohort. The query definition is provided using the Cohort API JSON query definition format.

The cohort will belong to the workspace which owns the provided API key.

## Request body

- CreateSegmentV2
  - `name` string, required
  - `description` string
  - `query` unknown, required
  - `tags` string[]
  - `segmentType` union
    - Offline
    - RealTime

## Response `201`

Cohort in full (including query)

- SegmentQueryApiV2
  - `id` string, required
  - `code` integer, required
  - `name` string, required
  - `description` string
  - `query` unknown, required
  - `tags` string[]
  - `state` 'Enabled' | 'Disabled', required
  - `workspaceId` string
  - `segmentType` union, required
    - Offline
    - RealTime
  - `createdAt` string, date-time, required
  - `lastUpdatedAt` string, date-time, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `409` — Conflict
- `500` — Internal server error

---

[API](https://skmtc.net/permutive/apis/custom-cohort-segmentation-api.md) · [All operations](https://skmtc.net/permutive/apis/custom-cohort-segmentation-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/permutive/custom-cohort-segmentation-api/versions/9fb06b4e8a44/schema)
