> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a segment

> Create a segment

### Request body

`CreateSegmentRequest`

<ParamField body="description" type="string,null" />

<ParamField body="name" type="string" required />

<ParamField body="segment_type" type="string,null" />

### Responses

<ResponseField name="201" type="SegmentResponse" />

<ResponseField name="400" type="ErrorBody" />

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.stateset.com/api/v1/segments' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "description": null,
    "name": "string",
    "segment_type": null
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "created_at": "string",
    "id": "string",
    "member_count": 1,
    "name": "string",
    "segment_type": "string"
  }
  ```
</ResponseExample>
