> ## 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 filters 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>

### Options

| Option | Type | Required | Description |
| - | - | - | - |
| `--page` | `number` | ❌ | Page number, 1-indexed |
| `--size` | `number` | ❌ | Page size |

```bash theme={null}
formo segments list --size 25
```

***

## `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 |
| `--filters` | `string` | ✅ | JSON array of canonical `{field, op, value}` filter objects |

### Examples

```bash theme={null}
# Create a high-value segment
formo segments create \
  --title "Whales" \
  --filters '[{"field":"net_worth_usd","op":"gt","value":100000}]'

# Create a power-user segment
formo segments create \
  --title "Power Users" \
  --filters '[{"field":"tx_count","op":"gt","value":100},{"field":"num_sessions","op":"gt","value":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>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.