correct-apricot
correct-apricot2w ago

API calls and CSV calls discrepancy

I just exported a csv of the list of calls on an assistant. There are 1194 calls. When I queried the same thing using api, I only got 921 calls. Issue Summary: The CSV export contains 273 more calls than what's returned by the API when querying all calls for the same assistant. All 921 API calls are present in the CSV, but the API appears to be missing 273 calls that exist in the export. API Request Used:
from 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
from 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.
1 Reply
Sahil
Sahil2w ago
Sorry for the delays as we are currently experiencing an extremely high volume of support requests. I have shared this with the team and they'll get back.

Did you find this page helpful?