---
title: "Segment user based on provided events and pre-existing state"
method: POST
path: "/ccs/v1/segmentation"
tags: ["API version 1"]
---

# Segment user based on provided events and pre-existing state

`POST /ccs/v1/segmentation`

This endpoint accepts a list of events for a given user and combines them with any pre-existing state for the user to determine the full list of cohorts of which they are a member. State is also persisted, to be applied to subsequent requests for the same user.

Events provided to this endpoint are published to the Permutive Events API, meaning that they will be reflected in other areas of Permutive, for example Insights.

## Query parameters

- `activations` boolean
- `synchronous-validation` boolean

## Request body

- SegmentationRequest
  - `user_id` string, uuid
  - `alias` Alias
    - `tag` string, required
    - `id` string, required
  - `aliases` PrioritisedAlias[]
    - `priority` integer, required
    - `tag` string, required
    - `id` string, required
  - `events` Event[]
    - `name` string, required
    - `time` string, date-time, required
    - `view_id` string, uuid
    - `session_id` string, uuid
    - `properties` JsonObject, required

## Response `200`

List of cohorts of which the user is currently a member, along with the Permutive User ID and activations if requested

- SegmentationResponse
  - `user_id` string, uuid, required
  - `cohorts` string[]
  - `activations` MapSeqString

## Other responses

- `400`
- `401`
- `403`
- `500`

---

[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)
