---
title: "List all segments"
method: GET
path: "/cdp/{connection_id}/segment"
tags: ["cdp", "segment"]
---

# List all segments

`GET /cdp/{connection_id}/segment`

## Request

- Base URL: `http://api.unified.to`
- URL: `http://api.unified.to/cdp/{connection_id}/segment`
- Auth: API key in header `authorization`

## Path parameters

- `connection_id` string, required

## Query parameters

- `limit` number
- `offset` number
- `updated_gte` string, date-time
- `sort` 'name' | 'updated_at' | 'created_at'
- `order` 'asc' | 'desc'
- `query` string
- `fields` string[]
- `raw` string

## Response `200`

Successful

- CdpSegment[]
  - `id` string: Unique identifier for this segment object
  - `created_at` string, date-time: The date that this segment object was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `updated_at` string, date-time: The last date that this segment object was updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `name` string: The name of the segment/audience
  - `slug` string: The data-plane handle/key used to identify segment membership in profiles and destinations
  - `description` string: The description of the segment/audience
  - `definition` string: The membership rule/query that defines the segment
  - `type` 'USERS' | 'ACCOUNTS' | 'LINKED': The type of entity the segment targets (USERS, ACCOUNTS, LINKED)
  - `compute_mode` 'REALTIME' | 'BATCH': How the segment membership is computed (REALTIME or BATCH)
  - `size` number: The number of profiles currently in the segment
  - `is_active` boolean: Whether the segment is active/enabled
  - `source_id` string: The cdp_source this segment originated from; points to CdpSource
  - `metadata` CdpMetadata[]
    - `id` string
    - `slug` string: The attribute/trait key (eg. lifetime_value)
    - `value` unknown
    - `namespace` string: The scope or origin of the attribute (eg. computed, event, visitor)
    - `format` 'TEXT' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'ARRAY' | 'OBJECT': The data type of the attribute value
    - `extra_data` unknown
  - `raw` unknown

---

[API](https://skmtc.dev/unified/apis/unified-to-api-2.md) · [All operations](https://skmtc.dev/unified/apis/unified-to-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/unified/apis/unified-to-api-2/revisions/7a38bdd7f089?raw)
