RamsaiR
ZITADEL12mo ago
5 replies
Ramsai

Session terminated, session.token.removed events missing in event search API

Hi team, I am looking to get active sessions of a user from events storage. I am using the API https://zitadel.com/docs/apis/resources/admin/admin-service-list-events.
Here is the body that I am using to send the request ,
{
  "eventTypes": [
    "session.added",
    "session.terminated",
    "session_logout.executed",
    "session.token.removed"
  ],
  "aggregateTypes": ["session", "session_logout"],
  "range": {
    "since": "2019-04-01T08:45:00.000000Z",
    "until": "2025-04-01T08:45:00.000000Z"
  }
}

I am finding the session and session.added event types , but could not find any session.terminated, session_logout.executed, session.token.removed event types.

Here is a sample response :
{
    "events": [
        {
            "editor": {
                "userId": "",
                "displayName": "Users",
                "service": "zitadel"
            },
            "aggregate": {
                "id": "",
                "type": {
                    "type": "session",
                    "localized": {
                        "key": "AggregateTypes.session",
                        "localizedMessage": "Session"
                    }
                },
                "resourceOwner": ""
            },
            "sequence": "1",
            "creationDate": "2025-02-05T06:59:01.024100Z",
            "payload": {},
            "type": {
                "type": "session.added",
                "localized": {
                    "key": "EventTypes.session.added",
                    "localizedMessage": "EventTypes.session.added"
                }
            }
        }
    ]
}

Could you please help me if I am missing anything or if there is anything I have to do more to get desired response.
I am using my bearer token as the Auth header.
Was this page helpful?