Run user (id) search by tag

My goal is to send push notifications from my analysis to Run Users with a specific tag.

Then I can use the user ID to push a message as in:
await“userID”, {
title: ‘Notification Alert’,
message: You received a notification for the device: ${device_name}. Variable: ${scope[0].variable}, Value: ${scope[0].value},
} else {
context.log(‘User ID not found for this device.’);

I have no idea:
a) how to get a list of Run Users (and their ID).
b) filtered by Tag

Can someone please help?


I believe you are searching for the listUsers method of | TagoIO SDK

You can as:

const { Account } = require('@tago-io/sdk');

const account = new Account({ token: 'account-token' })
const user_list = await{ tags: [ { key: "tag_key", value: "tag_value" }], amount: 999 })


Yes, this is indeed what I was looking for.
Awesome, thanks!

1 Like