srikruth_
08/19/2025, 7:38 PMfrom vapi import Vapi
client = Vapi(token="[token]")
all_calls = []
created_at_lt = None
# Paginate through all calls
while True:
params = {'assistant_id': '[assistant_id]', 'limit': 500}
if created_at_lt:
params['created_at_lt'] = created_at_lt
batch = client.calls.list(**params)
if not batch:
break
all_calls.extend(batch)
if len(batch) < 500:
break
created_at_lt = getattr(batch[-1], 'created_at', None)
if not created_at_lt:
break
# Result: 921 calls
Expected Behavior:
The API should return the same number of calls as the CSV export (1194) when querying all calls for an assistant.
Actual Behavior:
CSV export: 1194 calls
API response: 921 calls
Missing: 273 calls
The pagination appears to be working correctly (no infinite loops, proper created_at_lt handling), but seems to stop prematurely or skip certain calls that are included in the CSV export.