---
title: "Get top segments"
method: GET
path: "/orgs/analytics/contacts/top-segments"
tags: ["Analytics and logs"]
---

# Get top segments

`GET /orgs/analytics/contacts/top-segments`

## Request

- Base URL: `https://api.useinvent.com`
- URL: `https://api.useinvent.com/orgs/analytics/contacts/top-segments`
- Auth: HTTP bearer

Get top segments by contact count.

## Query parameters

- `from_date` string, date-time, nullable: Start of the range (ISO 8601 date). Omit for all time.
- `to_date` string, date-time, nullable: End of the range (ISO 8601 date). Omit for up to now.
- `page` number
- `take` number
- `next` string
- `progressive` boolean

## Response `200`

- ContactSegmentStatsItemSchema[]
  - `segment_id` string, required
  - `name` string, required
  - `color` 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'neutral': Accent color, by name
  - `count` number, required

---

[API](https://skmtc.dev/useinvent/apis/invent-api.md) · [All operations](https://skmtc.dev/useinvent/apis/invent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/useinvent/apis/invent-api/revisions/98824f3fde82?raw)
