# Segment

### Definition

A segment in Reflag is a dynamic audience built from companies, users, or both together.

Segments use [filters](/product-handbook/concepts/filter.md) to evaluate which companies and users are included.

### Filters

Segment filters can be constructed using any combination of the following rules:

* [company attributes](/product-handbook/concepts/company.md#attributes)
* [user attributes](/product-handbook/concepts/user.md)
* [flag access](/product-handbook/concepts/feature.md#access)
* [flag metrics](/product-handbook/concepts/feature.md#metrics)
* other segments

{% hint style="info" %}
Segments with a filter that uses `First Seen`, `Last Seen`, or flag metric rules cannot be used in [targeting rules](/product-handbook/concepts/targeting-rules.md). Segments that depend on those segments also cannot be used in targeting rules.
{% endhint %}

### Environments

All segments in Reflag are [app](/product-handbook/concepts/app.md)-wide. This means the same segment shares the same settings, including filters, across all [environments](/product-handbook/concepts/environment.md) in the app.

It is up to you to populate each environment with the right company and user data so segments evaluate correctly. Another option is to create separate segments for different environments.

### Next steps

* Learn about [users](/product-handbook/concepts/user.md), [filters](/product-handbook/concepts/filter.md), and [targeting rules](/product-handbook/concepts/targeting-rules.md).
* Learn how to [create segments](/product-handbook/creating-segments.md) in Reflag.


---

# 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/concepts/segment.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.
