> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# UpdateMemberSlug

# Package: memberManagement

# Namespace: Members

# Method link: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/members/update-member-slug.md

## Permission Scopes:
Manage Members: SCOPE.DC-MEMBERS.MANAGE-MEMBERS

## Introduction

Updates a member's slug.

To update the current member's slug, call [Update My Slug](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/members/update-my-slug.md).

---

## REST API

### Schema

```
 Method: updateMemberSlug
 Description: Updates a member's slug.  To update the current member's slug, call [Update My Slug](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/members/update-my-slug.md).
 URL: https://www.wixapis.com/members/v1/members/{id}/slug
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  slug
 Method parameters: 
   param name: slug | type: slug | description: New slug. | required: true | validation: maxLength 255
 Return type: UpdateMemberSlugResponse
  - name: member | type: Member | description: Updated member.  
     - name: id | type: string | description: Member GUID.  | read-only: true | validation: format GUID
     - name: loginEmail | type: string | description: Email used by a member to log in to the site.  | validation: format EMAIL, immutable
     - name: loginEmailVerified | type: boolean | description: Whether the email used by a member has been verified.  | read-only: true 
     - name: status | type: Status | description: Member site access status.  | read-only: true 
         - enum:
         -     UNKNOWN: Insufficient permissions to get the status.
         -     PENDING: Member is created and is waiting for approval by a Wix user.
         -     APPROVED: Member can log in to the site.
         -     BLOCKED: Member is blocked and can't log in to the site.
         -     OFFLINE: Member is a [guest author](https://support.wix.com/en/article/wix-blog-adding-managed-writers-to-your-blog) for the site blog and can't log in to the site.
     - name: contactId | type: string | description: Contact GUID.  | read-only: true | validation: format GUID
     - name: contact | type: Contact | description: Member's contact information. Contact information is stored in the [Contact List](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fcontacts).  The full set of contact data can be accessed and managed with the [Contacts API](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/introduction.md).  
        - name: firstName | type: string | description: Contact's first name.  
        - name: lastName | type: string | description: Contact's last name.  
        - name: phones | type: array<string> | description: List of phone numbers.  
        - name: emails | type: array<string> | description: List of email addresses.  | validation: format EMAIL, immutable
        - name: addresses | type: array<Address> | description: List of street addresses.  
           - ONE-OF: 
              - name: streetAddress | type: StreetAddress | description: Street address object, with number and name in separate fields.  
                 - name: number | type: string | description: Street number.  | validation: maxLength 100
                 - name: name | type: string | description: Street name.  | validation: maxLength 200
              - name: addressLine | type: string | description: Main address line, usually street and number, as free text.  | validation: maxLength 200
           - name: id | type: string | description: Street address GUID.  | validation: format GUID, immutable
           - name: addressLine2 | type: string | description: Free text providing more detailed address information, such as apartment, suite, or floor.  
           - name: city | type: string | description: City name.  
           - name: subdivision | type: string | description: Code for a subdivision (such as state, prefecture, or province) in an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.  
           - name: country | type: string | description: 2-letter country code in an [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.  
           - name: postalCode | type: string | description: Postal code.  
        - name: birthdate | type: string | description: Contact's birthdate, formatted as `"YYYY-MM-DD"`.  Example: `"2020-03-15"` for March 15, 2020.  | validation: maxLength 100
        - name: company | type: string | description: Contact's company name.  | validation: maxLength 100
        - name: jobTitle | type: string | description: Contact's job title.  | validation: maxLength 100
        - name: customFields | type: Map<string,CustomField> | description: Custom fields, where each key is the field key, and each value is the field's value for the member.  | validation: format map
           - name: name | type: string | description: Custom field name.  
           - name: value | type: Value | description: Custom field value.  
              - ONE-OF: 
                 - name: nullValue | type:  | description:   
                 - name: numberValue | type: number | description:   
                 - name: stringValue | type: string | description:   
                 - name: boolValue | type: boolean | description:   
                 - name: structValue | type: object | description:   
                 - name: listValue | type: ListValue | description:   
                    - name: values | type: array<Value> | description:   
     - name: profile | type: Profile | description: Profile display details.  
        - name: nickname | type: string | description: Name that identifies the member to other members. Displayed on the member's profile page and interactions in the forum or blog.  
        - name: slug | type: string | description: Slug that determines the member's profile page URL.  | read-only: true 
        - name: photo | type: Image | description: Member's profile photo.  
           - name: id | type: string | description: Wix Media image GUID, set when the member selects an image from Wix Media.  
           - name: url | type: string | description: Image URL.  
           - name: height | type: integer | description: Original image width.  
           - name: width | type: integer | description: Original image height.  
           - name: offsetX | type: integer | description: X-axis offset.  Default: `0`.  | validation: format int32
           - name: offsetY | type: integer | description: Y-axis offset.  Default: `0`.  | validation: format int32
        - name: cover | type: Image | description: Member's cover photo, used as a background picture in a member's profile page.  Cover positioning can be altered with `cover.offsetX` and `cover.offsetY`. When left empty, the values default to `0`.  
        - name: title | type: string | description: Member title.  
     - name: privacyStatus | type: Status | description: Member privacy status.  
         - enum:
         -     UNKNOWN: Insufficient permissions to get the status.
         -     PRIVATE: Member is hidden from site visitors and other site members. Member is returned only to Wix users.
         -     PUBLIC: Member is visible to everyone.
     - name: activityStatus | type: Status | description: Member activity status.  | read-only: true 
         - enum:
         -     UNKNOWN: Insufficient permissions to get the status.
         -     ACTIVE: Member can write forum posts and blog comments.
         -     MUTED: Member can't write forum posts or blog comments.
     - name: createdDate | type: string | description: Date and time when the member was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time when the member was updated.  | read-only: true | validation: format date-time
     - name: lastLoginDate | type: string | description: Date and time when the member last logged in to the site.  | read-only: true | validation: format date-time

 Possible Errors:
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: SLUG_ALREADY_EXISTS | Description: There is already a member with this slug.


```

