REST API - Users

General informations

Available for Confluence Administrators

 


Get all users (only those with access to use Confluence)

This API supports Pagination

This API supports optional parameters

This API returns only users with access to use Confluence

Method type - GET

URL

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getUsersWithConfluenceAccess

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getUsersWithConfluenceAccess?showBasicDetails=true

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getUsersWithConfluenceAccess?showExtendedDetails=true

Calling with a parameter showBasicDetails or showExtendedDetails may affect the response time

Parameters:

  • showBasicDetails, showExtendedDetails - for details please check Example response

  • dateFormat - define date format for date fields in output JSON - default format ‘yyyy-MM-dd'

Respons format: JSON

Example response:

  • Without parameters

{ "total": 2, "maxResults": 50, "startAt": 0, "users": [ { "name": "new_user" }, { "name": "admin" } ] }
  • With parameter showBasicDetails=true

{ "total": 2, "maxResults": 50, "startAt": 0, "users": [ { "name": "new_user", "fullName": "New user", "key": "4128810272455d7b0172457188c10000", "email": "new@user.pl" }, { "name": "admin", "fullName": "admin", "key": "4128810272455d7b0172457188c10005", "email": "admin@admin.com" } ] }
  • With parameter showExtendedDetails=true

"total": 1, "maxResults": 50, "startAt": 0, "users": [ { "business": [ { "location": "", "position": "", "department": "" } ], "lastFailedLoginDate": null, "lastSuccessfulLoginDate": null, "fullName": "Admin CEO", "personal": [ { "website": "", "im": "", "phone": "" } ], "updatedDate": 1590302967994, "lastFailedLoginDateString": null, "createdDate": 1590302967994, "createdDateString": "2020-05-24 08:49:27", "name": "Admin", "lastSuccessfulLoginDateString": null, "key": "4128810272455d7b0172457188c10000", "email": "admin@admin.com", "updatedDateString": "2020-05-24 08:49:27", "hasAccessToUseConfluence": true } ] }

Get all users

Method type - GET

URL

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getAllUsers

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getAllUsers?username=min

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getAllUsers?email=gmail

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getAllUsers?showBasicDetails=true

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getAllUsers?showExtendedDetails=true

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getAllUsers?showBasicDetails=true&email=gmail

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getAllUsers?showExtendedDetails=true&username=min

Parameters:

  • showBasicDetails, showExtendedDetails - for details please check Example response

  • username, email - parameters thanks to which you can search for users containing keywords in the username or e-mail (you can only search for one parameter at a time)

  • dateFormat - define date format for date fields in output JSON - default format ‘yyyy-MM-dd'

Respons format: JSON

Example response:

  • Without parameters

  • With parameter showBasicDetails=true

  • With parameter showExtendedDetails=true

 


Get all inactive users

Method type - GET

URL

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getInactiveUsers

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getInactiveUsers?showBasicDetails=true

  • {CONFLUENCE_URL}/rest/extender/1.0/user/getInactiveUsers?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'

Respons 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 - PUT

URL: {CONFLUENCE_URL}/rest/extender/1.0/user/add

Request format: JSON

  • 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

 


Change username

Method type - POST

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

Response format: JSON




Change user details

Method type - POST

URL: {CONFLUENCE_URL}/rest/extender/1.0/user/changeDetails/{userName}

  • where {userName} is user name

Request format: JSON

  • fullName - required

  • email - required

  • password - required

Response format: JSON

 


Delete user

Method type - delete

URL: {CONFLUENCE_URL}/rest/extender/1.0/user/delete/{userName}

  • where {userName} is user name

Response format: JSON


Clear user CAPTCHA

Method type - delete

URL: {CONFLUENCE_URL}/rest/extender/1.0/user/captcha/{userName}

  • where {userName} is user name

Response format: JSON

 


Activate/deactivate user

Method type - POST

URL (Activate): {CONFLUENCE_URL}/rest/extender/1.0/user/activate/{userName}

URL (Deactivate): {CONFLUENCE_URL}/rest/extender/1.0/user/deactivate/{userName}

  • where {userName} is user name

Response format: JSON

 


Get user property

Method type - GET

URL: {CONFLUENCE_URL}/rest/extender/1.0/user/property/{userName}/{propertyKey}

  • where {userName} is user name and {propertyKey} is property key 

Supported property keys:

  • phone

  • im

  • website

  • position

  • department

  • location

  • aboutMe

Response format: Json

 


Set user property

Method type - PUT

URL: {CONFLUENCE_URL}/rest/extender/1.0/user/property/{userName}/{propertyKey}

  • where {userName} is user name and {propertyKey} is property key 

Supported property keys:

  • phone

  • im

  • website

  • position

  • department

  • location

  • aboutMe

Request format: JSON

Response format: JSON

 


Get an avatar for any user

Method type - GET

URL: {CONFLUENCE_URL}/rest/extender/1.0/avatar/base64/{userName}

  • where {userName} is user name

Response format - JSON

 


Set avatar for any user

Using a base64 image

Method type - PUT

URL: {CONFLUENCE_URL}/rest/extender/1.0/avatar/base64/{userName}

  • where {userName} is user name

Example URL: {CONFLUENCE_URL}/rest/extender/1.0/user/avatar/base64/rick

Request format: JSON

Example:

Response format: JSON

 


Using image from disk

Method type - PUT

URL: {CONFLUENCE_URL}/rest/extender/1.0/avatar/image/{userName}

  • where {userName} is user name

Request format: FILE FROM DISK

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 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 - 50)

  • 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.

 


Changes