# Creating segments

## What's a segment?

Segments are reusable lists of companies created based off one of more of the following:

* [Company attributes](/product-handbook/concepts/company.md#attributes)
* Flag access
* Flag metrics
* Feature feedback

Company segments can be used as access rule for managing flag access.

## Getting started <a href="#get-started" id="get-started"></a>

* Go to the `Companies` page on the sidebar
* Click on the `Add filter +` menu item to build your segment conditions

## Set segment conditions

Each segment is created using a set of conditions. You can add as many segmentation conditions as you’d like.

### Conditions

There are 4 types of conditions:

* `Company attribute`
  * `Company ID`
  * `First seen`
  * `Last seen`
  * `any custom attributes`
* `Flag access`
  * `is enabled`
  * `is not enabled`
* `Flag metric`
  * `Track count`
  * `Exposure count`
  * `First track`
  * `Last track`
* `Segment`
  * `in Segment`
  * `not in Segment`

<figure><img src="/files/RezWuBh7oFWytmI7vPc8" alt="Using feature filters to create segments"><figcaption></figcaption></figure>

### **Operators**

* Any
  * `Is`
  * `Is not`
  * `Has any value`
  * `Has no value`
* Text
  * `Contains`
  * `Does not contain`
* List
  * `Is any of`
  * `Is not any of`
* Number
  * `Less than`
  * `Greater than`
* Boolean
  * `Is true`
  * `Is false`
* Date
  * `Less than X days ago`
  * `More than X days ago`
  * `Before date X`
  * `After date X`
* Flag access
  * `Is enabled`
  * `Is not enabled`
* Segment
  * `In segment`
  * `Not in segment`

## Save the segment

After adding any applicable conditions, you can save the segment. You can create as many segments as you need.

<figure><img src="/files/Pl76orcjGTbgds6BVUEC" alt="Saving a segment"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.reflag.com/product-handbook/creating-segments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
