Manage groups

You can use the portal service to access and manage groups in an organization. A group is a container for items available to a specific set of users in the portal.

Working with groups

Groups are used to organize and share items and define which users can access and view specified content. You can create groups of hosted layers, web maps, or any other item type. Or you can create a group and add users to it, allowing them to collaborate and share items within the group.

The typical workflow for using groups is to:

  1. Define a group in the portal.
  2. Add items the group.
  3. Add users to the group.
  4. Manage the group properties.

Code examples

Search for a group

Find a one or more groups in the portal using a query.

APIs

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS API for PythonArcGIS REST JS
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
        portal = new Portal(); // Default is "https://www.arcgis.com/sharing/rest"
        portal.load().then(()=>{
        const query = {
          query: "water"
        };
        portal.queryGroups(query).then((response)=>{
          console.log(response);
        });
      });

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
curl https://www.arcgis.com/sharing/rest/community/groups \
-d 'q=water' \
-d 'f=pjson'

Create a new group

Define a new group and how it can be accessed.

APIs

ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Use dark colors for code blocksCopy
1
2
3
4
from arcgis.gis import GIS
gis = GIS(username="USERNAME", password="PASSWORD")
group = gis.groups.create(title="Traffic issues", tags="traffic", access="public")
print(group)

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
5
curl https://www.arcgis.com/sharing/rest/community/createGroup \
-d 'title=Traffic issues' \
-d 'access=public' \
-d 'f=pjson' \
-d 'token=<ACCESS_TOKEN>'

Invite users to a group

Invite users by their user names.

APIs

ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Use dark colors for code blocksCopy
1
2
3
4
5
from arcgis.gis import GIS
gis = GIS(username="USERNAME", password="PASSWORD")
group = gis.groups.get("GROUP_ID")
results = group.invite_users(usernames=["USER_TO_INVITE"])
print(results)

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
5
6
curl  https://www.arcgis.com/sharing/rest/community/groups/<GROUP_ID>/invite \
-d 'users=<USER_TO_INVITE>' \
-d 'role=group member' \
-d 'expiration=20160' \
-d 'f=pjson' \
-d 'token=<ACCESS_TOKEN>'

Add items to a group

Add an item to group to be shared with a set of users.

APIs

ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Use dark colors for code blocksCopy
1
2
3
4
5
from arcgis.gis import GIS
gis = GIS(username="USERNAME", password="PASSWORD")
item = gis.content.get("ITEM_ID")
results = item.share(groups="GROUP_ID")
print(results)

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
curl  https://www.arcgis.com/sharing/rest/content/users/<USERNAME>/items/<ITEM_ID>/share \
-d 'f=json' \
-d 'groups=<GROUP_ID>' \
-d 'token=<ACCESS_TOKEN>'

Search for group content

Find items shared with a group using a query.

APIs

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS API for PythonArcGIS REST JS
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
        const portal = new Portal();
        portal.url = "https://www.arcgis.com/"
        portal.load()
          .then(()=> {

          const portalGroup = new PortalGroup({
            id: "d6340748701d4ccfb18ad3c42b7feb9e",
            portal: portal
          });
          const queryParameters = {
            query: "bike"
          };

          portalGroup.queryItems(queryParameters).then((response)=>{
            console.log(response);
          });
        });

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
curl  https://www.arcgis.com/sharing/rest/content/groups/d6340748701d4ccfb18ad3c42b7feb9e/search \
-d 'q=bike' \
-d 'f=pjson'

Update properties

Change the properties of a group such as the name, description, and permissions.

APIs

ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Use dark colors for code blocksCopy
1
2
3
4
5
6
from arcgis.gis import GIS

gis = GIS(username="USERNAME", password="PASSWORD")
group = gis.groups.get("GROUP_ID")
results = group.update("new")  # new title
print(results)

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
curl  https://www.arcgis.com/sharing/rest/community/groups/GROUP_ID/update \
-d 'title=new' \
-d 'f=pjson' \
-d 'token=<ACCESS_TOKEN>'

Tutorials

Use tools to create different types of content and build content-driven applications.

Web maps

Web scenes

Feature layers

Vector tile layers

Basemap layers

Services

Portal service

Store, manage, and access private and public content.

API support

SearchItemsUsersGroups
ArcGIS Maps SDK for JavaScript11
ArcGIS Maps SDK for .NET11
ArcGIS Maps SDK for Kotlin11
ArcGIS Maps SDK for Swift11
ArcGIS Maps SDK for Java11
ArcGIS Maps SDK for Qt11
ArcGIS API for Python
ArcGIS REST JS
Esri Leaflet2222
MapLibre GL JS2222
OpenLayers2222
Full supportPartial supportNo support
  • 1. Limited operations, use HTTP requests.
  • 2. Access via ArcGIS REST JS.

Tools

Use tools to access the portal and create and manage content for applications.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.