https://retellai.com/?utm_source=discord&utm_medium=seo logo
Retell SDK /APInot filtering by agent id
# ❓・bug-report
m
# Bug:
agent_id
filter in
listCalls
API is not filtering results ## Summary The
agent_id
filter parameter in the
POST /list-calls
(SDK
call.list()
) endpoint appears to be completely ignored. Calls from all agents in the account are returned regardless of the
agent_id
filter value. ## Reproduction Using `retell-sdk@5.4.0`:
Copy code
typescript
const calls = await client.call.list({
  filter_criteria: {
    agent_id: ['agent_A'],  // filter for a specific agent
    call_status: ['ended'],
    end_timestamp: { lower_threshold: Date.now() - 24 * 60 * 60 * 1000 },
  },
  limit: 1000,
  sort_order: 'descending',
});

// Expected: all calls have agent_id === 'agent_A'
// Actual: only ~7-27% of calls match; the rest belong to other agents
const mismatched = calls.filter(c => c.agent_id !== 'agent_A');
console.log(`${mismatched.length} / ${calls.length} calls have wrong agent_id`);
## Results across 8 agents in the same account | Queried Agent | Total Returned | Mismatched agent_id | Mismatch % | |---|---|---|---| | agent_8a056b735bd... | 1000 | 735 | 73.5% | | agent_b79b280617a... | 1000 | 771 | 77.1% | | agent_d7360c6d9f9... | 1000 | 900 | 90.0% | | agent_ddbd734058b... | 1000 | 909 | 90.9% | | agent_25287ac7aa8... | 1000 | 931 | 93.1% | | agent_0e3c1fe3429... | 1000 | 942 | 94.2% | | agent_020a3fc3ff1... | 1000 | 966 | 96.6% | | agent_b0dbdcfd582... | 1000 | 972 | 97.2% | Every query returns calls from all 9 distinct agents in the account. The filter has no effect on the results. ## Impact - Downstream systems ingesting calls per-agent are storing calls under incorrect agents - Massive redundant API calls since every agent query returns the same global pool - Discovered because calls appeared in our DB from an
agent_id
that was never created in our system — it only exists on the Retell side ## Environment - `retell-sdk`: tested on both
4.47.0
and
5.4.0
— same behavior - Confirmed this is server-side, not an SDK serialization issue
Workspace id: org_mqWi5tj9xck3o8ig
o
Hello @momsramen , thanks for letting us know, the team is looking into it
m
Any updates @Omar Ashraf | Community Lead ?
o
Fixed