Create targeting rule
Flag Targeting Rules
Create targeting rule
Create a new targeting rule for a flag in an environment.
Access: Org Admins or Editors only.
Rule types:
segment: Matches users in a specific segment (requires segment_id)custom: Matches users based on custom conditions (requires conditions array)
Important:
- For segment rules: provide segment_id, do not provide conditions
- For custom rules: provide conditions array, do not provide segment_id
- Conditions use AND semantics (all must match)
- The serve field determines what value is returned when the rule matches
POST
Create targeting rule
Documentation Index
Fetch the complete documentation index at: https://docs.flagmint.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Type of rule: segment-based or custom conditions
Available options:
segment Human-readable name for the rule
Required when kind="custom". Array of conditions (AND semantics)
ID of flag_variations row when this rule matches.
ID of flag_rollouts row to use when this rule matches.
Order in which rules are evaluated (lower = higher priority). Defaults to 0