---
title: "User Management REST API"
canonical: "https://www.techtime-initiative.com/space/UM/4522143/User%20Management%20REST%20API"
format: markdown
---
Atlassian Rest API comes with limitations when retrieving group membership for specified groups. Here's an alternative way, using User Management.

### Web Request using Python and [Requests](https://docs.python-requests.org/en/latest/):

|  |
| --- |
| ```
import requests
 
# Change base URL
JIRA_HOST = "https://baseurl"
# Change credentials
CREDENTIALS = ('user', 'password')
 
headers = {
'X-Atlassian-Token': 'no-check'
}
payload = {
'filterParameters': '{"groups":["jira-administrators"],"userStatus":"ACTIVE"}'
}
files = {'filterParameters': (None, '')}
 
r = requests.post(JIRA_HOST + 'rest/techtime-usermanagement/1.0/bulkChange/userFilter', files=files, data=payload, timeout=2.5, headers=headers, auth=CREDENTIALS)
 
print(r.text)
``` |

Each returned JSON object contains the following attribute:

| Name | Data Type |
| --- | --- |
| username | string |
| displayName | string |
| email | string |
| lastLogin | integer (Unix time format) |
| active | boolean |
| directory | list (containing integer values only) |

### Response example:

|  |
| --- |
| ```
[
    {
        "username": "jira-admin",
        "displayName": "JIRA Admin",
        "email": "admin@example.com",
        "lastLogin": 1641613448604,
        "active": true,
        "directories": [
            1
        ]
    },
    {
        "username": "Jean Bryant",
        "displayName": "Jean Bryant",
        "email": "jean.bryant@example.com",
        "lastLogin": 1649816109445,
        "active": true,
        "directories": [
            10000
        ]
    }
]
``` |

### Configuration

You can specify your search in the payload: 

|  |
| --- |
| ```
payload = {
'filterParameters': '{"groups":["<group name>"],"userStatus":"<status>"}'
}
``` |