Targeting
By default an announcement is for everyone. In the editor’s Audience panel you can limit it to users whose claims match a set of conditions. Targeting applies to the in-app feed; targeted announcements are also left out of the public changelog. Email goes to the Loops list or segment you pick for it instead.
Claims
Section titled “Claims”Conditions test the user’s claims:
org: the organization from the token (org) or from the server API (orgId).attrs.<name>: a custom attribute, with dots for nested values, e.g.attrs.planorattrs.company.size.
Browser users get their claims from the signed token. Users you
create with the server API use the orgId and attrs stored there.
Operators
Section titled “Operators”| Operator | Value | Matches when the claim… |
|---|---|---|
eq |
one value | equals the value. |
neq |
one value | is present and doesn’t equal the value. |
in |
a list of values | equals one of them. |
nin |
a list of values | is present and equals none of them. |
exists |
none | is present. |
Conditions combine with all (every condition matches) or any (at least one does).
How values compare
Section titled “How values compare”- Values compare as strings, so
attrs.seats eq "10"matches the number10, andtruematches the booleantrue. - If an attribute is a list, it matches when any of its items does:
attrs.roles in ["admin"]matches{ "roles": ["admin", "billing"] }. - A missing claim never matches, whatever the operator.
neqandnindon’t match users who lack the attribute.
As JSON
Section titled “As JSON”The API represents targeting like this (null means everyone):
{ "match": "all", "conditions": [ { "claim": "attrs.plan", "op": "in", "value": ["pro", "enterprise"] }, { "claim": "org", "op": "neq", "value": "org_internal" } ]}An announcement can have up to 20 conditions, and a list up to 100 values.