The Crowd REST APIs allow you to address the Crowd data entities as 'resources'. This means that they are identified by URIs and operated on by HTTP requests, chiefly GET and POST. Whenever you GET one of these resources, you receive a representation encoded using XML or JSON. Below are details of the resources made available by the APIs.
The Crowd 2.0 experimental REST APIs are deprecated
Crowd 2.0 introduced the experimental 'admin
' REST APIs, allowing interactions with the Crowd Administration Console. In the upcoming release of Crowd 2.1, we will replace these with a new set of REST APIs for use by applications connecting to Crowd. This JIRA issue has the details - see the description and the comments: CWD-1912. We will be delighted with your feedback on the JIRA issue too.
URIs for a Crowd REST API resource have the following structure: With context:
1 2http://host:port/context/rest/api-name/api-version/resource-name
Or without context:
1 2http://host:port/rest/api-name/api-version/resource-name
In Crowd 2.0, the only api-name
available is admin
. This is the API that allows interaction with the Crowd Administration Console.
1 2http://myhost.com:8095/crowd/rest/admin/1/directory http://localhost:8095/crowd/rest/admin/latest/directory
Or without context:
1 2http://crowd.myhost.com:8095/rest/admin/1/directory http://crowd.myhost.com:8095/rest/admin/latest/directory
Please refer to the Crowd REST API usage guide for a description of the common factors in the APIs, including a full explanation of the URI format, authentication, API versions, etc.
URI |
|
Description | Lists all the directories managed by the Crowd server. |
URI Parameters | None. |
HTTP Methods |
|
Example of a GET request:
1 2http://localhost:8095/crowd/rest/admin/latest/directory/
Example of XML response:
1 2<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <directories> <directory> <name>Active Directory</name> <type>CONNECTOR</type> <implementationClass>com.atlassian.crowd.integration.directory.connector.MicrosoftActiveDirectory</implementationClass> </directory> <directory> <name>Atlassian Crowd</name> <type>INTERNAL</type> <implementationClass>com.atlassian.crowd.integration.directory.internal.InternalDirectory</implementationClass> </directory> <directory> <name>Crowd Internal</name> <type>INTERNAL</type> <implementationClass>com.atlassian.crowd.integration.directory.internal.InternalDirectory</implementationClass> </directory> <directory> <name>Delegated Auth Directory</name> <type>DELEGATING</type> <implementationClass>com.atlassian.crowd.integration.directory.delegated.DelegatedAuthenticationDirectory</implementationClass> </directory> <directory> <name>Employees</name> <type>INTERNAL</type> <implementationClass>com.atlassian.crowd.integration.directory.internal.InternalDirectory</implementationClass> </directory> <directory> <name>My Own Connector</name> <type>CUSTOM</type> <implementationClass>com.atlassian.crowd.integration.directory.custom.MyOwnConnector</implementationClass> </directory> </directories>
Elements in the response:
Element | Description |
---|---|
| A list of directories defined in Crowd. |
| Refer to the section on directory information CROWD:below for the elements describing each directory. |
Example of JSON response:
1 2{"directories":[ {"name":"Active Directory", "type":"CONNECTOR", "implementationClass":"com.atlassian.crowd.integration.directory.connector.MicrosoftActiveDirectory"},{"name":"Atlassian Crowd", "type":"INTERNAL", "implementationClass":"com.atlassian.crowd.integration.directory.internal.InternalDirectory"},{"name":"Crowd Internal", "type":"INTERNAL", "implementationClass":"com.atlassian.crowd.integration.directory.internal.InternalDirectory"},{"name":"Delegated Auth Directory", "type":"DELEGATING", "implementationClass":"com.atlassian.crowd.integration.directory.delegated.DelegatedAuthenticationDirectory"},{"name":"Employees", "type":"INTERNAL", "implementationClass":"com.atlassian.crowd.integration.directory.internal.InternalDirectory"} {"name":"My Own Connector", "type":"CUSTOM", "implementationClass":"com.atlassian.crowd.integration.directory.custom.MyOwnConnector"}]}
URI |
|
Description | Retrieves information about a specific directory. |
URI Parameters | None. |
HTTP Methods |
|
Example of a request for information about directory 'atlassian crowd':
1 2http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd
Example of XML response:
1 2<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <directory> <name>Atlassian Crowd</name> <type>INTERNAL</type> <implementationClass>com.atlassian.crowd.integration.directory.internal.InternalDirectory</implementationClass> </directory>
Elements in the response:
Element | Description |
---|---|
| A directory defined in Crowd. |
| The name of the directory, as defined in Crowd. |
| The Crowd directory type. Possible values are:
|
| The Java class file that provides the methods for authentication, searching, and creation, deletion and updating the entities in the directory. |
Example of JSON response:
1 2{"name":"Atlassian Crowd", "type":"INTERNAL", "implementationClass":"com.atlassian.crowd.integration.directory.internal.InternalDirectory"}
URI |
|
Description | Lists all the users in the given directory and allows you to add a user to the list. |
URI Parameters |
|
HTTP Methods |
|
Example of a search for users matching 'ad' in directory 'atlassian crowd':
1 2http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/user?search=ad
Example of XML response to the above request:
1 2<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <users> <user> <identifier>adent</identifier> <username>adent</username> <firstName>Arthur</firstName> <lastName>Dent</lastName> <displayName>Arthur Dent</displayName> <emailAddress>adent@example.com</emailAddress> </user> <user> <identifier>admin</identifier> <username>admin</username> <firstName>Admin</firstName> <lastName>Administrator</lastName> <displayName>Admin Administrator</displayName> <emailAddress>admin@example.com</emailAddress> </user> </users>
Elements in the response:
Element | Description |
---|---|
| A list of users in the Crowd directory. |
| Refer to the section on user information CROWD:below for the elements describing each user. |
Example of JSON response for a list of users:
1 2{"users":[ {"identifier":"adent", "username":"adent", "firstName":"Arthur", "lastName":"Dent", "displayName":"Arthur Dent", "emailAddress":"adent@example.com"}, {"identifier":"admin", "username":"admin", "firstName":"Admin", "lastName":"Administrator", "displayName":"Admin Administrator", "emailAddress":"admin@example.com"}]}
URI |
|
Description | Retrieves or updates information about a specific user and allows deletion of the user from the given directory. |
URI Parameters | None. |
HTTP Methods |
|
Here is an example of a request for information on user 'adent' in directory 'atlassian crowd':
1 2http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/user/adent
The following cURL request deletes the user 'adent', using basic authentication where the username and password are both 'admin':
1 2curl -X DELETE http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/user/adent -u admin:admin
Example of XML response giving user information:
1 2<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <user> <identifier>adent</identifier> <username>adent</username> <firstName>Arthur</firstName> <lastName>Dent</lastName> <displayName>Arthur Dent</displayName> <emailAddress>adent@example.com</emailAddress> </user>
Elements in the response:
Element | Description |
---|---|
| A user defined in a Crowd directory. |
| The user's username. Currently, this element contains the same value as the |
| The user's username. |
| The user's first name. |
| The user's last name. |
| The user's full name, composed of first name plus last name. |
| The user's email address. |
Example of JSON response giving user information:
1 2{"identifier":"adent", "username":"adent", "firstName":"Arthur", "lastName":"Dent", "displayName":"Arthur Dent", "emailAddress":"adent@example.com"}
The following cURL request will add the user represented in a user.xml file to the 'atlassian crowd' directory, using basic authentication where the username and password are both 'admin':
1 2curl -X POST --data @user.xml http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/user -H "Content-Type: application/xml" -u admin:admin
Sample XML file:
1 2<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user> <identifier>ghalfrunt</identifier> <username>ghalfrunt</username> <firstName>Gag</firstName> <lastName>Halfrunt</lastName> <displayName>Gag Halfrunt</displayName> <emailAddress>ghalfrunt@example.com</emailAddress> <password>brains</password> </user>
If the POST is successful you will receive the CREATED 201 response code.
URI |
|
Description | Lists all the groups in the given directory. |
URI Parameters |
|
HTTP Methods |
|
Example of a search request for groups matching 'team' in directory 'atlassian crowd':
1 2http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/group?search=team
Example of XML response to the above request:
1 2<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <groups> <group> <identifier>my-team</identifier> <name>my-team</name> <description>My Team</description> <type>GROUP</type> </group> <group> <identifier>team2</identifier> <name>team2</name> <description>Team 2</description> <type>GROUP</type> </group> <group> <identifier>team3</identifier> <name>team3</name> <description>Team 3</description> <type>GROUP</type> </group> <group> <identifier>teamlead</identifier> <name>teamlead</name> <description>Team Leader</description> <type>LEGACY_ROLE</type> </group> </groups>
Elements in the response:
Element | Description | Attributes |
---|---|---|
| A list of groups in the Crowd directory. |
|
| Refer to the section on group information CROWD:below for the elements describing each group. |
|
Example of JSON response for a list of groups:
1 2{"groups":[ {"identifier":"my-team", "name":"my-team", "description":"My Team", "type":"GROUP"}, {"identifier":"team2", "name":"team2", "description":"Team 2", "type":"GROUP"}, {"identifier":"team3", "name":"team3", "description":"Team 3", "type":"GROUP"}, {"identifier":"teamlead", "name":"teamlead", "description":"Team Leader" "type":"LEGACY_ROLE"}]}
URI |
|
Description | Retrieves or updates information about a specific group. |
URI Parameters | None. |
HTTP Methods |
|
Here is an example of a request for information on group 'my-team' in directory 'atlassian crowd':
1 2http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/group/my-team
The following cURL request deletes the group 'my-team', using basic authentication where the username and password are both 'admin':
1 2curl -X DELETE http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/group/my-team -u admin:admin
Example of XML response for group information:
1 2<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <group> <identifier>my-team</identifier> <name>my-team</name> <description>My Team</description> <type>GROUP</type> </group>
Elements in the response:
Element | Description |
---|---|
| A group as defined in a Crowd directory. |
| The group name. Currently, this element contains the same value as the |
| The group name. |
| A description of the group. |
| Indicates whether this item is a group or a role. Possible values are:
|
Example of JSON response for group information:
1 2{"identifier":"my-team", "name":"my-team", "description":"My Team", "type":"GROUP"}
URI |
|
Description | Retrieves a list of the groups a given user belongs to, in the given directory. |
URI Parameters | None. |
HTTP Methods |
|
Here is an example of a request for the groups to which user 'adent' belongs, in directory 'atlassian crowd':
1 2http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/user/adent/memberships
Example of XML response for a list of group memberships:
1 2<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <groups> <group> <identifier>my-team</identifier> <name>my-team</name> <description>My Team</description> <type>GROUP</type> </group> <group> <identifier>techwriter</identifier> <name>techwriter</name> <description>Technical writer</description> <type>LEGACY_ROLE</type> </group> <group> <identifier>confluence-users</identifier> <name>confluence-users</name> <description>Confluence users</description> <type>GROUP</type> </group> </groups>
Elements in the response:
Element | Description |
---|---|
| A list of groups in the Crowd directory. |
| Refer to the section on group information CROWD:above for the elements describing each group. |
Example of JSON response for a list of group members:
1 2{"group": [{"identifier":"my-team", "name":"my-team", "description":"My Team", "type":"GROUP"}, {"identifier":"techwriter", "name":"techwriter", "description":"Technical writer", "type":"LEGACY_ROLE"}, {"identifier":"confluence-users", "name":"confluence-users", "description":"Confluence users", "type":"GROUP"}]}
Overview of the Crowd REST APIs
Crowd Developer Documentation
Rate this page: