# Which API call should use to clear session from ALL applications. (OIDC Application)

**URL:** <https://devforum.okta.com/t/which-api-call-should-use-to-clear-session-from-all-applications-oidc-application/23918>\
**Category:** OAuth/OIDC\
**Created:** [April 10, 2023, 11:47am UTC](https://devforum.okta.com/t/which-api-call-should-use-to-clear-session-from-all-applications-oidc-application/23918 "2023-04-10T11:47:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saurabh126](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Saurabh126](https://devforum.okta.com/u/Saurabh126)\
**Post date:** [April 10, 2023, 11:47am UTC](https://devforum.okta.com/t/which-api-call-should-use-to-clear-session-from-all-applications-oidc-application/23918/1 "2023-04-10T11:47:02Z")

</div>

Hi Team,

Tried calling “api/v1/sessions” but receiving error “Failed to Fetch”.  
Please suggest which api call should i use.

Regards,  
Saurabh

---

<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:** [April 10, 2023, 4:40pm UTC](https://devforum.okta.com/t/which-api-call-should-use-to-clear-session-from-all-applications-oidc-application/23918/2 "2023-04-10T16:40:41Z")

</div>

To end the application session itself, or just to revoke tokens?

As each application manages its own session, only these applications themselves are able to close the application session. From the Okta side, you can end the user’s IdP (Okta) session (e.g via a DELETE to /api/v1/sessions/me) OR [revoke their refresh tokens](https://developer.okta.com/docs/reference/api/users/#revoke-all-refresh-tokens). You cannot revoke a user’s SP (application) sessions from the IdP side.

---

<div class="post-metadata">

**Author:** ![Saurabh126](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Saurabh126](https://devforum.okta.com/u/Saurabh126)\
**Post date:** [April 11, 2023, 4:45pm UTC](https://devforum.okta.com/t/which-api-call-should-use-to-clear-session-from-all-applications-oidc-application/23918/3 "2023-04-11T16:45:04Z")

</div>

@andrea I am trying to user /logout endpoint however, getting bad request. I guess /logout endpoint will solve my purpose.

Can you please help to suggest what should be done differently. I am sharing the reference link here for the question raised

> [@400 Bad Request ! Invalid Id\_token - /logout endpoint calling. (SSO Embedded SignIn Widget - OIDC web App)](https://devforum.okta.com/t/400-bad-request-invalid-id-token-logout-endpoint-calling-sso-embedded-signin-widget-oidc-web-app/23933):
>
> Hi Team, I am trying to call /login endpoint using C#.Net by following the instruction from OKTA doc however, I am getting bad request error message saying “Invalid id\_token” from Postman and from C# code too as shown below. Please guide me through If there is any correction required to fix this issue \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Sharing request API call [https://xxxxxx-dev.oktapreview.com/oauth2/v1/l…](https://xxxxxx-dev.oktapreview.com/oauth2/v1/logout?id_token_hint=eyJraWQiOiJzNENxb2tTaGRQWm9YazVmVTUyM3p1SGNyNDdIazFfdkhveHM5SjdPUGNZIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwMHU3aDhwcm9qc08zSHlKOTFkNyIsIm5hbWUiOiJTYXVyYWJoIFNoYXJtYSIsInZlciI6MSwiaXNzIjoiaHR0cHM6Ly9jbGluaWNhbGluay1kZXYub2t0YXByZXZpZXcuY29tL29hdXRoMi9kZWZhdWx0IiwiYXVkIjoiMG9hNmFyNHFjakxoWElqaWMxZDciLCJpYXQiOjE2ODEyMzA3NTYsImV4cCI6MTY4MTIzNDM1NiwianRpIjoiSUQuMEpQdWhsVlFXRlYtaWw4QVlNNi15bkQ3X0FaREZVS2hJNV9Ldlo0MDJjQSIsImFtciI6WyJwd2QiXSwiaWRwIjoiMDBvNjNmM21ra0V4akdLSHExZDciLCJub25jZSI6Ilp0YksxWUp0Rk1IV014cUN0V3ZLZE00QlduSEkyTkFpZmJSSURFaTExODlQdFFiZ1ZpdE1SYnpOaUt3Z0pVc1MiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzYXVyYWJoLnRlc3RtZSIsImF1dGhfdGltZSI6MTY4MTIyNDcyNSwiYXRfaGFzaCI6InhfZGFybm1Xb2twUDRoNzZHek0ydXcifQ.YplkMfRBpcR9lC1hs8DydOxW0v_NuuqxKh0WVctIUFTFtrsNiv5yrsM421AMUieji1CBN_h98wYlClvqMGKkWyq_tAVC2v3Cmby7bePKgSmrr0UKLLJMOuWGerr1B5h8bWUnaqbLb8Emdw0fUVPDImOtkgt39VDQ3HUx1kczjitsPWVd02cIGWXayFkPFaCrtRgOzyVXQZXgBuJhBD3f2KPogURGSmETvoxkOIyeQiNsbECWJzeHzPKuuvL9ROYfF5vZXzSDR0RkF5-sSxhhR2A0_QaxP73aMmrqwf7BWWbrVisbiI4EusFb_L2LBzU3r_E8PrlnHK35y5Ym_a5yCw)

Thank you.

---

<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:** [February 13, 2024, 11:04pm UTC](https://devforum.okta.com/t/which-api-call-should-use-to-clear-session-from-all-applications-oidc-application/23918/4 "2024-02-13T23:04:02Z")

</div>

Closed on February 13, 2024, 11:04pm UTC


