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

# Segments

> Manage audience segments from the terminal with the Formo CLI. Create segments with filter rules, list existing segments, and delete segments by ID.

The `formo segments` command group lets you manage user segments. Segments are saved audience filter sets that you can use throughout the Formo platform.

## `formo segments list`

List all user segments for the project.

<Note>
  Requires `segments:read` scope on your API key.
</Note>

```bash theme={null}
formo segments list
```

***

## `formo segments create`

Create a new user segment.

<Note>
  Requires `segments:write` scope on your API key.
</Note>

### Options

| Option          | Type     | Required | Description                                           |
| --------------- | -------- | -------- | ----------------------------------------------------- |
| `--title`       | `string` | ✅        | Segment title                                         |
| `--filter-sets` | `string` | ✅        | JSON array of filter set strings defining the segment |

### Examples

```bash theme={null}
# Create a high-value segment
formo segments create \
  --title "Whales" \
  --filter-sets '["net_worth_usd > 100000"]'

# Create a power-user segment
formo segments create \
  --title "Power Users" \
  --filter-sets '["tx_count > 100", "num_sessions > 10"]'
```

***

## `formo segments delete`

Delete a user segment.

<Note>
  Requires `segments:write` scope on your API key.
</Note>

### Arguments

| Argument    | Type     | Required | Description          |
| ----------- | -------- | -------- | -------------------- |
| `segmentId` | `string` | ✅        | Segment ID to delete |

```bash theme={null}
formo segments delete seg_abc123
```

<Warning>
  Deleting a segment is permanent.
</Warning>
