1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "conversations": [
12 {
13 "conversation_id": "sample-accepted",
14 "automated_resolution": true,
15 "automated_resolution_reasoning_present": true,
16 "last_resolution": "VERIFIED",
17 "test_mode": false,
18 "conversation_end_time": "2026-08-01T10:00:00+00:00"
19 },
20 {
21 "conversation_id": "sample-dispute",
22 "automated_resolution": true,
23 "automated_resolution_reasoning_present": true,
24 "last_resolution": "VERIFIED",
25 "test_mode": true,
26 "conversation_end_time": "2026-08-01T10:05:00+00:00"
27 },
28 {
29 "conversation_id": "sample-rework",
30 "automated_resolution": true,
31 "automated_resolution_reasoning_present": true,
32 "last_resolution": "VERIFIED",
33 "test_mode": false,
34 "conversation_end_time": "2026-08-01T10:10:00+00:00"
35 },
36 {
37 "conversation_id": "sample-unverifiable",
38 "automated_resolution": true,
39 "automated_resolution_reasoning_present": false,
40 "last_resolution": "VERIFIED",
41 "test_mode": false,
42 "conversation_end_time": "2026-08-01T10:15:00+00:00"
43 }
44 ],
45 "billing": [
46 {
47 "case_ref": "sample-accepted",
48 "billing_period": "2026-08",
49 "resolution_tier": "VERIFIED",
50 "billed_units": 1,
51 "unit_rate": "1.00",
52 "billed_amount": "1.00",
53 "currency": "USD"
54 },
55 {
56 "case_ref": "sample-dispute",
57 "billing_period": "2026-08",
58 "resolution_tier": "VERIFIED",
59 "billed_units": 1,
60 "unit_rate": "1.00",
61 "billed_amount": "1.00",
62 "currency": "USD"
63 },
64 {
65 "case_ref": "sample-rework",
66 "billing_period": "2026-08",
67 "resolution_tier": "VERIFIED",
68 "billed_units": 1,
69 "unit_rate": "1.00",
70 "billed_amount": "1.00",
71 "currency": "USD"
72 },
73 {
74 "case_ref": "sample-unverifiable",
75 "billing_period": "2026-08",
76 "resolution_tier": "VERIFIED",
77 "billed_units": 1,
78 "unit_rate": "1.00",
79 "billed_amount": "1.00",
80 "currency": "USD"
81 }
82 ],
83 "events": [
84 {
85 "case_ref": "sample-rework",
86 "event_type": "HUMAN_REWORK",
87 "event_at": "2026-08-01T11:00:00+00:00",
88 "same_issue": true
89 }
90 ],
91 "policy": {
92 "reopen_window_days": 7,
93 "human_rework_invalidates": true,
94 "duplicate_invalidates": true,
95 "negative_feedback_invalidates": true,
96 "explicit_unresolved_invalidates": true
97 }
98};
99
100
101const run = await client.actor("factrelay/reconcile").call(input);
102
103
104console.log('Results from dataset');
105console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
106const { items } = await client.dataset(run.defaultDatasetId).listItems();
107items.forEach((item) => {
108 console.dir(item);
109});
110
111