Users are reporting issues with the Discourse REST API endpoint /admin/users/{id}/log_out.json, receiving “Oops! That page doesn’t exist or is private” or 404 errors despite providing valid Api-Key and Api-Username headers. bymong and seanc initially struggled with the endpoint, while blake confirmed it works using cURL with proper headers and an admin API key. seanc later resolved their issue by correcting their axios request format — passing an empty body object, which was previously omitted. Canapin confirmed success using an admin API key with global or granular log-out scope. Atchuth_Reddy and others still report failures, prompting requests for code examples. Key takeaways: ensure valid user ID, use admin API key, include correct headers, and send empty body if no data is required. JammyDodger helped consolidate the thread for clarity.
My site dns is ‘aaa.com’, and User ID is ‘1’.
I made url and send request like this.
-post AAA Sorry Page
Also, I send header with api-key, api-Username.
But I recived response to “Oops! That page doesn’t exist or is private.”
Yes, in the test case it’s 1 (obtained from a call to /u/by-external/${user.id}.json ). Also tried hard-coding the value, just to double check…same result.
…I get a 200 response, suggesting that the user 1 (me) should be logged out of the forum, but when I check, I haven’t actually been logged out - that’s issue one.
Second problem is that sending the same request from my app backend using axios (detailed above) results in a 404…very strange.
Edit: Issue one is not an issue - the cURL request is successfully logging me out - just need to work out now why the axios post request is giving me 404.
Turns out my axios request wasn’t formatted correctly! Since I’m not sending any body in the post request, I should have passed an empty object with the request.
Thanks for the steer re. curl requests @blake - that’s ultimately what unlocked it for me.
I have tried logging out forum with post api ‘admin/users/{user_id}/log_out.json’ but it returns with Oops! That page doesn’t exist or is private.
I have provided api_key and api-username with in headers. Does anyone faced same issue