Create a routing rule
Send matching community activity into a Slack channel, or as a direct message to one person on your team (destination_user_id, or destination_user_email, instead of destination_channel_id). A **segment rule** — event_types segment.entered / segment.left and filter.segment, no source — posts the member card when somebody enters or leaves that segment. This is the one tool in Datum that makes the software *write* somewhere a customer can see, so it needs the admin scope and it checks before it agrees: the destination must be a Slack Web API connection whose token holds chat:write — plus im:write when the rule names a person — and a rule that cannot post is refused with the scope and the reinstall step named rather than created and left silently broken. Create it with enabled false to save a draft before its token is ready. Disabled drafts still require an existing Slack Web API connection. Two defaults are worth knowing: no event types means every type the source reports, and not_team is on, so the workspace’s own staff are left out unless you say otherwise.
Parameters
What to call it. Names are how people address a rule.
The source whose activity to watch: github, slack, discourse, csv, generic (Push API: webhooks and pushes), and the other source kinds. Omit for a segment rule, a member watch, or a rule with organisation_tags across all sources.
Event types to match, e.g. ["issue_opened"]. Omit for every type the source reports — which is what somebody who has not thought about types yet means. ["segment.entered", "segment.left"] (either or both) makes a segment rule, with filter.segment naming the segment.
The narrowing clauses. Every clause set must hold (they are ANDed) and each list matches if any of its values does (an OR). An unrecognised key is refused rather than stored, so a typo fails at this call instead of silently matching nothing.
Unanswered community thread roots older than after_hours (1–168), excluding handled threads. Evaluated every five minutes; null thread references never match.
Any of these tags on the actor’s derived organisations, by case-insensitive name or id. Source may be omitted to watch all sources.
Any of these event tone labels. Unjudged events, and labels under 0.5 confidence (unclear), never match.
Any of these activity thread tags, by name or id; not actor tags.
Slack channels this rule cares about, by id (C…) or by name (support, or #support). Ids are what the channel picker stores, because a renamed channel keeps its id.
Discourse categories, by numeric id or by name.
GitHub repositories, as owner/name.
Only people carrying one of these tags. Case-insensitive. Tags are the community’s own labels, so this is how "tell me when a champion does anything" is expressed.
Leave the workspace’s own staff out. **On unless you turn it off** — a channel that also relays your colleagues talking to each other is one people mute, and a muted channel is a routing rule that has stopped working.
Only somebody’s first activity on this source. The "a new person just showed up" rule. Asked of the person, not the account, so a second account we have just matched to somebody who has been here a year is not announced as new.
Only this member, following merges. Source may be omitted to watch all sources. Cannot combine with a segment trigger.
The segment a **segment rule** watches, by id or name (stored as the id): with event_types segment.entered and/or segment.left, the rule posts the member card — never message text — when somebody enters or leaves it. Only with those event types, and they only with it; a segment rule takes not_team and tags and no source clause.
The Slack Web API connection (kind slack) that will post. A slack-export import is a ZIP file and cannot; list_connections shows which is which.
The channel to post in, as Slack’s C… id. list_discovered_targets on the Slack connection lists the public channels with their ids. Give this or destination_user_id, not both.
The channel’s name, for the screen. Nothing routes on it.
A person to direct-message instead of a channel, as Slack’s U…/W… id — list_discovered_targets lists them beside the channels. The connection needs the im:write scope, and a rule that would need it is refused at this call rather than at its first delivery.
A person to direct-message, by their address instead of their Slack id: resolved against the graph to a member of **your team** with a Slack account on this connection. An address that is not the team’s resolves to nobody and is refused — a rule never DMs the community.
That person’s handle, for the screen. Nothing routes on it.
Replace the message’s headline. The rest of the card is unchanged.
Defaults to true. A rule created disabled skips the Slack scope check, which is how you save one before the app exists.
CLI flags
The source to watch: self, github, slack, discourse, vanilla, bevy, gainsight-cc, gradual, bettermode, circle, flarum, verint, dev, stackoverflow, meetup, luma, discord, generic, csv, enrichment. generic means Push API (webhooks and pushes)
Watch a segment instead of a source: post the member card when somebody enters or leaves it (event types segment.entered,segment.left by default)
Only this member, across sources unless --source narrows it
The Slack connection that will post
The channel to post in (Slack’s C… id)
The channel’s name, for the screen
Direct-message this person instead (Slack’s U… id)
The same, resolved through this connection’s member list
That person’s handle, for the screen
Comma-separated; omit for every type the source reports
Narrowing clauses, e.g. '{"repo_names":["acme/widgets"]}'
Replace the message’s headline
Save it switched off (skips the Slack scope check)