1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "reviewId": "renewal-2026-10",
12 "asOf": "2026-10-02",
13 "inactivityDays": 30,
14 "assignments": [
15 {
16 "appId": "app-alpha",
17 "seatId": "001",
18 "accountId": "acct-001",
19 "assignedAt": "2026-07-01"
20 },
21 {
22 "appId": "app-alpha",
23 "seatId": "002",
24 "accountId": "acct-002",
25 "assignedAt": "2026-07-01"
26 },
27 {
28 "appId": "app-alpha",
29 "seatId": "003",
30 "accountId": "acct-003",
31 "assignedAt": "2026-07-01"
32 },
33 {
34 "appId": "app-alpha",
35 "seatId": "004",
36 "accountId": "acct-004",
37 "assignedAt": "2026-09-25"
38 },
39 {
40 "appId": "app-alpha",
41 "seatId": "005",
42 "accountId": "acct-005",
43 "assignedAt": "2026-07-01"
44 },
45 {
46 "appId": "app-alpha",
47 "seatId": "006",
48 "accountId": "acct-006",
49 "assignedAt": "2026-07-01"
50 },
51 {
52 "appId": "app-alpha",
53 "seatId": "006",
54 "accountId": "acct-007",
55 "assignedAt": "2026-07-01"
56 },
57 {
58 "appId": "app-beta",
59 "seatId": "001",
60 "accountId": "acct-001",
61 "assignedAt": "2026-07-01"
62 }
63 ],
64 "roster": [
65 {
66 "appId": "app-alpha",
67 "accountId": "acct-001",
68 "status": "active",
69 "offboardedAt": null
70 },
71 {
72 "appId": "app-alpha",
73 "accountId": "acct-002",
74 "status": "offboarded",
75 "offboardedAt": "2026-09-15"
76 },
77 {
78 "appId": "app-alpha",
79 "accountId": "acct-003",
80 "status": "active",
81 "offboardedAt": null
82 },
83 {
84 "appId": "app-alpha",
85 "accountId": "acct-004",
86 "status": "active",
87 "offboardedAt": null
88 },
89 {
90 "appId": "app-alpha",
91 "accountId": "acct-005",
92 "status": "active",
93 "offboardedAt": null
94 },
95 {
96 "appId": "app-alpha",
97 "accountId": "acct-006",
98 "status": "active",
99 "offboardedAt": null
100 },
101 {
102 "appId": "app-alpha",
103 "accountId": "acct-007",
104 "status": "active",
105 "offboardedAt": null
106 },
107 {
108 "appId": "app-beta",
109 "accountId": "acct-001",
110 "status": "active",
111 "offboardedAt": null
112 }
113 ],
114 "activity": [
115 {
116 "appId": "app-alpha",
117 "accountId": "acct-001",
118 "state": "observed",
119 "lastActivityAt": "2026-08-10"
120 },
121 {
122 "appId": "app-alpha",
123 "accountId": "acct-002",
124 "state": "observed",
125 "lastActivityAt": "2026-09-10"
126 },
127 {
128 "appId": "app-alpha",
129 "accountId": "acct-003",
130 "state": "unknown",
131 "lastActivityAt": null
132 },
133 {
134 "appId": "app-alpha",
135 "accountId": "acct-004",
136 "state": "none-observed",
137 "lastActivityAt": null
138 },
139 {
140 "appId": "app-alpha",
141 "accountId": "acct-005",
142 "state": "none-observed",
143 "lastActivityAt": null
144 },
145 {
146 "appId": "app-alpha",
147 "accountId": "acct-006",
148 "state": "observed",
149 "lastActivityAt": "2026-08-15"
150 },
151 {
152 "appId": "app-alpha",
153 "accountId": "acct-007",
154 "state": "observed",
155 "lastActivityAt": "2026-08-15"
156 },
157 {
158 "appId": "app-beta",
159 "accountId": "acct-001",
160 "state": "observed",
161 "lastActivityAt": "2026-10-01"
162 }
163 ],
164 "coverage": [
165 {
166 "appId": "app-alpha",
167 "from": "2026-08-01",
168 "through": "2026-10-02",
169 "complete": true
170 },
171 {
172 "appId": "app-beta",
173 "from": "2026-09-01",
174 "through": "2026-10-01",
175 "complete": false
176 }
177 ]
178};
179
180
181const run = await client.actor("h_murdock/saas-seat-usage-evidence").call(input);
182
183
184console.log('Results from dataset');
185console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
186const { items } = await client.dataset(run.defaultDatasetId).listItems();
187items.forEach((item) => {
188 console.dir(item);
189});
190
191