Skip to content

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.

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.plan or attrs.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.

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).

  • Values compare as strings, so attrs.seats eq "10" matches the number 10, and true matches the boolean true.
  • 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. neq and nin don’t match users who lack the attribute.

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.