https://retellai.com/?utm_source=discord&utm_medium=seo logo
can you elaborate on filter_criteria
# ❓・ai-evy-support
p
@AI Evy can you elaborate on filter_criteria.start_timestamp for the list calls?
a
Thanks for tagging me @papakojo_12. I'll look through relevant sources and get back to you shortly.
### Answer For the
filter_criteria.start_timestamp
parameter in the List Calls API, it's an object that allows you to filter calls based on their start timestamp range [(1) ]() . The
start_timestamp
filter criteria requires an object with specific properties :
Copy code
json
{  
 "start_timestamp": {  
 "upper_threshold": 1738475421000,  
 "lower_threshold": 1738475411000  
 }  
}
The object contains: - `upper_threshold`: The maximum timestamp value (in milliseconds since epoch) - `lower_threshold`: The minimum timestamp value (in milliseconds since epoch) This means you need to provide both
lower_threshold
and
upper_threshold
properties within the
start_timestamp
object to define the time range for filtering calls . The timestamps should be in milliseconds since epoch format . Note that there was a discussion in the Discord community where someone initially tried passing integers directly instead of the required object format, which resulted in a 400 error [(2) ]() . The correct approach is to use the object structure with
lower_threshold
and
upper_threshold
properties as shown in the official documentation [(1) ]() .
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) [[2] Issue iterating through api call history](https://discord.com/channels/1186424376300679209/1321954010739118110) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy can you give an example of the upper_threshold and lower_threshold using dates and then converting it to millieseconds
a
Thanks for the follow-up, @papakojo_12. I'll get back to you soon.
### Answer Based on the available sources, I can see that the List Calls API uses
filter_criteria
with timestamp filtering [(1) ]() , but the specific details about the
upper_threshold
and
lower_threshold
structure for
start_timestamp
aren't explicitly documented in the sources I have access to. However, I can provide a general example of how date-to-milliseconds conversion typically works: Example conversion process: - Start date: January 1, 2024, 00:00:00 UTC → 1704067200000 milliseconds - End date: January 31, 2024, 23:59:59 UTC → 1706745599000 milliseconds The structure would typically look like:
Copy code
json
{
  "filter_criteria": {
    "start_timestamp": {
      "lower_threshold": 1704067200000,
      "upper_threshold": 1706745599000
    }
  }
}
From the Discord discussion mentioned in your thread history, there was someone who had issues with timestamp filtering and received a 400 error when not using the correct object format [(2) ]() . For the most accurate and up-to-date information about the exact
upper_threshold
and
lower_threshold
implementation, I'd recommend checking the complete API documentation or contacting support, as the specific timestamp filtering structure details aren't fully outlined in my current sources.
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) [[2] Discord message from @fyodor2572 on 2024-10-15](https://discord.com/channels/1186424376300679209/1186462578310910112/1295617079608741929) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.