On this page

الأعضاء — roles, permissions, titles, supervisors, profiles and removal.

Who may act on whom:

  • role and permissions need users:manage, which only admins hold (it cannot be delegated). No one assigns a role above their own, and nothing may leave a community without an admin (409 LAST_ADMIN).
  • The community's founder is protected: only the founder (or a platform super-admin) can change the founder's role or permissions (403 OWNER_PROTECTED).
  • title, supervisor and profile-as-admin need users:manage or users:moderate (a moderator default), and the target may not rank ABOVE the caller (403 MEMBER_OUTRANKS_ACTOR) — a moderator cannot edit an admin; peers may edit each other.
  • ban and remove need the caller to rank strictly ABOVE the target.
  • memberId is the CommunityMember.id, always resolved inside the URL's community — an id from another community is a 404.

14 endpoints.

MethodPathSummary
POST/api/communities/{communityId}/groups/members/batchMembers of several groups in one call (names and avatars only)
POST/api/communities/{communityId}/join-requestRequest to join a public community
GET/api/communities/{communityId}/member-requestsGet pending member requests (admin/moderator only)
DELETE/api/communities/{communityId}/members/{memberId}Remove member from community (soft delete)
POST/api/communities/{communityId}/members/{memberId}/banBan or unban a member
PUT/api/communities/{communityId}/members/{memberId}/permissionsUpdate member permissions (admin only)
PUT/api/communities/{communityId}/members/{memberId}/profileEdit a member's profile as an admin or moderator
PUT/api/communities/{communityId}/members/{memberId}/roleUpdate member role (admin only)
PUT/api/communities/{communityId}/members/{memberId}/supervisorAssign (or clear) a member's supervisor — المشرف المسؤول
PUT/api/communities/{communityId}/members/{memberId}/titleSet a member's role title and/or honorific
DELETE/api/communities/{communityId}/members/bulkBulk remove members from community
PUT/api/communities/{communityId}/members/me/profileEdit my profile in this community
POST/api/communities/{communityId}/members/supervisors/resolve-by-emailLink supervisors by email in bulk (the Excel import's second pass)
GET/api/communities/{communityId}/users/{userId}/permissionsGet user permissions in community

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—

Request body (required) — application/json

FieldTypeRequiredDescription
groupIdsstring[]yes—
limitintegerno—
orderBystringno—

Responses

StatusDescriptionBody
200Members per group; groups the caller cannot see are dropped—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—

Responses

StatusDescriptionBody
200Join request submitted—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
pagequerynointeger—
limitquerynointeger—

Responses

StatusDescriptionBody
200Paginated list of member requests—
403Permission denied—

Soft-deletes a community member by setting their status to LEFT. Supports both self-removal (user leaving) and admin/moderator-initiated removal.

Behavior:

  • Cascade cleanup: removes group memberships, event attendance, and likes
  • Last admin protection: cannot remove the only COMMUNITY_ADMIN
  • Role hierarchy: moderators cannot remove admins or other moderators
  • Audit trail: stores removal metadata (who, when, reason) in member permissions
  • Real-time: emits member:removed socket event to invalidate active sessions
  • Email: sends removal notification email (admin-initiated removals only)

Authorization:

  • Self-removal: any authenticated member can remove themselves
  • Admin removal: requires users:manage or users:moderate permission

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)UUID of the community
memberIdpathyesstring (uuid)UUID of the community member to remove

Request body — application/json

FieldTypeRequiredDescription
reasonstringnoOptional reason for removal (admin-initiated only, sanitized)

Responses

StatusDescriptionBody
200Member removed successfullyobject
400Bad request - invalid UUID, member already left, member is banned, or last adminobject
401Authentication required—
403Permission denied - insufficient role or cannot remove higher-ranked memberobject
404Member not found—
500Internal server error—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
memberIdpathyesstring (uuid)—

Responses

StatusDescriptionBody
200Ban status toggled successfully—
403Permission denied—

Sets the member's role AND legacy can* flags in one write. role is required (it used to default to MEMBER, silently demoting the target). Refused when it would leave the community with no admin.

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
memberIdpathyesstring (uuid)—

