# manage-portal-user-groups Manage the user groups that gate access to APIs and content inside an API Experience Hub portal. Use when an admin needs to list, create, update, or delete user groups, or to manage group mappings (links between external identity-provider groups and AEH user groups). These groups are the unit used for per-version asset visibility and member assignments. - **APIs:** [api-experience-hub-management](https://dev-portal.mulesoft.com/apis/api-experience-hub-management.md)- **Skill Source:** [SKILL.md](https://dev-portal.mulesoft.com/skills/manage-portal-user-groups/SKILL.md) ## Steps ### Step 1: Step 1: List AEH Connections **API:** `urn:api:api-experience-hub-management`**Operation:** `getConnections` **Outputs:** - `connectionId` (`$[*].id`) — AEH connection ID backing the portal ### Step 2: Step 2: List Portals on the Connection **API:** `urn:api:api-experience-hub-management`**Operation:** `getAllApiPortalByConnectionId` **Inputs:** - `connectionId` — Connection ID from Step 1 **Outputs:** - `portalId` (`$[*].id`) — ID of the portal whose user groups you'll manage ### Step 3: Step 3: List User Groups (Profiles) **API:** `urn:api:api-experience-hub-management`**Operation:** `getAllProfilesByPortal` **Inputs:** - `connectionId` — Connection ID - `portalId` — Portal ID **Outputs:** - `userGroups` (`$.profiles[*]`) — Existing user groups (profiles) on the portal - `userGroupId` (`$.profiles[*].id`) — ID of a specific user group, used by update/delete ### Step 4: Step 4: Create a New User Group **API:** `urn:api:api-experience-hub-management`**Operation:** `createUserGroup` **Inputs:** - `connectionId` — Connection ID - `portalId` — Portal ID - `userGroupRequest` — Definition of the new user group **Outputs:** - `createdUserGroupId` (`$.id`) — The newly created user group ID ### Step 5: Step 5: Update an Existing User Group **API:** `urn:api:api-experience-hub-management`**Operation:** `updateUserGroup` **Inputs:** - `connectionId` — Connection ID - `portalId` — Portal ID - `userGroupId` — ID of the user group to update - `userGroupRequest` — Updated name/description for the user group **Outputs:** - `updatedUserGroupId` (`$.id`) — Confirmed ID of the updated user group ### Step 6: Step 6: Delete a User Group (Optional) **API:** `urn:api:api-experience-hub-management`**Operation:** `deleteUserGroup` **Inputs:** - `connectionId` — Connection ID - `portalId` — Portal ID - `userGroupId` — ID of the user group to delete **Outputs:** - `deletedUserGroupId` (`$.id`) — Confirmation of the deleted user group ### Step 7: Step 7: List Group Mappings **API:** `urn:api:api-experience-hub-management`**Operation:** `getGroupMappings` **Inputs:** - `connectionId` — Connection ID - `portalId` — Portal ID **Outputs:** - `groupMappings` (`$.mappings[*]`) — Existing IdP-to-AEH group mappings - `groupMappingId` (`$.mappings[*].id`) — ID used to delete a mapping ### Step 8: Step 8: Create a Group Mapping **API:** `urn:api:api-experience-hub-management`**Operation:** `addAdditionalGroupMapping` **Inputs:** - `connectionId` — Connection ID - `portalId` — Portal ID - `mappingRequest` — Mapping between an external IdP group and an AEH user group **Outputs:** - `createdGroupMappingId` (`$.id`) — The newly created mapping ID ### Step 9: Step 9: Delete a Group Mapping (Optional) **API:** `urn:api:api-experience-hub-management`**Operation:** `deleteGroupMappings` **Inputs:** - `connectionId` — Connection ID - `portalId` — Portal ID - `groupMappingId` — ID of the mapping to remove **Outputs:** - `deletedGroupMappingId` (`$.id`) — Confirmation of the removed mapping