Microsoft Graph API: createdDateTime filter with gt still returns same timestamped record

Gurwinder Singh (Trianz) 0 Reputation points
2025-06-27T06:28:27.8+00:00

I’m facing an issue while fetching sign-in logs from Microsoft Graph API using a time-based polling mechanism.


We're fetching logs from the Microsoft Graph API endpoint: https://graph.microsoft.com/v1.0/auditLogs/signIns

We use the filter: createdDateTime gt {lastPollTime}

  • The initial poll starts from: some poll time.
  • In each fetch cycle, we advance the window based on the createdDateTime of the last record seen.

Even though we use createdDateTime gt 2025-06-26T11:26:54Z, the same record with createdDateTime = 2025-06-26T11:26:54Z is returned again in the next call.

This leads to duplicate entries, even though we are strictly filtering for greater than (gt) the previous timestamp.

Why does Microsoft Graph return records equal to the createdDateTime even when using gt?

Is this a known behavior due to internal rounding or backend precision?

Is the approach of adding milliseconds/nanoseconds to the last seen timestamp safe and recommended?

Is there a better way to avoid duplicates and ensure no data loss?

Developer technologies Small BASIC
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.