Ramsai
Ramsai•8mo ago

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"
}
}
{
"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"
}
}
}
]
}
{
"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.
3 Replies
Ramsai
RamsaiOP•8mo ago
Hi team, any update on this? 🙂 ??
Raccine
Raccine•8mo ago
Hey @Ramsai! Thanks for reaching out and my apologies for the delay in response! I'll loop in an engineer to take a look at this and get back to you ASAP :gigipixel:
Rajat Singh
Rajat Singh•7mo ago
hi @Ramsai let me look into this and will get back to you hi @Ramsai , events API requires the user to have certain Manager Role, did you try sending the request from different users just to check the response?

Did you find this page helpful?