# Issue on getting current user sessions

**URL:** <https://devforum.okta.com/t/issue-on-getting-current-user-sessions/24312>\
**Category:** API\
**Created:** [May 19, 2023, 1:54pm UTC](https://devforum.okta.com/t/issue-on-getting-current-user-sessions/24312 "2023-05-19T13:54:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Udith](https://avatars.discourse-cdn.com/v4/letter/u/b2d939/32.png) [@Udith](https://devforum.okta.com/u/Udith)\
**Post date:** [May 19, 2023, 1:54pm UTC](https://devforum.okta.com/t/issue-on-getting-current-user-sessions/24312/1 "2023-05-19T13:54:00Z")

</div>

I have gone through the Okta sessions API documentation but however, I did not find a way to get all the user sessions. **My goal here is to get the details of all current logged in users.**

I got this method from chatGPT and I have tried it using postman web service,  
\* URL: `https://{okta-domain}/api/v1/sessions`  
\* Headers:  
\* `Content-Type: application/json`  
\* `Authorization: SSWS {okta-api-token}`

The response was,  
{  
“errorCode”: “E0000022”,  
“errorSummary”: “The endpoint does not support the provided HTTP method”,  
“errorLink”: “E0000022”,  
“errorId”: “oaeKsh7k04cSgO-fmqy1ZVFnA”,  
“errorCauses”:   
}

I double checked header values, permissions and everything. But I haven’t found anything wrong.  
How can I get details of all the current logged in users as the admin??

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [May 19, 2023, 7:20pm UTC](https://devforum.okta.com/t/issue-on-getting-current-user-sessions/24312/2 "2023-05-19T19:20:34Z")

</div>

The [Sessions endpoint](https://developer.okta.com/docs/reference/api/sessions/) isn’t designed to retrieve ALL active sessions., only information about an individual session. You would need to know a specific session ID to get information back from Okta about the user granted that session: [Sessions | Okta Developer](https://developer.okta.com/docs/reference/api/sessions/#get-session)

---

<div class="post-metadata">

**Author:** ![Udith](https://avatars.discourse-cdn.com/v4/letter/u/b2d939/32.png) [@Udith](https://devforum.okta.com/u/Udith)\
**Post date:** [May 21, 2023, 5:51pm UTC](https://devforum.okta.com/t/issue-on-getting-current-user-sessions/24312/3 "2023-05-21T17:51:20Z")

</div>

Thank you for the explanation,  
Can you please let me know whether there is an end point to get currently logged-in user details?

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [June 2, 2023, 9:37pm UTC](https://devforum.okta.com/t/issue-on-getting-current-user-sessions/24312/4 "2023-06-02T21:37:11Z")

</div>

Only [/api/v1/sessions/me](https://developer.okta.com/docs/reference/api/sessions/#get-current-session) and [/api/v1/users/me](https://developer.okta.com/docs/reference/api/users/#get-current-user) which retrieve data about the currently logged in user based on their session cookie in their browser.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [June 6, 2023, 6:23am UTC](https://devforum.okta.com/t/issue-on-getting-current-user-sessions/24312/5 "2023-06-06T06:23:47Z")

</div>

Closed on June 6, 2023, 6:23am UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
