Unable to get account ID in rest/api/2/user?username= API

I am trying to get the account ID of the passed user via /rest/api/2/user API but this API is not returning me the account ID. It is giving me the following details:
{
“self”: “####”,
“key”: “####”,
“name”: “####”,
“emailAddress”: “#####”,
“avatarUrls”: {
“48x48”: “#####?avatarId=10122”,
“24x24”: “########?avatarId=10122”,
“16x16”: “######?size=xsmall&avatarId=10122”,
“32x32”: “######?size=medium&avatarId=10122”
},
“displayName”: “#####”,
“active”: true,
“timeZone”: “Etc/GMT”,
“locale”: “en_US”,
“groups”: {
“size”: 1,
“items”: []
},
“applicationRoles”: {
“size”: 1,
“items”: []
},
“expand”: “groups,applicationRoles”
}

Cloud or Server?

The following is for Server and may or may not be accurate for Cloud.

Are you accessing the REST API yourself? Or using something like the jira rest java client?

The id is pretty much never needed, since their key is already unique; so, some libraries (including Atlassian’s own Java rest client) don’t bother mapping it to the returned object.

Try installing/enabling the RAB (REST API Browser) plugin (use it from Administration > System > REST API Browser) and see if that returns the id (it should). If it does not, contact Atlassian support. If it does, then don’t use that library - find a new one or make the calls yourself.