Skip to main content
Question

Get Users by lastvisit?

  • May 9, 2026
  • 6 replies
  • 54 views

jvdc

Hey is there a way to use the API to call a list of users that is sorted by lastvisit?

Or to get a users by lastvisit smaller than 24h?

6 replies

Mithila Jayalath

@jvdc Have you tried fetching users using the filter[lastactivity][from] parameter here?

	
string <date>
Example: filter[lastactivity][from]=2024-01-01
Filter users whose last activity was on or after this date (yyyy-mm-dd format).

This filter returns users whose last activity was on or after the specified date (format: yyyy-mm-dd).

Currently, the API does not support directly retrieving users whose last activity occurred within the past 24 hours. As a workaround, you could fetch users with a last activity date slightly earlier than 24 hours ago, then perform an additional check on the returned timestamps to filter only those active within the last 24 hours.

It would also be great if you could submit this as an idea for future API improvements.


jvdc
  • Author
  • Expert ⭐️
  • May 9, 2026

Yeah I tried that :-) but it only returns people who actually did something, but if they just browsed the site and did nothing they won't be included from what I gathered in my tests.
 

I also tried to return all users and then filter on lastvisit but the API doesn't return the entire user base, so it is not accurate either… :-/

… I also tried to do some sort in the call but that didn't work either...


jvdc
  • Author
  • Expert ⭐️
  • May 9, 2026

Here you go 😊

 


jvdc
  • Author
  • Expert ⭐️
  • May 10, 2026

Hey ​@Mithila Jayalath any idea how within the connector we could have a dynamic time selection for the filter you mention? like now() - 24h?


Mithila Jayalath

Yeah I tried that :-) but it only returns people who actually did something, but if they just browsed the site and did nothing they won't be included from what I gathered in my tests.

@marekkoszlak ​@olimarrio what are the activities do you consider as activities? I also think browsing should be included as an activity.

 

Hey ​@Mithila Jayalath any idea how within the connector we could have a dynamic time selection for the filter you mention? like now() - 24h?

@jvdc since the API expects a date value in yyyy-mm-dd format. Calculate the date corresponding to current time - 24h, format it as required, and then pass that value to the filter parameter.


jvdc
  • Author
  • Expert ⭐️
  • May 11, 2026

@Mithila Jayalath yep I knew about the format, but how can I play with the parameters to inject the time difference dynamically and in the correct format?

I am trying to play with it via the response template but that doesn't do anything:

Also, seems like just logging in does not count in lastactivity, I think the minimum is to view a topic, but just viewing the homepage will not count.