Replace targeting rules
update_targetingReplace a flag's full ordered targeting rules in one environment; pass the etag so concurrent edits aren't overwritten and omitted rules are removed.
Instructions
REPLACE all targeting rules of a flag in one environment (full PUT — rules not included are removed). Rules are evaluated in order. Get the current rules first with get_targeting. Pass ifMatch (the etag from get_targeting) so rules someone else changed meanwhile are not overwritten.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flag | Yes | Flag key or id | |
| rules | Yes | The complete ordered rule list; rules left out are deleted | |
| ifMatch | No | etag from get_targeting. The write is refused with 412 if the resource changed since that read; re-read and re-apply. Omit to write unconditionally. | |
| project | Yes | Project key | |
| environment | Yes | Environment key, e.g. production |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| etag | No | ETag of what this write left behind. Pass it as ifMatch on the next update to chain writes without re-reading. Absent when the API sent none; read the resource again before the next conditional write. | |
| flag | Yes | ||
| project | Yes | ||
| environment | Yes | ||
| rulesReplaced | Yes |