A member of confluence-administrators receiving empty email string in API Response
Asked by shwetagulati:

In User Email Visibility setting set to site administrators, user form group confluence-administrators not able to see email .

API called - {{BaseUrl}}/rest/mobile/1.0/profile/nop  
Response -  
{  
"userName": "nop",  
"fullName": "nop",  
"avatarUrl": "/images/icons/profilepics/default.svg",  
"url": "/display/nop",  
"email": "",  
"userPreferences": {  
"watchOwnContent": true  
},  
"unknownUser": false,  
"about": "",  
"anonymous": false  
}  

<br />

<br />

![Screenshot 2022-02-24 171111.png](/t5/image/serverpage/image-id/185185i1D5C044C35D921CE/image-size/large?v=v2&px=999 "Screenshot 2022-02-24 171111.png")

![Screenshot 2022-02-24 165358 (1).png](https://community.atlassian.com/t5/image/serverpage/image-id/185970i39E590545DC76E09/image-size/large?v=v2&px=999 "Screenshot 2022-02-24 165358 (1).png")

![Screenshot 2022-02-24 165326.png](/t5/image/serverpage/image-id/185187i9B298EA1877B9146/image-size/large?v=v2&px=999 "Screenshot 2022-02-24 165326.png")


Answers:
author: Thiago Masutti
body: Hi [@shwetagulati](/t5/user/viewprofilepage/user-id/4464589)   
I hope you are well.

This is the expected behavior for the *User email visibility* when set to *only visible to site administrators*.

The API you are using is for internal use only (meaning it is used by internal Confluence operations) and might be used to show information on the UI (when accessing Confluence through a mobile device).  
That means the result of that API shouldn't disclose the email address even for a Confluence administrator.  
For administrators, the email of a user should be shown only on the *View User* admin page.  
![admin-email-user.png](https://community.atlassian.com/t5/image/serverpage/image-id/185341iBBC65B47050805DD/image-dimensions/335x213?v=v2 "admin-email-user.png")

The ability to manage users through a REST API is an open feature reported on [CONFSERVER-56205](https://jira.atlassian.com/browse/CONFSERVER-56205) .  
Therefore, there won't be a public, [supported API](https://developer.atlassian.com/platform/marketplace/atlassian-rest-api-policy/) to display users' emails on the above scenario.

Kind regards,  
Thiago Masutti

comments: author: shwetagulati
body: Hi [@Thiago Masutti](/t5/user/viewprofilepage/user-id/1209618) , Thank you so much for the response. Can you point us to the documentation of this API - {{BaseUrl}}/rest/mobile/1.0/profile/\<username\> . We have seen cases in one of our confluence instance that this API returns 401 for a user who has only view access for certain spaces in Confluence whereas in other instance , API never returns 401, its just that the email depends on the User Email visibility setting. We want to check what are the permissions/control knobs required for this API.


author: Thiago Masutti
body: Hi [@shwetagulati](/t5/user/viewprofilepage/user-id/4464589)

Since this is an internal API, it isn't published in the [Confluence REST API Documentation](https://docs.atlassian.com/ConfluenceServer/rest/latest) and isn't supported by the [Atlassian REST API policy](https://developer.atlassian.com/platform/marketplace/atlassian-rest-api-policy/) .

The [401 HTTP Status](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401) may indicate something wrong with the user authentication method, not with the internal authorization logic of the backend (that would be a [403 status](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403)).

If that's happening only with a user (or a few users) on a specific instance, then it might be on how the user is triggering that request.

This user could test accessing the API through the browser, after a regular authentication, to see if that gives any error.

![api-001.png](https://community.atlassian.com/t5/image/serverpage/image-id/185475iB56297688B1A0EDD/image-dimensions/430x223?v=v2 "api-001.png")

If the issue still occurs even on a browser, then I would recommend [creating a support request](https://confluence.atlassian.com/support/create-a-support-request-790796816.html).

Kind regards,  
Thiago Masutti


Tags: confluence-server

server