### Examples

### Update Member Slug
```curl
curl -X POST \
  https://www.wixapis.com/members/v1/members/a6a68e95-3821-4b87-9008-b76cdd27f209/slug \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Authorization: <AUTH>'
  -d '{
      "id": "7c86ee9d-9937-4989-98fb-fb5e64131ccc",
      "slug": "john-doe"
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.members.members.updateMemberSlug(_id, slug)
 Description: Updates a member's slug.  To update the current member's slug, call [Update My Slug](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/members/update-my-slug.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  _id, slug
 Method parameters: 
   param name: _id | type: string | description: Member GUID. | required: true | validation: format GUID
   param name: slug | type: string | description: New slug. | required: true | validation: maxLength 255
 Return type: PROMISE<UpdateMemberSlugResponse>
  - name: member | type: Member | description: Updated member.  
     - name: _id | type: string | description: Member GUID.  | read-only: true | validation: format GUID
     - name: loginEmail | type: string | description: Email used by a member to log in to the site.  | validation: format EMAIL, immutable
     - name: loginEmailVerified | type: boolean | description: Whether the email used by a member has been verified.  | read-only: true 
     - name: status | type: Status | description: Member site access status.  | read-only: true 
         - enum:
         -     UNKNOWN: Insufficient permissions to get the status.
         -     PENDING: Member is created and is waiting for approval by a Wix user.
         -     APPROVED: Member can log in to the site.
         -     BLOCKED: Member is blocked and can't log in to the site.
         -     OFFLINE: Member is a [guest author](https://support.wix.com/en/article/wix-blog-adding-managed-writers-to-your-blog) for the site blog and can't log in to the site.
     - name: contactId | type: string | description: Contact GUID.  | read-only: true | validation: format GUID
     - name: contact | type: Contact | description: Member's contact information. Contact information is stored in the [Contact List](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fcontacts).  The full set of contact data can be accessed and managed with the [Contacts API](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/introduction.md).  
        - name: firstName | type: string | description: Contact's first name.  
        - name: lastName | type: string | description: Contact's last name.  
        - name: phones | type: array<string> | description: List of phone numbers.  
        - name: emails | type: array<string> | description: List of email addresses.  | validation: format EMAIL, immutable
        - name: addresses | type: array<Address> | description: List of street addresses.  
           - ONE-OF: 
              - name: streetAddress | type: StreetAddress | description: Street address object, with number and name in separate fields.  
                 - name: number | type: string | description: Street number.  | validation: maxLength 100
                 - name: name | type: string | description: Street name.  | validation: maxLength 200
              - name: addressLine | type: string | description: Main address line, usually street and number, as free text.  | validation: maxLength 200
           - name: _id | type: string | description: Street address GUID.  | validation: format GUID, immutable
           - name: addressLine2 | type: string | description: Free text providing more detailed address information, such as apartment, suite, or floor.  
           - name: city | type: string | description: City name.  
           - name: subdivision | type: string | description: Code for a subdivision (such as state, prefecture, or province) in an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.  
           - name: country | type: string | description: 2-letter country code in an [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.  
           - name: postalCode | type: string | description: Postal code.  
        - name: birthdate | type: string | description: Contact's birthdate, formatted as `"YYYY-MM-DD"`.  Example: `"2020-03-15"` for March 15, 2020.  | validation: maxLength 100
        - name: company | type: string | description: Contact's company name.  | validation: maxLength 100
        - name: jobTitle | type: string | description: Contact's job title.  | validation: maxLength 100
        - name: customFields | type: Map<string,CustomField> | description: Custom fields, where each key is the field key, and each value is the field's value for the member.  | validation: format map
           - name: name | type: string | description: Custom field name.  
           - name: value | type: any<Value> | description: Custom field value.  
              - ONE-OF: 
                 - name: nullValue | type:  | description:   
                 - name: numberValue | type: number | description:   
                 - name: stringValue | type: string | description:   
                 - name: boolValue | type: boolean | description:   
                 - name: structValue | type: object | description:   
                 - name: listValue | type: ListValue | description:   
                    - name: values | type: array<Value> | description:   
     - name: profile | type: Profile | description: Profile display details.  
        - name: nickname | type: string | description: Name that identifies the member to other members. Displayed on the member's profile page and interactions in the forum or blog.  
        - name: slug | type: string | description: Slug that determines the member's profile page URL.  | read-only: true 
        - name: photo | type: Image | description: Member's profile photo.  
           - name: _id | type: string | description: Wix Media image GUID, set when the member selects an image from Wix Media.  
           - name: url | type: string | description: Image URL.  
           - name: height | type: integer | description: Original image width.  
           - name: width | type: integer | description: Original image height.  
           - name: offsetX | type: integer | description: X-axis offset.  Default: `0`.  | validation: format int32
           - name: offsetY | type: integer | description: Y-axis offset.  Default: `0`.  | validation: format int32
        - name: cover | type: Image | description: Member's cover photo, used as a background picture in a member's profile page.  Cover positioning can be altered with `cover.offsetX` and `cover.offsetY`. When left empty, the values default to `0`.  
        - name: title | type: string | description: Member title.  
     - name: privacyStatus | type: Status | description: Member privacy status.  
         - enum:
         -     UNKNOWN: Insufficient permissions to get the status.
         -     PRIVATE: Member is hidden from site visitors and other site members. Member is returned only to Wix users.
         -     PUBLIC: Member is visible to everyone.
     - name: activityStatus | type: Status | description: Member activity status.  | read-only: true 
         - enum:
         -     UNKNOWN: Insufficient permissions to get the status.
         -     ACTIVE: Member can write forum posts and blog comments.
         -     MUTED: Member can't write forum posts or blog comments.
     - name: _createdDate | type: Date | description: Date and time when the member was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time when the member was updated.  | read-only: true 
     - name: lastLoginDate | type: Date | description: Date and time when the member last logged in to the site.  | read-only: true 

 Possible Errors:
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: SLUG_ALREADY_EXISTS | Description: There is already a member with this slug.


```

### Examples

### updateMemberSlug
```javascript
import { members } from '@wix/members';

async function updateMemberSlug(_id,slug) {
  const response = await members.updateMemberSlug(_id,slug);
};
```

### updateMemberSlug (self-managed)
Self-managed 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 { members } from '@wix/members';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { members },
  // Include the auth strategy and host as relevant
});


async function updateMemberSlug(_id,slug) {
  const response = await myWixClient.members.updateMemberSlug(_id,slug);
};
```

---