> 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: userManagement # Namespace: SiteRolesManagementService # Method link: https://dev.wix.com/docs/api-reference/account-level/user-management/contributors/change-contributor-location.md ## Permission Scopes: View SEO Settings: SCOPE.PROMOTE.VIEW-SEO ## 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 param name: newLocations | type: array | 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 Return type: ChangeContributorLocationResponse - name: newAssignedLocations | type: array | description: Locations assigned to the contributor's role assignments on the site. - name: locationIds | type: array | description: Location GUIDs assigned to the contributor's role assignments. - name: assignmentIds | type: array | description: Assignment GUIDs mapping the locations to the contributor's role assignments on the site. ``` ### Examples ### Change contributor location ```curl curl -X PUT \ 'https://www.wixapis.com/roles-management/contributor/change/locations' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ -d '{ "accountId": "fed9597b-00a1-4bd6-0000-aff2ec248e7a", "newLocations": [ "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "b2c3d4e5-f6a7-8901-bcde-f12345678901" ] }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.userManagement.SiteRolesManagementService.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 param name: options | type: ChangeContributorLocationOptions none | required: true - name: newLocations | type: array | 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 Return type: PROMISE - name: newAssignedLocations | type: array | description: Locations assigned to the contributor's role assignments on the site. - name: locationIds | type: array | description: Location GUIDs assigned to the contributor's role assignments. - name: assignmentIds | type: array | description: Assignment GUIDs mapping the locations to the contributor's role assignments on the site. ``` ### 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); }; ``` ---