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