---
title: "Update cohort"
method: PATCH
path: "/v2/cohorts/{cohortId}"
tags: ["v2"]
---

# Update cohort

`PATCH /v2/cohorts/{cohortId}`

This endpoint allows updating an existing cohort. Depending on the access level of the provided API key, it can update cohorts owned by the requesting workspace, or also by child workspaces below the requesting workspace in the organization hierarchy. Lookalike-based cohorts cannot be updated via the Cohort API.

Any top level fields for which no value is provided in the request body will remain unchanged. Optional fields (currently only `description`) can be deleted by explicitly specifying `null` as the value.

## Path parameters

- `cohortId` string, required

## Request body

- UpdateSegmentV2
  - `name` string
  - `description` string, nullable
  - `query` unknown
  - `tags` string[]
  - `state` 'Enabled' | 'Disabled'

## Response `200`

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)
