> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # SetMemberPrivacySettings # Package: privacy # Namespace: MemberPrivacySettingsService # Method link: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/privacy/member-privacy-settings/set-member-privacy-settings.md ## Permission Scopes: Manage Members: SCOPE.DC-MEMBERS.MANAGE-MEMBERS ## Introduction Sets the member privacy settings for a site. Each time the member privacy settings are updated, `revision` increments by 1. The existing `revision` must be included when updating the member privacy settings. This ensures you're working with the latest member privacy settings and prevents unintended overwrites. --- ## REST API ### Schema ``` Method: setMemberPrivacySettings Description: Sets the member privacy settings for a site. Each time the member privacy settings are updated, `revision` increments by 1. The existing `revision` must be included when updating the member privacy settings. This ensures you're working with the latest member privacy settings and prevents unintended overwrites. URL: https://www.wixapis.com/members/v1/privacy-settings Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: memberPrivacySettings, memberPrivacySettings.revision Method parameters: param name: memberPrivacySettings | type: MemberPrivacySettings | description: Settings that determine who can see site members' profiles and who is allowed to make member profiles public. | required: true - name: publicMemberVisibility | type: Visibility | description: Who can see the public member profiles. - enum: - UNKNOWN: Unknown member visibility. This value isn't used. - VISIBLE_TO_MEMBERS_ONLY: The members' profiles are only visible to logged-in site members. - VISIBLE_TO_ALL: All site visitors can see the members' profiles. - name: publicMemberCandidates | type: Candidates | description: Who can make the member profile public. - enum: - UNKNOWN: Unknown public member candidate. This value isn't used. - NO_ONE: All members have private profiles with no option to make them public. - ANYONE: All members can make the profile public. - name: revision | type: string | description: Revision number, which increments by 1 each time the member privacy settings are updated. To prevent conflicting changes, the existing revision must be used when updating member privacy settings. | required: true Return type: SetMemberPrivacySettingsResponse - name: memberPrivacySettings | type: MemberPrivacySettings | description: Member privacy settings. - name: id | type: string | description: Member privacy settings GUID. - name: publicMemberVisibility | type: Visibility | description: Who can see the public member profiles. - enum: - UNKNOWN: Unknown member visibility. This value isn't used. - VISIBLE_TO_MEMBERS_ONLY: The members' profiles are only visible to logged-in site members. - VISIBLE_TO_ALL: All site visitors can see the members' profiles. - name: publicMemberCandidates | type: Candidates | description: Who can make the member profile public. - enum: - UNKNOWN: Unknown public member candidate. This value isn't used. - NO_ONE: All members have private profiles with no option to make them public. - ANYONE: All members can make the profile public. - name: revision | type: string | description: Revision number, which increments by 1 each time the member privacy settings are updated. To prevent conflicting changes, the existing revision must be used when updating member privacy settings. - name: updatedDate | type: string | description: Date and time when the member privacy settings were updated. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_SETTINGS | Description: The provided `publicMemberVisibility` or `publicMemberCandidates` values are not supported. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_REVISION | Description: The `revision` value doesn't match the current revision of the member privacy settings. ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.privacy.MemberPrivacySettingsService.setMemberPrivacySettings(memberPrivacySettings) Description: Sets the member privacy settings for a site. Each time the member privacy settings are updated, `revision` increments by 1. The existing `revision` must be included when updating the member privacy settings. This ensures you're working with the latest member privacy settings and prevents unintended overwrites. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: memberPrivacySettings, memberPrivacySettings.revision Method parameters: param name: memberPrivacySettings | type: MemberPrivacySettings | description: Settings that determine who can see site members' profiles and who is allowed to make member profiles public. | required: true - name: publicMemberVisibility | type: Visibility | description: Who can see the public member profiles. - enum: - UNKNOWN: Unknown member visibility. This value isn't used. - VISIBLE_TO_MEMBERS_ONLY: The members' profiles are only visible to logged-in site members. - VISIBLE_TO_ALL: All site visitors can see the members' profiles. - name: publicMemberCandidates | type: Candidates | description: Who can make the member profile public. - enum: - UNKNOWN: Unknown public member candidate. This value isn't used. - NO_ONE: All members have private profiles with no option to make them public. - ANYONE: All members can make the profile public. - name: revision | type: string | description: Revision number, which increments by 1 each time the member privacy settings are updated. To prevent conflicting changes, the existing revision must be used when updating member privacy settings. | required: true Return type: PROMISE - name: memberPrivacySettings | type: MemberPrivacySettings | description: Member privacy settings. - name: _id | type: string | description: Member privacy settings GUID. - name: publicMemberVisibility | type: Visibility | description: Who can see the public member profiles. - enum: - UNKNOWN: Unknown member visibility. This value isn't used. - VISIBLE_TO_MEMBERS_ONLY: The members' profiles are only visible to logged-in site members. - VISIBLE_TO_ALL: All site visitors can see the members' profiles. - name: publicMemberCandidates | type: Candidates | description: Who can make the member profile public. - enum: - UNKNOWN: Unknown public member candidate. This value isn't used. - NO_ONE: All members have private profiles with no option to make them public. - ANYONE: All members can make the profile public. - name: revision | type: string | description: Revision number, which increments by 1 each time the member privacy settings are updated. To prevent conflicting changes, the existing revision must be used when updating member privacy settings. - name: _updatedDate | type: Date | description: Date and time when the member privacy settings were updated. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_SETTINGS | Description: The provided `publicMemberVisibility` or `publicMemberCandidates` values are not supported. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_REVISION | Description: The `revision` value doesn't match the current revision of the member privacy settings. ``` ### Examples ### Set Member Privacy Settings ```javascript // @description: Updates the member privacy settings for a site. Call getMemberPrivacySettings first to retrieve the current revision. import { memberPrivacySettings } from "@wix/members"; const memberPrivacySettingsData = { publicMemberVisibility: memberPrivacySettings.Visibility.VISIBLE_TO_ALL, publicMemberCandidates: memberPrivacySettings.Candidates.ANYONE, revision: "1", }; async function setMemberPrivacySettings() { const response = await memberPrivacySettings.setMemberPrivacySettings( memberPrivacySettingsData ); return response; } /* Promise resolves to: * { * memberPrivacySettings?: { * _id?: string | null; * publicMemberVisibility?: "UNKNOWN" | "VISIBLE_TO_MEMBERS_ONLY" | "VISIBLE_TO_ALL"; * publicMemberCandidates?: "UNKNOWN" | "NO_ONE" | "ANYONE"; * revision?: string | null; * _updatedDate?: Date | null; * }; * } */ ``` ### setMemberPrivacySettings (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { memberPrivacySettings } from '@wix/members'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { memberPrivacySettings }, // Include the auth strategy and host as relevant }); async function setMemberPrivacySettings(memberPrivacySettings) { const response = await myWixClient.memberPrivacySettings.setMemberPrivacySettings(memberPrivacySettings); }; ``` ---