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

# Create Segment

`POST /segments`

Create a new segment

## Request body

- SegmentInput — Input schema for creating a new segment.
  - `name` string, required — A human-readable name for the segment.
  - `description` string — An optional free-form description of the segment, shown alongside its name when picking an email's audience.
  - `filters` EmailFilterGroup, required
    - `filters` EmailFilter[], required — The leaf-level filters to apply to the audience.
      - `field` union, required — The subscriber attribute to evaluate. Must be a recognized field or a `subscriber.metadata.*` path.
        - 'subscriber.churn_date' | 'subscriber.click_rate' | 'subscriber.last_click_date' | 'subscriber.last_open_date' | 'subscriber.open_rate' | 'subscriber.price' | 'subscriber.source' | 'subscriber.status' | 'subscriber.subscription_date' | 'subscriber.tags' | 'subscriber.upgrade_date'
        - string
      - `operator` 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'is_empty' | 'is_not_empty' | 'greater_than' | 'less_than', required — An enumeration.
      - `value` string, required — The value to compare the field against.
    - `groups` EmailFilterGroup[], required — The nested groups to apply to the audience.
    - `predicate` 'and' | 'or', required — The logical operator to use when combining filters.

## Response `201`

Created

- Segment — A saved, reusable audience — a named set of subscriber filters that can be applied as the audience of an email.
  - `id` string, required — A unique TypeID associated with the object.
  - `creation_date` string, date-time, required — The date and time at which the object was first created.
  - `name` string, required — A human-readable name for the segment.
  - `description` string, required — An optional free-form description of the segment, shown alongside its name when picking an email's audience.
  - `filters` EmailFilterGroup, required
    - `filters` EmailFilter[], required — The leaf-level filters to apply to the audience.
      - `field` union, required — The subscriber attribute to evaluate. Must be a recognized field or a `subscriber.metadata.*` path.
        - 'subscriber.churn_date' | 'subscriber.click_rate' | 'subscriber.last_click_date' | 'subscriber.last_open_date' | 'subscriber.open_rate' | 'subscriber.price' | 'subscriber.source' | 'subscriber.status' | 'subscriber.subscription_date' | 'subscriber.tags' | 'subscriber.upgrade_date'
        - string
      - `operator` 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'is_empty' | 'is_not_empty' | 'greater_than' | 'less_than', required — An enumeration.
      - `value` string, required — The value to compare the field against.
    - `groups` EmailFilterGroup[], required — The nested groups to apply to the audience.
    - `predicate` 'and' | 'or', required — The logical operator to use when combining filters.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `422` — Unprocessable Entity
- `429` — Too Many Requests

---

[API](https://skmtc.net/buttondown/apis/buttondown-api.md) · [All operations](https://skmtc.net/buttondown/apis/buttondown-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/buttondown/buttondown-api/versions/3a702c095d22/schema)
