# Log out user API

**URL:** https://meta.discourse.org/t/log-out-user-api/231935
**Category:** SSO
**Tags:** rest-api
**Created:** [July 5, 2022, 4:23am UTC](https://meta.discourse.org/t/log-out-user-api/231935 "2022-07-05T04:23:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Kenshin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kenshin/32/265841_2.png) [@Kenshin](https://meta.discourse.org/u/Kenshin)
#### Post date: [July 5, 2022, 4:23am UTC](https://meta.discourse.org/t/log-out-user-api/231935/1 "2022-07-05T04:23:20Z")

</div>

I’ve setup Discourse and working great, except for one thing. I’m using SSO and I’m unable to log a user out using the API.

I am able to retrieve the user account using the user id, but calling the log out api returns a `not_found` error.

```plaintext
{ 
    errors: ["The requested URL or resource could not be found."],
    error_type: "not_found",
}

```

This is the code below, i tried using the user’s username and `system` still no luck.

 ![Screen Shot 2022-07-05 at 12.22.02 PM](https://global.discourse-cdn.com/meta/original/4X/9/7/e/97e88d72323d9b3196996e8c013a220b930510f4.png)

My api key’s **scope** is **Granular** and **user level** is **All Users**.

Changing the requested method from **POST** to **GET** returns the user’s details.

Any idea why this is happening? Maybe some config within Discourse?

I’ve been trying to find a solution for this for a while now.
