---
title: "Create segment"
method: POST
path: "/segments/"
tags: ["segments"]
---

# Create segment

`POST /segments/`

## Request

- Base URL: `https://api.hive.co/v2`
- URL: `https://api.hive.co/v2/segments/`
- Auth: HTTP bearer

Create a new segment for the authorized brand. Segment names must be unique within the brand.

## Headers

- `X-Partner-Id` string, required

## Request body

- CreateSegmentRequest
  - `name` string, required
  - `description` string, nullable

## Response `201`

- Segment
  - `id` string, required
  - `name` string, required
  - `description` string
  - `time_created` string, date-time, required

## Other responses

- `409`: A segment with this name already exists.
- `422`: Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.

---

[API](https://skmtc.dev/hive-co/apis/hive-api.md) - [All operations](https://skmtc.dev/hive-co/apis/hive-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hive-co/apis/hive-api/revisions/aa145f089347?raw)