Request body (required) — application/json

FieldTypeRequiredDescription
roleenum: MEMBER, MODERATOR, COMMUNITY_ADMINyes—

Responses

StatusDescriptionBody
200Permissions updated successfully—
400ROLE_REQUIRED, or INVALID_ROLE—
403Needs users:manage (admins only), or a role above your own; OWNER_PROTECTED when the target is the community's founder and the caller is not the founder—
404MEMBER_NOT_FOUND — not an APPROVED member of this community—
409LAST_ADMIN — this would leave the community without an admin—

Same fields as me/profile. Refused for a target ranked above the caller. Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
memberIdpathyesstring (uuid)CommunityMember.id

Responses

StatusDescriptionBody
200profile is the updated MemberProfile—
403Missing permission, or MEMBER_OUTRANKS_ACTOR—
404Member not found in this community—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
memberIdpathyesstring (uuid)—

Request body (required) — application/json

FieldTypeRequiredDescription
roleenum: MEMBER, MODERATOR, COMMUNITY_ADMINyes—
moderatorTitlestringnoOptional, kept only when role is MODERATOR

Responses

StatusDescriptionBody
200Role updated successfully—
400INVALID_ROLE, a title that is too long, or demoting the only Community Admin—
403Needs users:manage, or a role above your own; OWNER_PROTECTED when the target is the community's founder and the caller is not the founder—
404Member not found—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
memberIdpathyesstring (uuid)CommunityMember.id

Request body (required) — application/json

FieldTypeRequiredDescription
supervisorMemberIdstringnoCommunityMember.id of an APPROVED member; null clears

Responses

StatusDescriptionBody
200Updated—
403Missing permission, or MEMBER_OUTRANKS_ACTOR—
404Member or supervisor not found in this community—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
memberIdpathyesstring (uuid)CommunityMember.id

Request body (required) — application/json

FieldTypeRequiredDescription
moderatorTitlestringnoRole-badge title; null clears it
honorificTitlestringnoHonorific; null clears it

Responses

StatusDescriptionBody
200Updated—
400Neither field sent—
403Missing permission, or MEMBER_OUTRANKS_ACTOR—
404MEMBER_NOT_FOUND—

Removes multiple community members in a single request (soft delete, status set to LEFT). Processes removals sequentially to prevent race conditions on memberCount. Returns partial success results — some members may fail while others succeed.

Constraints:

  • Maximum 50 members per request
  • Rate limited: 5 requests per 15 minutes per IP
  • Cannot include your own memberId (self-removal blocked)
  • Last admin protection: cannot remove the only COMMUNITY_ADMIN
  • Role hierarchy: moderators cannot remove admins or other moderators
  • Reason is required (min 3 chars, max 500 chars, sanitized)

Side effects per member:

  • Cascade cleanup: removes group memberships, event attendance, likes
  • Real-time: emits member:removed socket event
  • Email: sends removal notification

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)UUID of the community

Request body (required) — application/json

FieldTypeRequiredDescription
memberIdsstring (uuid)[]yesArray of community member UUIDs to remove
reasonstringyesReason for removal (required, sanitized, min 3 chars)

Responses

StatusDescriptionBody
200Bulk removal completed (may include partial failures)object
400Bad request - invalid input, self-removal attempt, or reason too shortobject
401Authentication required—
403Permission denied - requires users:manage or users:moderate—
429Rate limit exceeded (5 requests per 15 minutes)object
500Internal server error—

Name, phone, bio, city, job and socials are per-community (MemberProfile). multipart/form-data; files avatar, coverImage. Avatars are outside the community storage quota by design. Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—

Responses

StatusDescriptionBody
200profile is the updated MemberProfile—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—

Request body (required) — application/json

FieldTypeRequiredDescription
pairsobject[]no—

Responses

StatusDescriptionBody
200Per-pair results (an unknown email reports MEMBER_NOT_FOUND)—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
userIdpathyesstring (uuid)—

Responses

StatusDescriptionBody
200User permissions—
401Authentication required—