# Hierarchy Management Welcome to the Hierarchy Management API documentation for Annex Cloud! We are thrilled to walk you through the exciting world of loyalty-based interactions and engagement. Our Hierarchy Management API allows you to seamlessly integrate and enhance your loyalty program by tracking real-time Hierarchy Management details, enabling you to create personalized experiences for your valued customers. The API methods covered in this document will enable you to create new groups, manage the activities of existing groups, and retrieve group details. ## Create group - [POST /group - HM](https://annexcloud.redocly.app/loyalty/loyalty/hierarchy-management/postgrouphm.md): This method is used to create a group and add members to the group. The loyalty member who creates the group automatically becomes the group owner. Note - When the Group Invitation Acceptance Required flag is turned ON, the response body includes invitedBy and invitationStatus in place of the status parameter. ## Get group information - [GET /group/{{groupId}} - HM](https://annexcloud.redocly.app/loyalty/loyalty/hierarchy-management/getgroupgroupifhm.md): This method is used to get group information by passing the unique group ID. ## Update group details or dissolve group - [PATCH /group/{{groupId}} - HM](https://annexcloud.redocly.app/loyalty/loyalty/hierarchy-management/patchgroupgroupidhm.md): This method is used to update the group details. This method can also be used to dissolve a group. ## Get invite details - [GET /group/invite/{{memberId}} - HM](https://annexcloud.redocly.app/loyalty/loyalty/hierarchy-management/getgroupinviteemailidhm.md): This method is used to retrieve the invitation details for a loyalty member. Members can only belong to one group at a time but can receive multiple group invites before accepting. ## Accept or Decline group invitation - [PATCH /group/invite/{{memberId}} - HM](https://annexcloud.redocly.app/loyalty/loyalty/hierarchy-management/patchgroupinviteemailidhm.md): This method is used for accepting or declining group invitations by the loyalty member. Note - The group acceptance criteria only works when the Group Invitation Acceptance Required flag is enabled at the site level. ## Send group invitations / Add members to the group - [POST /group/invite - HM](https://annexcloud.redocly.app/loyalty/loyalty/hierarchy-management/postgroupinvitehm.md): This method is used to send invitations to loyalty members if invites are required. If invitations are not required, this method is used to directly add members to a group. ## Leave the group - [PATCH /group/leave/{{memberId}} - HM](https://annexcloud.redocly.app/loyalty/loyalty/hierarchy-management/patchgroupleaveemailidhm.md): This method allows group members to leave the group. If the "Restrict Members from Leaving Group" flag is enabled at site level, members are not permitted to leave the group without the group owner's permission. This method can then be used for a group owner to approve or reject a request to leave. ## Remove a member from the group - [PUT /group/remove/{{memberId}} - HM](https://annexcloud.redocly.app/loyalty/loyalty/hierarchy-management/putgroupremoveemailidhm.md): This method is used for removing a group member from the group. ## Update Member Role - [PATCH /group/role/{{memberId}} - HM](https://annexcloud.redocly.app/loyalty/loyalty/hierarchy-management/patchgrouproleemailidhm.md): This method is used to update the member's role. The group owner has the authority to update the member's role. ## Get group activity details - [GET /group/{{groupId}}/activity - HM](https://annexcloud.redocly.app/loyalty/loyalty/hierarchy-management/getgroupgroupidactivityhm.md): This method is used to get the activity details of the group by passing unique group ID. ## Fetches the point expiration details for a specific group - [GET /pointsexpiry/group/{{groupId}} - HM](https://annexcloud.redocly.app/loyalty/loyalty/hierarchy-management/getpointsexpirygroupgrupidhm.md): This API retrieves point expiration details for a specified group based on the provided group ID, date range, and page number. Users can group results by week, month, quarter, or year using the aggregate_by parameter. The response includes both expired points and points set to expire within the aggregation period.