Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to iterate response from dynatrace managed user sessions api endpoint?


Only first 50 rows are returned. Is there a counter or page index which can be incremented to retrieve next batch of rows?



DynaMight Guru
DynaMight Guru

How your query looks like? According to documentation you should be able to get up to 5000 results:

See limitation seciont. Didn't you have any TOP function in query?



Regards, Sebastian

SELECT TOP(distinct(userid),2000) from usersession where useraction.application = '<App_Name_String>' group by userid order by user id

which encodes to


You didn't set timeframe so I assume that it can return you users from short one. maybe this is the problem.

Regards, Sebastian

I did set time frame in unix timestamp

I am sure its correct and I have verified its accurate

Tried using timeframe in script as well in the api explorer

Same issue persists

even if I use

SELECT userid from usersession where useraction.application = 'App_Name_String'


SELECT userid from usersession

it will still return 50 rows

No attribute in response available which could allow iterating the next batch.

DynaMight Guru
DynaMight Guru

Try it like this:

SELECT userid from usersession LIMIT 1000

In this query dynatrace not allow higher limit than 1000.

Regards, Sebastian

Cool. This works. 🙂

Thanks . Well it fetches more than 5000 at once.


I have the same problem, No matter what i set, the response is only 50 rows max in a managed solution.

We try with this kind of query:

SELECT usersession.ip, application, name, targetUrl,usersession.userId, startTime FROM useraction WHERE usersession.userType = "REAL_USER" GROUP BY usersession.ip, application, name, targetUrl,usersession.userId,startTime ORDER BY usersession.ip, startTime

To group all users by ip and default it would be the last 2 hours. that's aprox at least 10k of user actions (5k per hour) but ended only showing no more than 50 user ressults.

Services Solution Engineer @PowerCloud - Observability/CloudOps Certified / Former SE @Dynatrace.

Thanks Dante. Will give it a try.

Hope you are able to retrieve more than 50 rows now using LIMIT

Featured Posts