> 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

# ChangeContributorLocation

# Package: sites

# Namespace: SiteRolesManagementService

# Method link: https://dev.wix.com/docs/api-reference/account-level/user-management/sites/contributors/change-contributor-location.md

## Permission Scopes:
View google ads campaigns: SCOPE.PROMOTE.VIEW-GOOGLE-ADS

## Introduction

Updates the business locations within all a contributor's role assignments for the specified site, overriding any existing locations.

Replaces all existing location assignments for the contributor's roles with the locations specified in `newLocations`. Get location IDs from the [Locations API](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md).

---

## REST API

### Schema

```
 Method: changeContributorLocation
 Description: Updates the business locations within all a contributor's role assignments for the specified site, overriding any existing locations.  Replaces all existing location assignments for the contributor's roles with the locations specified in `newLocations`. Get location GUIDs from the [Locations API](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md).
 URL: https://www.wixapis.com/roles-management/contributor/change/locations
 Method: PUT
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  accountId, newLocations
 Method parameters: 
   param name: accountId | type: accountId | description: Contributor's account GUID. | required: true | validation: format GUID
   param name: newLocations | type: array<newLocations> | description: Location GUIDs to assign to the contributor's role assignments on the site. Replaces all existing location assignments. Get location GUIDs from the [Locations API](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). | required: true | validation: maxItems 20, format GUID
 Return type: ChangeContributorLocationResponse
  - name: newAssignedLocations | type: array<SiteLocationAssignment> | description: Locations assigned to the contributor's role assignments on the site.  | validation: maxItems 20
     - name: locationIds | type: array<string> | description: Location GUIDs assigned to the contributor's role assignments.  | validation: maxItems 100, format GUID
     - name: assignmentIds | type: array<string> | description: Assignment GUIDs mapping the locations to the contributor's role assignments on the site.  | read-only: true | validation: maxItems 999, maxLength 20


```

### Examples

### Change contributor location
```curl
curl -X PUT \
'https://www.wixapis.com/roles-management/contributor/change/locations' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
-d '{
        "accountId": "fed9597b-00a1-4bd6-0000-aff2ec248e7a",
        "newLocations": [
          "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "b2c3d4e5-f6a7-8901-bcde-f12345678901"
        ]
      }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.userManagement.contributors.changeContributorLocation(accountId, options)
 Description: Updates the business locations within all a contributor's role assignments for the specified site, overriding any existing locations.  Replaces all existing location assignments for the contributor's roles with the locations specified in `newLocations`. Get location GUIDs from the [Locations API](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  accountId, options.newLocations, options
 Method parameters: 
   param name: accountId | type: string | description: Contributor's account GUID. | required: true | validation: format GUID
   param name: options | type: ChangeContributorLocationOptions  none | required: true 
        - name: newLocations | type: array<string> | description: Location GUIDs to assign to the contributor's role assignments on the site. Replaces all existing location assignments. Get location GUIDs from the [Locations API](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). | required: true | validation: maxItems 20, format GUID
 Return type: PROMISE<ChangeContributorLocationResponse>
  - name: newAssignedLocations | type: array<SiteLocationAssignment> | description: Locations assigned to the contributor's role assignments on the site.  | validation: maxItems 20
     - name: locationIds | type: array<string> | description: Location GUIDs assigned to the contributor's role assignments.  | validation: maxItems 100, format GUID
     - name: assignmentIds | type: array<string> | description: Assignment GUIDs mapping the locations to the contributor's role assignments on the site.  | read-only: true | validation: maxItems 999, maxLength 20


```

### Examples

### Change a contributor's assigned locations with an API key
```javascript
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { contributors } from "@wix/user-management";
const wixClient = createClient({
 modules: { contributors },
 auth: ApiKeyStrategy({
    siteId: "MY-SITE-ID",
    apiKey: "MY-API-KEY",
  }),
});

async function changeContributorLocation(accountId, options) {
  const response = await contributors.changeContributorLocation(accountId, options);
}


```

### changeContributorLocation (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 { contributors } from '@wix/user-management';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function changeContributorLocation(accountId,options) {
  const response = await myWixClient.contributors.changeContributorLocation(accountId,options);
};
```

---