Endpoint for User Information

AI-generated summary

Alexander asked about an endpoint to retrieve user information when using User API Keys, noting the lack of such an endpoint in the official API docs. pfaffman suggested checking the user profile URL, while featheredtoast pointed to the /my/summary route. david provided the solution: https://meta.discourse.org/session/current.json, which Alexander confirmed was exactly what he needed thanks.

Hi all!

I would like to know if there is currently (or could be implemented) an endpoint that contains information about the user

I am making an application that uses the User API Keys, everything works perfectly, but I would like to get information about the user who “logged in using their User API Key”

Something like “discourse.example.com/user.json”

Currently I did not find something like this in Discourse API Docs, and also not while reverse engineering the API

If someone could guide me I would be very grateful!

Thanks in advance!

Does https://meta.discourse.org/u/Alexander.json give you what you want?

Oops. Sorry.

The API Docs don’t always keep up with everything, check outHow to reverse engineer the Discourse API.

Not really at first

Since I have not found how to obtain, at least, the username of the user

That is why an endpoint like the one I mentioned above could be useful to obtain information, even very basic, of the current user

I don’t think we’ve got an official endpoint to finding out “who I am” without giving a username.

However, you can still detect it by way of following Discourse Meta - The Official Support Forum for Discourse down a bit - that will redirect to the current user’s page.

It’s not officially in the API docs, but I think https://meta.discourse.org/session/current.json might be useful for this purpose

It is exactly what I needed! :smiley:

Thank you very much!!