confluenceconfluence-rest-api

How can I find a user's username by searching with their email address using the Confluence API?


I have a user's email address. I am trying to find their Confluence username.

I have tried https://confluence.example.com/rest/api/user?username=someone@example.com but it returns an error.

If it matters, we have an internally hosted Data Center instance.

{"statusCode":404,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"No user found with key : null","reason":"Not Found"}

Solution

  • It is not possible to look for a user by mail via REST API, only by key or username:

    http://example.com/confluence/rest/api/user?username=jblogs http://example.com/confluence/rest/api/user?key=402880824ff933a4014ff9345d7c0002

    So if you have user name or key you can use this endpoint and then get data from this, or if you have emails, you can get these users and retrieve necessary data by ierating the endpoint