REST API - Users
General informations
Get all users
Method type - GET
URL
- {CONFLUENCE_URL}/rest/extender/1.0/user/getUsers
- {CONFLUENCE_URL}/rest/extender/1.0/user/getUsers?&showBasicDetails=true
- {CONFLUENCE_URL}/rest/extender/1.0/user/getUsers?&showExtendedDetails=true
Parameters:
showBasicDetails, showExtendedDetails - for details please check Example response
- dateFormat - define date format for date fields in output JSON - default format ‘yyyy-MM-dd'
Response format - JSON
Example response:
Without parameters
With parameter showBasicDetails=true
With parameter showExtendedDetails=true
Get user details
Method type - GET
URL:
- {CONFLUENCE_URL}/rest/extender/1.0/user/getUserDetails/{userName}
where {userName} is user name like 'admin'
Parameters:
dateFormat - define date format for date fields in output JSON - default format ‘yyyy-MM-dd'
Example URL:
{CONFLUENCE_URL}/rest/extender/1.0/user/getUserDetails?dateFormat=MM/dd/yyyy
{CONFLUENCE_URL}/rest/extender/1.0/user/getUserDetails?dateFormat=dd.MM.yyyy
Response format - JSON
Example response:
Add user
Method type -
URL:
{CONFLUENCE_URL}/rest/extender/1.0/user/add
Request format - JSON
Example
- name - required
- fullName - required
- email - required
- password - optional
- sendMail - optional - true or false - send an email message informing the person of their account (name, fullName and password)
- groups - optional - since v. 2.4.1 user is added to the default Confluence group, if you want to add it to another group, add this parameter
Response format - JSON
Example
Change user name
Method type -
URL:
{CONFLUENCE_URL}/rest/extender/1.0/user/rename/{userName}
where {userName} is user name
Example URL:
- {CONFLUENCE_URL}/rest/extender/1.0/user/rename/test_user
Request format - JSON
Example
Response format - JSON
Example
Change user details
Method type -
URL:
{CONFLUENCE_URL}/rest/extender/1.0/user/changeDetails/{userName}
where {userName} is user name
Request format - JSON
Example
- fullName - required
- email - required
- password - required
Response format - JSON
Example
Delete user
Method type -
URL:
{CONFLUENCE_URL}/rest/extender/1.0/user/delete/{userName}
where {userName} is user name
Response format - JSON
Activate/deactivate user
Method type -
URL:
{CONFLUENCE_URL}/rest/extender/1.0/user/activate/{userName}
{CONFLUENCE_URL}/rest/extender/1.0/user/deactivate/{userName}
where {userName} is user name
Response format - JSON
Get user property
Method type -
URL:
{CONFLUENCE_URL}/rest/extender/1.0/user/property/{userName}/{propertyKey}
where {userName} is user name and {propertyKey} is property key
Example:
- {CONFLUENCE_URL}/rest/extender/1.0/user/property/admin/user.organisation.position.full.name
Response format - JSON
Set user property
Method type -
URL:
{CONFLUENCE_URL}/rest/extender/1.0/user/property/{userName}/{propertyKey}
where {userName} is user name and {propertyKey} is property key
Request format -
Example:
- {CONFLUENCE_URL}/rest/extender/1.0/user/property/admin/user.organisation.position.full.name
Response format - JSON
Set avatar for any user
Using base64 image
Method type -
URL:
{CONFLUENCE_URL}/rest/extender/1.0/user/avatar/base64/{userName}
where {userName} is user name
Request format -
Example:
- {CONFLUENCE_URL}/rest/extender/1.0/user/avatar/base64/rick
Response format - JSON
Using image from disk
Method type -
URL:
{CONFLUENCE_URL}/rest/extender/1.0/user/avatar/image/{userName}
where {userName} is user name
Request format -
Curl example:
Postman example:
In Body select form-data → In KEY write file and select image in VALUE
Response format - JSON
Pagination
This REST API uses pagination to improve performance for all Jira users. Pagination is enforced for methods that could return a large collection of items. When you make a request to a paged API, the response will wrap the returned array of values in a JSON object with paging metadata, for example:
Where:
startAt
is the index of the first item returned in the page of results.maxResults
is the maximum number of items that can be returned per page. Each API endpoint may have a different limit for the number of items returned, and these limits may change without notice. (default value - 1000)total
is the total number of items contained in all pages. This number may change as the client requests the subsequent pages, therefore the client should always assume that the requested page can be empty.