ArcGIS portals are collaborative environments where users organize into groups to share content and coordinate work. The arcgisutils package provides functions to programmatically access user profiles and group information.
Objective
This tutorial will teach you how to:
- Get information about individual users
- List all users in a portal
- Access user profile information and group memberships
- Get information about groups
Authentication
Working with users and groups typically requires authentication:
library(arcgisutils) set_arc_token(auth_user())
Some user and group information may be publicly accessible, but most operations require an authenticated session.
Working with Users
Getting User Information
You can retrieve information about a specific user using arc_user(), which accepts either a username or user ID:
# Get user by username docs_user <- arc_user("r-bridge-docs") docs_user
#> <PortalUser<r-bridge-docs>> #> id: 778a476b439c493798f3b0f24867caef #> fullName: R-ArcGIS Bridge #> created: 2025-10-27 21:11:25
The arc_user() function returns a PortalUser object, which is a list with a custom print method. The object contains extensive information about the user:
# View all available fields names(docs_user)
#> [1] "username" "udn" "id" #> [4] "fullName" "availableCredits" "assignedCredits" #> [7] "categories" "emailStatus" "emailStatusDate" #> [10] "firstName" "lastName" "preferredView" #> [13] "description" "email" "userType" #> [16] "idpUsername" "favGroupId" "lastLogin" #> [19] "mfaEnabled" "mfaEnforcementExempt" "storageUsage" #> [22] "storageQuota" "orgId" "role" #> [25] "privileges" "level" "userLicenseTypeId" #> [28] "disabled" "tags" "culture" #> [31] "cultureFormat" "region" "units" #> [34] "thumbnail" "access" "created" #> [37] "modified" "provider" "groups"
Accessing User Profile Details
User objects contain many useful fields:
# User's full name docs_user$fullName
#> [1] "R-ArcGIS Bridge"
# User role docs_user$role
#> [1] "org_publisher"
# Account creation date docs_user$created
#> [1] "2025-10-27 21:11:25 UTC"
# Last modified date docs_user$modified
#> [1] "2025-10-27 21:22:52 UTC"
Viewing User’s Groups
One particularly useful field is the groups data frame, which contains information about all groups the user belongs to:
# View user's groups docs_user$groups
#> id title isInvitationOnly #> 1 857070a5ce37454ea0ead28075efb304 R Testing (Shared Update) TRUE #> 2 8bc581d3d5ca4a9bb97b0e4babcb5555 R Testing TRUE #> 3 f9907a2b9dfc4a789054ade541f930b3 Analysis Team FALSE #> owner description #> 1 mbass_ANGP NA #> 2 mbass_ANGP NA #> 3 testprodhive1 NA #> snippet #> 1 Content for testing the R-ArcGIS Bridge. Group members have edit privileges to all content. #> 2 Data for testing the R-ArcGIS Bridge and R API #> 3 A group to manage analysis testing harness data #> tags typeKeywords phone sortField sortOrder #> 1 NULL NULL NA added desc #> 2 R NULL NA title asc #> 3 GeoAnalytics, testing, test data NULL NA avgRating desc #> isViewOnly featuredItemsId thumbnail created modified access #> 1 FALSE NA r-arcgis.png 1.753304e+12 1.753304e+12 private #> 2 FALSE NA <NA> 1.680536e+12 1.706192e+12 private #> 3 FALSE NA <NA> 1.601328e+12 1.633112e+12 org #> capabilities isFav isReadOnly protected autoJoin notificationsEnabled #> 1 updateitemcontrol FALSE FALSE FALSE FALSE FALSE #> 2 NULL FALSE FALSE FALSE FALSE FALSE #> 3 NULL FALSE FALSE FALSE FALSE FALSE #> provider providerGroupName leavingDisallowed hiddenMembers membershipAccess #> 1 NA NA FALSE FALSE org #> 2 NA NA FALSE FALSE <NA> #> 3 NA NA FALSE FALSE <NA> #> displaySettings properties userMembership #> 1 NA r-bridge-docs, member #> 2 NA r-bridge-docs, member #> 3 NA r-bridge-docs, member
# Extract just the group titles docs_user$groups$title
#> [1] "R Testing (Shared Update)" "R Testing" #> [3] "Analysis Team"
Getting the Current User
To get information about yourself (the currently authenticated user), use arc_user_self():
# Get your own user information me <- arc_user_self() me
#> $username #> [1] "r-bridge-docs" #> #> $udn #> NULL #> #> $id #> [1] "778a476b439c493798f3b0f24867caef" #> #> $fullName #> [1] "R-ArcGIS Bridge" #> #> $availableCredits #> [1] 391230.2 #> #> $assignedCredits #> [1] -1 #> #> $categories #> NULL #> #> $emailStatus #> [1] "verified" #> #> $emailStatusDate #> [1] "2025-11-18 16:41:42 UTC" #> #> $firstName #> [1] "R-ArcGIS" #> #> $lastName #> [1] "Bridge" #> #> $preferredView #> NULL #> #> $description #> NULL #> #> $email #> [1] "jparry@esri.com" #> #> $userType #> [1] "arcgisonly" #> #> $idpUsername #> NULL #> #> $favGroupId #> [1] "51b6eaac78d6481eb9427e4712c1adec" #> #> $lastLogin #> [1] "2026-03-10 14:52:01 UTC" #> #> $mfaEnabled #> [1] FALSE #> #> $mfaEnforcementExempt #> [1] FALSE #> #> $storageUsage #> [1] 720983084406 #> #> $storageQuota #> [1] 2.199023e+12 #> #> $orgId #> [1] "hLJbHVT9ZrDIzK0I" #> #> $role #> [1] "org_publisher" #> #> $privileges #> [1] "features:user:edit" #> [2] "portal:publisher:bulkPublishFromDataStores" #> [3] "portal:publisher:createDataPipelines" #> [4] "portal:publisher:publishDynamicImagery" #> [5] "portal:publisher:publishFeatures" #> [6] "portal:publisher:publishKnowledgeGraph" #> [7] "portal:publisher:publishLivestreamVideo" #> [8] "portal:publisher:publishScenes" #> [9] "portal:publisher:publishServerServices" #> [10] "portal:publisher:publishTiledImagery" #> [11] "portal:publisher:publishTiles" #> [12] "portal:publisher:publishVideo" #> [13] "portal:publisher:registerDataStores" #> [14] "portal:user:addExternalMembersToGroup" #> [15] "portal:user:allowBetaAccess" #> [16] "portal:user:arcgispro:takeLicenseOffline" #> [17] "portal:user:categorizeItems" #> [18] "portal:user:createGroup" #> [19] "portal:user:createItem" #> [20] "portal:user:createWorkflow" #> [21] "portal:user:joinGroup" #> [22] "portal:user:joinNonOrgGroup" #> [23] "portal:user:shareGroupToOrg" #> [24] "portal:user:shareGroupToPublic" #> [25] "portal:user:shareToGroup" #> [26] "portal:user:shareToOrg" #> [27] "portal:user:shareToPublic" #> [28] "portal:user:useAIAssistants" #> [29] "portal:user:viewHostedFeatureServices" #> [30] "portal:user:viewHostedTileServices" #> [31] "portal:user:viewOrgGroups" #> [32] "portal:user:viewOrgItems" #> [33] "portal:user:viewOrgUsers" #> [34] "premium:publisher:rasteranalysis" #> [35] "premium:user:basemaps" #> [36] "premium:user:boundaries" #> [37] "premium:user:demographics" #> [38] "premium:user:elevation" #> [39] "premium:user:featurereport" #> [40] "premium:user:geocode" #> [41] "premium:user:geocode:stored" #> [42] "premium:user:geocode:temporary" #> [43] "premium:user:geoenrichment" #> [44] "premium:user:geometry" #> [45] "premium:user:networkanalysis" #> [46] "premium:user:networkanalysis:closestfacility" #> [47] "premium:user:networkanalysis:lastmiledelivery" #> [48] "premium:user:networkanalysis:locationallocation" #> [49] "premium:user:networkanalysis:optimizedrouting" #> [50] "premium:user:networkanalysis:origindestinationcostmatrix" #> [51] "premium:user:networkanalysis:routing" #> [52] "premium:user:networkanalysis:servicearea" #> [53] "premium:user:networkanalysis:snaptoroads" #> [54] "premium:user:networkanalysis:vehiclerouting" #> [55] "premium:user:places" #> [56] "premium:user:spatialanalysis" #> [57] "premium:user:staticMaps" #> [58] "premium:user:staticbasemaptiles" #> #> $level #> [1] "2" #> #> $userLicenseTypeId #> [1] "advancedUT" #> #> $disabled #> [1] FALSE #> #> $tags #> NULL #> #> $culture #> [1] "en" #> #> $cultureFormat #> [1] "us" #> #> $region #> [1] "WO" #> #> $units #> [1] "english" #> #> $thumbnail #> NULL #> #> $access #> [1] "org" #> #> $created #> [1] "2025-10-27 21:11:25 UTC" #> #> $modified #> [1] "2025-10-27 21:22:52 UTC" #> #> $provider #> [1] "arcgis" #> #> $groups #> # A data frame: 3 × 31 #> id title isInvitationOnly owner description snippet tags typeKeywords #> * <chr> <chr> <lgl> <chr> <lgl> <chr> <list> <list> #> 1 857070a5… R Te… TRUE mbas… NA Conten… <NULL> <NULL> #> 2 8bc581d3… R Te… TRUE mbas… NA Data f… <chr> <NULL> #> 3 f9907a2b… Anal… FALSE test… NA A grou… <chr> <NULL> #> # ℹ 23 more variables: phone <lgl>, sortField <chr>, sortOrder <chr>, #> # isViewOnly <lgl>, featuredItemsId <lgl>, thumbnail <chr>, created <dttm>, #> # modified <dttm>, access <chr>, capabilities <list>, isFav <lgl>, #> # isReadOnly <lgl>, protected <lgl>, autoJoin <lgl>, #> # notificationsEnabled <lgl>, provider <lgl>, providerGroupName <lgl>, #> # leavingDisallowed <lgl>, hiddenMembers <lgl>, membershipAccess <chr>, #> # displaySettings <list>, properties <lgl>, userMembership <list>
# Your username me$username
#> [1] "r-bridge-docs"
# Your organization ID me$orgId
#> [1] "hLJbHVT9ZrDIzK0I"
arc_user_self() is useful when you need to programmatically work with your own content or verify your authentication status.
Listing All Portal Users
To retrieve a list of all users in your portal, use arc_portal_users():
# Get all users in the portal all_users <- arc_portal_users()
This returns a data frame with information about each user:
# View specific columns all_users[c("id", "userType", "created", "modified")]
#> # A data frame: 169 × 4 #> id userType created modified #> * <chr> <chr> <dttm> <dttm> #> 1 0e4b539238cf122f92c57ac9740… both 2011-12-21 22:01:11 2025-02-19 18:19:32 #> 2 1c448b39a6d54416afc934097d8… arcgiso… 2023-10-03 19:36:47 2025-02-19 18:31:59 #> 3 aa1850a666f094dfce77462ea3c… both 2011-08-22 19:42:47 2025-08-21 19:20:49 #> 4 e46331bf67f7fe290e4c39de8e3… arcgiso… 2013-12-18 22:17:54 2025-02-19 18:22:02 #> 5 d4a698365c4bcdd598169159bd8… both 2013-02-12 22:44:00 2025-02-19 18:23:13 #> 6 53ac27c526504553a0c5bbdd76e… both 2022-03-02 01:29:31 2025-02-19 18:31:59 #> 7 999a5bd06b694a7b8e01118119f… both 2020-07-21 22:27:11 2025-02-19 18:40:52 #> 8 d1adb5f07ade14131f7b15d9b5f… both 2013-03-22 22:27:14 2025-02-19 18:39:56 #> 9 7177e27a2497485c8d81a46dec8… both 2020-11-03 06:15:49 2024-11-06 23:57:21 #> 10 b6ac4b33d79d4102aee00c216f4… both 2024-11-06 20:51:15 2025-02-19 18:29:21 #> # ℹ 159 more rows
Using User IDs
Once you have user IDs from arc_portal_users(), you can fetch detailed information about specific users:
# Filter to get a specific user's ID docs_user_id <- subset( all_users, username == "r-bridge-docs", select = "id", drop = TRUE ) # Get detailed user information by ID arc_user(docs_user_id)
#> <PortalUser<r-bridge-docs>> #> id: 778a476b439c493798f3b0f24867caef #> fullName: R-ArcGIS Bridge #> created: 2025-10-27 21:11:25
You can use this approach with multiple IDs to fetch information about several users at once.
Working with Groups
Getting Group Information
If you have a group ID, you can retrieve metadata about the group using arc_group():
# Get group by ID web_app_templates <- arc_group("2f0ec8cb03574128bd673cefab106f39") # View the structure str(web_app_templates, max.level = 1)
#> List of 32 #> $ id : chr "2f0ec8cb03574128bd673cefab106f39" #> $ title : chr "Web Application Templates" #> $ isInvitationOnly : logi TRUE #> $ owner : chr "esri_en" #> $ description : chr "<span style='color:rgb(36, 41, 47); font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Helvet"| __truncated__ #> $ snippet : chr "Templates for publishing your web map application." #> $ tags : chr [1:3] "Esri" "Colors" "templates" #> $ typeKeywords : NULL #> $ phone : chr "" #> $ sortField : NULL #> $ sortOrder : NULL #> $ isViewOnly : logi FALSE #> $ featuredItemsId : NULL #> $ thumbnail : chr "thumbnail1679686061624.png" #> $ created : POSIXct[1:1], format: "2012-02-10 00:27:49" #> $ modified : POSIXct[1:1], format: "2023-03-24 19:27:42" #> $ access : chr "public" #> $ capabilities : NULL #> $ isFav : logi FALSE #> $ isReadOnly : logi FALSE #> $ protected : logi FALSE #> $ autoJoin : logi FALSE #> $ notificationsEnabled: logi FALSE #> $ provider : NULL #> $ providerGroupName : NULL #> $ leavingDisallowed : logi FALSE #> $ hiddenMembers : logi FALSE #> $ displaySettings :List of 1 #> $ orgId : chr "none" #> $ properties : NULL #> $ userMembership :List of 2 #> $ robots : chr [1:2] "noindex" "nofollow" #> - attr(*, "class")= chr [1:2] "PortalGroup" "list"
The arc_group() function returns a PortalGroup object containing information such as:
# Group title web_app_templates$title
#> [1] "Web Application Templates"
# Group description web_app_templates$description
#> [1] "<span style='color:rgb(36, 41, 47); font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size:14px; font-style:normal; font-variant-ligatures:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; background-color:rgb(255, 255, 255); text-decoration-style:initial; text-decoration-color:initial; display:inline !important;'>Make it easy for your audience to engage with your maps and data by sharing them using configurable app templates such as ArcGIS Instant Apps. In a few minutes, you can select a template, choose configuration options, and share a web app that addresses your audience's needs. Instant Apps are built to support accessibility across audiences and devices, and are included with ArcGIS Online, ArcGIS Pro, and ArcGIS Enterprise.</span>"
# Group owner web_app_templates$owner
#> [1] "esri_en"
# Group access level (private, org, public) web_app_templates$access
#> [1] "public"
Finding Group IDs
Group IDs can be found in several ways:
- From a user’s groups:
# Get groups for a user user <- arc_user("r-bridge-docs") # View group IDs and titles user$groups[c("id", "title")]
#> id title #> 1 857070a5ce37454ea0ead28075efb304 R Testing (Shared Update) #> 2 8bc581d3d5ca4a9bb97b0e4babcb5555 R Testing #> 3 f9907a2b9dfc4a789054ade541f930b3 Analysis Team
- From the group URL in ArcGIS Online or Enterprise. The group ID is in the URL:
group_url <- "https://www.arcgis.com/home/group.html?id=2f0ec8cb03574128bd673cefab106f39#overview" arc_open(group_url)
#> <PortalGroup<Web Application Templates>> #> id: 2f0ec8cb03574128bd673cefab106f39 #> owner: esri_en #> created: 2012-02-10 00:27:49
- From your own groups as the current user:
# Get your groups me <- arc_user_self() me$groups[c("id", "title")]
#> # A data frame: 3 × 2 #> id title #> * <chr> <chr> #> 1 857070a5ce37454ea0ead28075efb304 R Testing (Shared Update) #> 2 8bc581d3d5ca4a9bb97b0e4babcb5555 R Testing #> 3 f9907a2b9dfc4a789054ade541f930b3 Analysis Team
Listing Group Users
It is possible to also list all of the users in a group using the arc_group_users() function.
arc_group_users(me$groups$id[1])
#> # A data frame: 3 × 6 #> username fullName memberType thumbnail joined orgId #> * <chr> <chr> <chr> <list> <dttm> <chr> #> 1 jparry_ANGP Josiah Parry admin <NULL> 2025-07-23 20:54:46 hLJbHV… #> 2 mbass_ANGP Martha Bass admin <NULL> 2025-07-23 20:54:29 hLJbHV… #> 3 r-bridge-docs R-ArcGIS Bridge member <NULL> 2025-10-27 21:11:25 hLJbHV…