---
title: "Create a segment"
method: POST
path: "/businesses/{id}/segments"
tags: ["Segments"]
---

# Create a segment

`POST /businesses/{id}/segments`

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string, required — The name of the segment
  - `static_customers` string[] — A list of customer IDs to always include in this segment
  - `customers` string[] — A list of customer IDs to include in this segment
  - `filter` string, nullable — The filter for this segment
  - `description` string, nullable — A plain-English description of the segment using bullet-point markdown
  - `metadata` object — Metadata attached to this segment

## Response `200`

The created `Segment` object

- Segment
  - `id` string, required — The ID of the segment
  - `name` string, required — The name of the segment
  - `filter` string, nullable, required — The filter for this segment
  - `description` string, nullable, required — A Markdown description of the filter
  - `metadata` object — Metadata attached to this segment
  - `static_customers` string[] — The customers that are always included in this segment

---

[API](https://skmtc.dev/pocketflows/apis/pocketflows-api.md) · [All operations](https://skmtc.dev/pocketflows/apis/pocketflows-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pocketflows/pocketflows-api/revisions/26723490b96f/schema)
