Segment Lists are currently in beta. Share feedback on our Slack community or at support@suprsend.com.
users and events data you already send to SuprSend, and the list auto-refreshes as your data changes. Also known as dynamic audiences or SQL segments in other tools.
Define the criteria once, and the list stays in sync with your live user and event data. You can write the SQL yourself, or describe the segment in plain English and let the SuprSend Agent generate the query for you.
How it works
You write a SQL query that returnsdistinct_ids. SuprSend runs that query against your workspace’s users and events tables, and everyone the query returns becomes a member of the list. Commit a version, and the list is ready to power broadcasts and workflow triggers.
Two tables are exposed to your SQL:
users— one row per user in your workspace, withdistinct_id, channel arrays (email, phone, push), and your custom user properties as JSON.events— one row per event you’ve sent to SuprSend, withevent_name,distinct_id,requested_at, and the event payload as JSON.
live; older versions stay in history and you can roll back to any of them from the dashboard. Rolling back creates a new version — the audit trail is preserved. Queries are scoped to your workspace by the API key on the request; there is no cross-workspace access.
Setting up a segment
1. Create the list
Go to Lists → New List. In the source picker, select Segment List.
list_id, and optionally a name and description. The list_id is the stable identifier you’ll reference from the API and workflows.

2. Write your SQL or generate it with AI
After the list is created, you land in the Segment Builder — a SQL editor on the left, a schema panel on the right, and a Generate with AI button in the toolbar. Write the SQL yourself using the reference below, or click Generate with AI and describe the segment in plain English.
users and events — using a PostgreSQL- and ClickHouse-compatible dialect.
Generate SQL with the SuprSend Agent
Click Generate with AI in the builder toolbar and describe the segment in plain English — e.g. “Growth-plan users in the US who placed 3+ orders in the last 60 days”. The Agent returns SQL plus a plain-English summary; click Use this SQL to insert it at the cursor, then edit as needed.Available tables
- users
- events
One row per user in your workspace.
Query Recommendations
A few things to keep in mind for accurate, efficient queries:- Always return
distinct_id. It’s how membership is resolved, so include it in your SELECT. Other columns still show up in the dry-run preview, but don’t affect who ends up in the list. - Select only the columns you need. Prefer named columns over
SELECT *— it keeps the query fast and skips large JSON fields (likeuser_propertiesor the eventpayload) you don’t actually use. - Query only
usersandevents. These are the only two tables available; references to anything else are rejected. - Match event names in uppercase.
event_nameis stored in caps, so filter withevent_name = 'ORDER_PLACED', not'order_placed'— a lowercase match returns no rows. - Mind JSON key casing. Keys are case-sensitive, so
properties ->> 'Amount'isn’t the same asproperties ->> 'amount'. - No need to scope by workspace. There’s no
workspace_idcolumn to set — a query only reads data from the workspace you’re building it in.
Supported SQL
The dialect is PostgreSQL- and ClickHouse-compatible. For every supported function and query feature — organized by category, each with syntax, arguments, and an example — see the Segment SQL reference.Sample queries
- User property filters
- Event-based
- Compound (user + event)
Users on the enterprise plan in the US region
Users tagged as VIP (where tags is an array)
Users with atleast 1 active email channel
Users with lifetime value of $2,500 or more
Users whose subscription has 50 or more seats
Verified VIP users on the enterprise plan from selected countries
3. Dry-run to preview matched users
Click Run query (or pressCmd/Ctrl + Enter) to execute a dry-run. The dry-run panel shows the total count of matched users, the first 10 matched rows so you can spot-check the segment, and the exact error if the SQL is invalid.
The two API calls under the hood:
200
200
4. Commit the segment
Committing makes your segment live and users start syncing into the list immediately. The first sync runs right after you commit, and the list keeps refreshing as your data changes. Each commit is stored as an immutable version, and any broadcast or workflow trigger that references this list uses the live version. You can commit without running a dry-run first, though it’s good practice to preview the matched users and confirm they look right before you do. Add an optional commit message describing what changed — e.g. “Expanded to 5 countries; 60-day order window.” — and confirm. The message shows up in Version History.
Create a segment via the API
You can also create a Segment List directly through the API, with the SQL as the initial query. A segment created via the API is committed automatically — it goes live and starts syncing as soon as the request succeeds, with no separate commit step.cURL
5. Trigger notifications to the segment
Once the segment is committed, you can use it anywhere lists are supported.- Broadcast
- Workflow
Send the same notification to everyone in the segment — click Run Broadcast from the list’s details page, or trigger it via the API. SuprSend refreshes the segment right before sending, so it reaches the users who satisfy the filters at the time of sending.
Versioning and rollback
Every commit creates a new version. The current version islive; older versions stay in Version History on the list detail page.
Open Version History to see every version and its SQL. To revert, pick an older version and click Rollback to this version — it becomes the new live version.

Enable or disable a segment
A segment is enabled the moment you commit it. Toggle it off from the 3 dots menu on the list detail page — the segment stops refreshing but the query and version history stay intact, so you can turn it back on later. Existing memberships remain in place while disabled, so a manually-triggered broadcast can still send to the last-known members.Troubleshooting
Query timed out
Query timed out
The dry-run couldn’t complete in the allowed time. Simplify: narrow the time window on
events, add more selective filters, avoid SELECT with many columns, and add a LIMIT. Then re-run.Missing distinct_id in SELECT
Missing distinct_id in SELECT
A red banner appears under the editor: “Missing distinct_id. Query results must include a
distinct_id column to sync users to the list.” Commit is blocked until the SELECT is fixed.Query returns zero users
Query returns zero users
Commit is allowed — the segment simply has no members until data changes and someone matches. The dashboard shows a
0 users matched indicator with a suggestion to adjust filters.Selecting extra columns alongside distinct_id
Selecting extra columns alongside distinct_id
Extra columns show up in the dry-run preview so you can spot-check the data. They do not affect list membership — only
distinct_id is used to sync users into the list.AI Agent generated a query that doesn't return anything
AI Agent generated a query that doesn't return anything
Two common causes: (1) a column name in the Agent’s SQL doesn’t match your workspace’s schema — check the schema panel and correct the identifier; (2) the time window is too narrow. Adjust and re-run. The Agent uses your schema but it can still make plausible-looking mistakes.
Next steps
Send a Broadcast
Use a Segment List as the audience for a one-shot campaign.
Setup Workflow on List entry/exit
Trigger workflows when users enter or exit a segment.