About the Members API

The Members API allows you to create and manage a site's members.

With the Members API, you can:

  • Create, update, and delete site members.
  • Retrieve member's information from your site.
  • Add the currently logged in member to your site's community, or remove the member from your site's community.
  • Clear a member's contact information such as their addresses, phone numbers, and emails.

Before you begin

It’s important to note that you must have a site with a members area.

Terminology

  • Members: Site visitors who have signed up as members through your site's Member Signup Form. Members have their own profiles and can interact with other members of the site community.
  • Site Community: A platform on your site where members can interact with eachother.
Was this helpful?
Yes
No

Setup

To use the Members API, install the @wix/members package using npm or Yarn:

Copy
1
npm install @wix/members

or

Copy
1
yarn add @wix/members

Then import { members } from @wix/members:

Copy
1
import { members } from '@wix/members'
Was this helpful?
Yes
No

createMember( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a site member.

After creation, you can use the sendSetPasswordEmail() function in the Members Authentication API to email the member with a link to set their password. The member can log in to the site once they set their password for the first time.

Note: When creating multiple members, set your requests at least 1 second apart to keep below rate limits.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Members
Learn more about permission scopes.
Copy
function createMember(member: Member): Promise<Member>
Method Parameters
memberMemberRequired
Member to create.
Returns
Return Type:Promise<Member>
Was this helpful?
Yes
No

deleteMember( )

Deletes a member.

The deleteMember() function returns a Promise that resolves to a member object when the specified member is deleted.

Note: This function permanently deletes a member. Once deleted, a member cannot be restored.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Members
Learn more about permission scopes.
Copy
function deleteMember(_id: string): Promise<void>
Method Parameters
_idstringRequired
ID of the member to delete.
Returns
Return Type:Promise<void>
Was this helpful?
Yes
No

deleteMemberAddresses( )

Deletes a member's street addresses.

The deleteMemberAddresses() function clears the addresses array under the contact property.

Note: Only logged-in members can call this function without elevated permissions. To call this function as a different identity, elevated permissions are required.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Members
Manage Bookings Services and Settings
Learn more about permission scopes.
Copy
function deleteMemberAddresses(_id: string): Promise<DeleteMemberAddressesResponse>
Method Parameters
_idstringRequired
ID of the member whose street addresses will be deleted.
Returns
Return Type:Promise<DeleteMemberAddressesResponse>
Was this helpful?
Yes
No

deleteMemberEmails( )

Clears a member's email addresses.

The deleteMemberEmails() function clears the emails array under the contact property.

Notes: A member can still log in with their loginEmail, which is not cleared when this function is called.

Only logged-in members can call this function without elevated permissions. To call this function as a different identity, elevated permissions are required.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Members
Manage Bookings Services and Settings
Learn more about permission scopes.
Copy
function deleteMemberEmails(_id: string): Promise<DeleteMemberEmailsResponse>
Method Parameters
_idstringRequired
ID of the member whose email addresses will be deleted.
Returns
Return Type:Promise<DeleteMemberEmailsResponse>
Was this helpful?
Yes
No

deleteMemberPhones( )

Clears a member's phone numbers.

The deleteMemberPhones() function clears the phones array under the contact property.

Note: Only logged-in members can call this function without elevated permissions. To call this function as a different identity, elevated permissions are required.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Members
Manage Bookings Services and Settings
Learn more about permission scopes.
Copy
function deleteMemberPhones(_id: string): Promise<DeleteMemberPhonesResponse>
Method Parameters
_idstringRequired
ID of the member whose phone numbers will be deleted.
Returns
Return Type:Promise<DeleteMemberPhonesResponse>
Was this helpful?
Yes
No

getCurrentMember( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves the currently logged-in member.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Members
Manage Bookings Services and Settings
Read Members and Contacts - all read permissions
Read Members
Manage Members and Contacts - all permissions
Learn more about permission scopes.
Copy
function getCurrentMember(options: GetCurrentMemberOptions): Promise<GetMyMemberResponse>
Method Parameters
optionsGetCurrentMemberOptions
Returns
Return Type:Promise<GetMyMemberResponse>
Was this helpful?
Yes
No

getMember( )

Retrieves a member by ID.

Note: The returned Member object contains only the fields that were explicitly added to the Member object. Custom Contact fields are not automatically added to the Member object. They must be added to the Member object by the site owner.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Members
Manage Bookings Services and Settings
Read Members and Contacts - all read permissions
Read Members
Manage Members and Contacts - all permissions
Learn more about permission scopes.
Copy
function getMember(_id: string, options: GetMemberOptions): Promise<Member>
Method Parameters
_idstringRequired
Member ID.

optionsGetMemberOptions
Fieldset options.
Returns
Return Type:Promise<Member>
Was this helpful?
Yes
No

joinCommunity( )

Joins the currently logged-in member to the site community and sets their profile to public.

When a member's profile is public, they have access to the site's Members Area features — such as chat, forum, and followers — and their profile is visible to other members and site visitors.

Note: Only logged-in members can call this function without elevated permissions. To call this function as a different identity, elevated permissions are required.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Bookings Services and Settings
Learn more about permission scopes.
Copy
function joinCommunity(): Promise<JoinCommunityResponse>
Request
This method does not take any parameters
Returns
Return Type:Promise<JoinCommunityResponse>
Was this helpful?
Yes
No

leaveCommunity( )

Removes the currently logged-in member from the site community and sets their profile to private.

When a member's profile is private, they do not have access to the site's Members Area features — such as chat, forum, and followers — and their profile is hidden from other members and site visitors.

Notes:

  • If a member leaves the site's community, their content (such as forum posts and blog comments) remain publicly visible.
  • Only logged-in members can call this function without elevated permissions.
  • To call this function as a different identity, elevated permissions are required.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Bookings Services and Settings
Learn more about permission scopes.
Copy
function leaveCommunity(): Promise<LeaveCommunityResponse>
Request
This method does not take any parameters
Returns
Return Type:Promise<LeaveCommunityResponse>
Was this helpful?
Yes
No

listMembers( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Lists site members, given the provided paging and fieldsets.

  • PUBLIC fieldset returns id and profile object. status, privacyStatus and activityStatus are returned as UNKNOWN.
  • FULL fieldset returns all fields.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Members
Manage Bookings Services and Settings
Read Members and Contacts - all read permissions
Read Members
Manage Members and Contacts - all permissions
Learn more about permission scopes.
Copy
function listMembers(options: ListMembersOptions): Promise<ListMembersResponse>
Method Parameters
optionsListMembersOptions
Options for paging, sorting, and specifying fields to return.
Returns
Return Type:Promise<ListMembersResponse>
Was this helpful?
Yes
No

queryMembers( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a list of up to 100 members, given the provided filters, fieldsets, sorting and paging, and returns a MembersQueryBuilder object.

The returned object contains the query definition which is typically used to run the query using the find() function.

You can refine the query by chaining MembersQueryBuilder functions onto the query. MembersQueryBuilder functions enable you to sort, filter, and control the results that queryMembers() returns. The functions that are chained to queryMembers() are applied in the order they are called.

queryMembers() runs with the following MembersQueryBuilder defaults that you can override:

  • skip: 0
  • limit: 50

Currently supported fields for sorting:

  • profile.nickname
  • contact.firstName
  • contact.lastName
  • createdDate
  • lastLoginDate

The following MembersQueryBuilder functions are supported for the queryMembers() function. For a full description of the Locations object, see the returned for the items property in MembersQueryResult.

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),ne(),exists(),in(),hasSome(),startsWith()
loginEmaileq(),ne(),exists(),in(),hasSome(),startsWith()
contact.firstNameeq(),ne(),exists(),in(),hasSome(),startsWith()
contact.lastNameeq(),ne(),exists(),in(),hasSome(),startsWith()
profile.nicknameeq(),ne(),exists(),in(),hasSome(),startsWith()
profile.slugeq(),ne(),exists(),in(),hasSome(),startsWith()
privacyStatuseq(),ne(),exists(),in(),hasSome()

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Members
Manage Bookings Services and Settings
Read Members and Contacts - all read permissions
Read Members
Manage Members and Contacts - all permissions
Learn more about permission scopes.
Copy
function queryMembers(options: QueryMembersOptions): MembersQueryBuilder
Method Parameters
optionsQueryMembersOptions
Query options.
Returns
Was this helpful?
Yes
No

updateCurrentMemberSlug( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Updates the currently logged in member's slug.

The slug is the end of a member's URL that refers to a specific logged-in member. For example, if a member's URL is https://example.com/member/{my-member-slug}, the slug is my-member-slug. The slug is case-sensitive and is generally derived from the member's nickname; otherwise, it's derived from the loginEmail.

Note: Only logged-in members can call this function without elevated permissions. To call this function as a different identity, elevated permissions are required.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Members
Manage Bookings Services and Settings
Learn more about permission scopes.
Copy
function updateCurrentMemberSlug(slug: string): Promise<UpdateMySlugResponse>
Method Parameters
slugstringRequired
New slug.
Returns
Return Type:Promise<UpdateMySlugResponse>
Was this helpful?
Yes
No

updateMember( )

Updates a member's properties.

Only the requested fields are updated. To clear a field's value, set an empty value with an empty string "".

Note: Updating the contact.addresses, contact.emails, or contact.phones array overwrites the entire array, so any existing values you want to retain must be passed in the updateMember() call along with the new values to add. However, passing an empty array will have no effect, and these functions must be used to clear all data from the respective array:

  • To clear contact.addresses, use deleteMemberAddresses().
  • To clear contact.emails, use deleteMemberEmails().
  • To clear contact.phones, use deleteMemberPhones().

Note: Only logged-in members can call this function without elevated permissions. To call this function as a different identity, elevated permissions are required.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Members
Manage Bookings Services and Settings
Learn more about permission scopes.
Copy
function updateMember(_id: string, member: UpdateMember): Promise<Member>
Method Parameters
_idstringRequired
Member ID.

memberUpdateMemberRequired
Returns
Return Type:Promise<Member>
Was this helpful?
Yes
No