Share via

Microsoft Graph: AIInteractionHistory api and OData filters

Michael Sitch 10 Reputation points
2026-02-19T10:04:51.54+00:00

Hi,

I'm calling the AIInteractionHistory api here and receiving data but would like to restrict the returned data for performance.

The documentation provides one example on how to do this:

GET https://graph.microsoft.com/v1.0/copilot/users/{id}/interactionHistory/getAllEnterpriseInteractions?$filter=appClass eq 'IPM.SkypeTeams.Message.Copilot.BizChat'

This works as expected.

However trying to apply a filter based on the createdDateTime

GET https://graph.microsoft.com/v1.0/copilot/users/{id}/interactionHistory/getAllEnterpriseInteractions??$filter=createdDateTime gt 2026-01-01

fails returning:

{
  "error": {
    "code": "InternalServerError",
    "message": "Failed to execute request.",
    "innerError": {
      "date": "2026-02-19T09:30:20",
      "request-id": "a840d14c-5428-471d-aac1-5a654dd9d745",
      "client-request-id": "a840d14c-5428-471d-aac1-5a654dd9d745"
    }
  }
}

It also looks like other properties cannot be used in the filter such as sessionId, requestId etc.

GET https://graph.microsoft.com/v1.0/copilot/users/{userId}/interactionHistory/getAllEnterpriseInteractions?$filter=sessionId eq '{sessionId}'

returns:

{
  "error": {
    "code": "BadRequest",
    "message": "The entity property 'sessionId' and operationKind 'Equal' is not allowed in $filter query.",
    "innerError": {
      "date": "2026-02-19T09:46:54",
      "request-id": "a32843a6-9551-4721-a046-77342e009a74",
      "client-request-id": "a32843a6-9551-4721-a046-77342e009a74"
    }
  }
}

So my questions are:

  • As it appears that createdDateTime in the filter is supported, is this a bug or is the filter syntax incorrect?
  • What other properties are supported in the filter (sessionId/requestId would be really useful for us) with examples?

Hope you can help, thank you.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} vote

Answer recommended by moderator
  1. Michael Sitch 10 Reputation points
    2026-02-19T13:55:11.3566667+00:00

    The createdDateTime filter works but only when you specify a date range, e.g.

    https://graph.microsoft.com/v1.0/copilot/users/{id}/interactionHistory/getAllEnterpriseInteractions?$filter=createdDateTime gt 2025-08-01T00:00:00.00Z and createdDateTime lt 2025-08-31T00:00:00.000Z
    
    

    Discovered thanks to the docs on the equivalent teams api.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Vasil Michev 125.5K Reputation points MVP Volunteer Moderator
    2026-02-19T10:30:15.4566667+00:00

    I'm not sure createdDateTime is supported for $filter for this endpoint. Your examples above use a faulty syntax, datetime values should be passed in the form:

    $filter=createdDateTime ge 2026-01-01T00:00:00Z
    

    but even with this, I get 400 Bad request. Most likely it's simply not supported, so you'll have to retrieve all data, then filter it client-side instead.


Your answer

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