> 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 # BulkUpdateResources # Package: resources # Namespace: ResourcesService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/bulk-update-resources.md ## Permission Scopes: Manage Bookings: SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS ## Introduction Updates multiple resources. Refer to [Update Resource](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/update-resource.md) for more details. --- ## REST API ### Schema ``` Method: bulkUpdateResources Description: Updates multiple resources. Refer to [Update Resource](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/update-resource.md) for more details. URL: https://www.wixapis.com/bookings/v2/bulk/resources/update Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: resources, resources.resource.id, resources.resource.revision Method parameters: param name: resources | type: array | description: Resources to update. | required: true - name: resource | type: Resource | description: Resource to update. - name: id | type: string | description: Resource GUID. | required: true - name: revision | type: string | description: Revision number, which increments by 1 each time the resource is updated. To prevent conflicting changes, the current revision must be passed when updating the resource. | required: true - name: name | type: string | description: Name of the resource. - name: typeId | type: string | description: GUID of the [resource type](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resource-types-v2/introduction.md). Once a type has been set it can't be modified. You can create a resource without specifying a type. However, customers can't book such resources. - name: workingHoursSchedules | type: WorkingHoursSchedules | description: Information about the [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md) specifying the working hours and locations of the resource. Resources without a working hour schedule are available 24/7 at the locations specified in the field `locationOptions`. When both `workingHoursSchedules` and `locationOptions` are set, `workingHoursSchedules` takes precedence. - name: values | type: array | description: Schedules specifying the working hours of the resource. Currently, only a single schedule is supported. - name: scheduleId | type: string | description: GUID of the working hour [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md). - name: locationOptions | type: LocationOptions | description: Information about the location where the resource is available. - name: availableInAllLocations | type: boolean | description: Whether the resource is available in all [business locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md#location-types). - `true`: The resource is available in all business locations. - `false`: The resource is available only in specific locations. Default: `false` - name: specificLocationOptions | type: SpecificLocation | description: Details of resource availability in specific locations. - name: availableInBusinessLocations | type: boolean | description: Whether the resource is available in [business locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md#location-types). - `true`: The resource is available in business locations. - `false`: The resource isn't available in business locations. Default: `false` - name: businessLocations | type: array | description: Information about the business locations where the resource is available. Not returned, if the resource is available in either all business locations or in no business location. You can specify up to 100 business locations. - name: locationId | type: string | description: GUID of the business [location](https://dev.wix.com/docs/rest/business-management/locations/introduction.md). - name: extendedFields | type: ExtendedFields | description: Extensions enabling users to save custom data related to the resource. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: fieldMask | type: | description: Explicit list of fields to update. param name: returnEntity | type: returnEntity | description: Whether to include the updated resources in the response. Default: `false` Return type: BulkUpdateResourcesResponse - name: results | type: array | description: The result of each resource update. - name: itemMetadata | type: ItemMetadata | description: Item metadata. - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item). - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: item | type: Resource | description: The resulting resource after the bulk operation. - name: id | type: string | description: Resource GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the resource is updated. To prevent conflicting changes, the current revision must be passed when updating the resource. - name: createdDate | type: string | description: Time in `YYYY-MM-DDThh:mm:ss.sssZ` format the resource was created. - name: updatedDate | type: string | description: Time in `YYYY-MM-DDThh:mm:ss.sssZ` format the resource was last updated. - name: name | type: string | description: Name of the resource. - name: typeId | type: string | description: GUID of the [resource type](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resource-types-v2/introduction.md). Once a type has been set it can't be modified. You can create a resource without specifying a type. However, customers can't book such resources. - name: workingHoursSchedules | type: WorkingHoursSchedules | description: Information about the [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md) specifying the working hours and locations of the resource. Resources without a working hour schedule are available 24/7 at the locations specified in the field `locationOptions`. When both `workingHoursSchedules` and `locationOptions` are set, `workingHoursSchedules` takes precedence. - name: values | type: array | description: Schedules specifying the working hours of the resource. Currently, only a single schedule is supported. - name: scheduleId | type: string | description: GUID of the working hour [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md). - name: shared | type: boolean | description: Whether the schedule is shared by multiple resources or unique for this resource. Default: `false` - name: locationOptions | type: LocationOptions | description: Information about the location where the resource is available. - name: availableInAllLocations | type: boolean | description: Whether the resource is available in all [business locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md#location-types). - `true`: The resource is available in all business locations. - `false`: The resource is available only in specific locations. Default: `false` - name: specificLocationOptions | type: SpecificLocation | description: Details of resource availability in specific locations. - name: availableInBusinessLocations | type: boolean | description: Whether the resource is available in [business locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md#location-types). - `true`: The resource is available in business locations. - `false`: The resource isn't available in business locations. Default: `false` - name: businessLocations | type: array | description: Information about the business locations where the resource is available. Not returned, if the resource is available in either all business locations or in no business location. You can specify up to 100 business locations. - name: locationId | type: string | description: GUID of the business [location](https://dev.wix.com/docs/rest/business-management/locations/introduction.md). - name: eventsSchedule | type: EventsSchedule | description: Schedule containing the [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction.md) for which the resource has been booked. - name: scheduleId | type: string | description: GUID of the event [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md). - name: extendedFields | type: ExtendedFields | description: Extensions enabling users to save custom data related to the resource. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: bulkActionMetadata | type: BulkActionMetadata | description: Update statistics. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_WORKING_HOURS_SHARED_IS_REQUIRED | Description: `workingHoursSchedules.shared` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_WORKING_HOURS_SCHEDULE_ID_IS_REQUIRED | Description: `workingHoursSchedules.scheduleId` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_AVAILABLE_IN_BUSINESS_LOCATION_MUST_BE_TRUE | Description: `availableInBusinessLocations` must be set to `true`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_SPECIFIC_LOCATION_OPTIONS_MUST_BE_SET | Description: `specificLocationOptions` must be set when `availableInAllLocations` is set to `false` or empty. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_SPECIFIC_LOCATION_OPTIONS_NOT_ALLOWED | Description: `specificLocationOptions` can't be set when `availableInAllLocations` is set to `true`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_LOCATION_ID_IS_REQUIRED | Description: Business location GUID is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_NAME_IS_REQUIRED | Description: Resource `name` can't be empty. ``` ### Examples ### Update multiple resources. ```curl curl -X POST \ 'https://www.wixapis.com/bookings/v2/bulk/resources/update' \ -H 'Authorization: ' \ -d '{ "resources": [ { "resource": { "id": "ef5f8d3d-9269-490c-a067-a3d226fcb5d8", "revision": "1", "name": "Updated Small Meeting Room" } }, { "resource": { "id": "77c7a7d1-0045-47eb-bef7-f1bcac5f68e1", "revision": "2", "name": "Large Conference Room", "locationOptions": { "availableInAllLocations": false, "specificLocationOptions": { "availableInBusinessLocations": true, "businessLocations": [ { "locationId": "808dfb00-0a74-4e70-bb3b-f96ff6ba1246" } ] } } } } ], "returnEntity": true }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.resources.ResourcesService.bulkUpdateResources(resources, options) Description: Updates multiple resources. Refer to [Update Resource](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/update-resource.md) for more details. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: resources, resources.resource._id, resources.resource.revision Method parameters: param name: options | type: BulkUpdateResourcesOptions none - name: returnEntity | type: boolean | description: Whether to include the updated resources in the response. Default: `false` param name: resources | type: array | description: Resources to update. | required: true - name: resource | type: Resource | description: Resource to update. - name: _id | type: string | description: Resource GUID. | required: true - name: revision | type: string | description: Revision number, which increments by 1 each time the resource is updated. To prevent conflicting changes, the current revision must be passed when updating the resource. | required: true - name: name | type: string | description: Name of the resource. - name: typeId | type: string | description: GUID of the [resource type](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resource-types-v2/introduction.md). Once a type has been set it can't be modified. You can create a resource without specifying a type. However, customers can't book such resources. - name: workingHoursSchedules | type: WorkingHoursSchedules | description: Information about the [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md) specifying the working hours and locations of the resource. Resources without a working hour schedule are available 24/7 at the locations specified in the field `locationOptions`. When both `workingHoursSchedules` and `locationOptions` are set, `workingHoursSchedules` takes precedence. - name: values | type: array | description: Schedules specifying the working hours of the resource. Currently, only a single schedule is supported. - name: scheduleId | type: string | description: GUID of the working hour [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md). - name: locationOptions | type: LocationOptions | description: Information about the location where the resource is available. - name: availableInAllLocations | type: boolean | description: Whether the resource is available in all [business locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md#location-types). - `true`: The resource is available in all business locations. - `false`: The resource is available only in specific locations. Default: `false` - name: specificLocationOptions | type: SpecificLocation | description: Details of resource availability in specific locations. - name: availableInBusinessLocations | type: boolean | description: Whether the resource is available in [business locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md#location-types). - `true`: The resource is available in business locations. - `false`: The resource isn't available in business locations. Default: `false` - name: businessLocations | type: array | description: Information about the business locations where the resource is available. Not returned, if the resource is available in either all business locations or in no business location. You can specify up to 100 business locations. - name: locationId | type: string | description: GUID of the business [location](https://dev.wix.com/docs/rest/business-management/locations/introduction.md). - name: extendedFields | type: ExtendedFields | description: Extensions enabling users to save custom data related to the resource. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: fieldMask | type: array | description: Explicit list of fields to update. Return type: PROMISE - name: results | type: array | description: The result of each resource update. - name: itemMetadata | type: ItemMetadata | description: Item metadata. - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item). - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: item | type: Resource | description: The resulting resource after the bulk operation. - name: _id | type: string | description: Resource GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the resource is updated. To prevent conflicting changes, the current revision must be passed when updating the resource. - name: _createdDate | type: Date | description: Time in `YYYY-MM-DDThh:mm:ss.sssZ` format the resource was created. - name: _updatedDate | type: Date | description: Time in `YYYY-MM-DDThh:mm:ss.sssZ` format the resource was last updated. - name: name | type: string | description: Name of the resource. - name: typeId | type: string | description: GUID of the [resource type](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resource-types-v2/introduction.md). Once a type has been set it can't be modified. You can create a resource without specifying a type. However, customers can't book such resources. - name: workingHoursSchedules | type: WorkingHoursSchedules | description: Information about the [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md) specifying the working hours and locations of the resource. Resources without a working hour schedule are available 24/7 at the locations specified in the field `locationOptions`. When both `workingHoursSchedules` and `locationOptions` are set, `workingHoursSchedules` takes precedence. - name: values | type: array | description: Schedules specifying the working hours of the resource. Currently, only a single schedule is supported. - name: scheduleId | type: string | description: GUID of the working hour [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md). - name: shared | type: boolean | description: Whether the schedule is shared by multiple resources or unique for this resource. Default: `false` - name: locationOptions | type: LocationOptions | description: Information about the location where the resource is available. - name: availableInAllLocations | type: boolean | description: Whether the resource is available in all [business locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md#location-types). - `true`: The resource is available in all business locations. - `false`: The resource is available only in specific locations. Default: `false` - name: specificLocationOptions | type: SpecificLocation | description: Details of resource availability in specific locations. - name: availableInBusinessLocations | type: boolean | description: Whether the resource is available in [business locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md#location-types). - `true`: The resource is available in business locations. - `false`: The resource isn't available in business locations. Default: `false` - name: businessLocations | type: array | description: Information about the business locations where the resource is available. Not returned, if the resource is available in either all business locations or in no business location. You can specify up to 100 business locations. - name: locationId | type: string | description: GUID of the business [location](https://dev.wix.com/docs/rest/business-management/locations/introduction.md). - name: eventsSchedule | type: EventsSchedule | description: Schedule containing the [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction.md) for which the resource has been booked. - name: scheduleId | type: string | description: GUID of the event [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md). - name: extendedFields | type: ExtendedFields | description: Extensions enabling users to save custom data related to the resource. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: bulkActionMetadata | type: BulkActionMetadata | description: Update statistics. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_WORKING_HOURS_SHARED_IS_REQUIRED | Description: `workingHoursSchedules.shared` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_WORKING_HOURS_SCHEDULE_ID_IS_REQUIRED | Description: `workingHoursSchedules.scheduleId` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_AVAILABLE_IN_BUSINESS_LOCATION_MUST_BE_TRUE | Description: `availableInBusinessLocations` must be set to `true`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_SPECIFIC_LOCATION_OPTIONS_MUST_BE_SET | Description: `specificLocationOptions` must be set when `availableInAllLocations` is set to `false` or empty. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_SPECIFIC_LOCATION_OPTIONS_NOT_ALLOWED | Description: `specificLocationOptions` can't be set when `availableInAllLocations` is set to `true`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_LOCATION_ID_IS_REQUIRED | Description: Business location GUID is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: RESOURCE_NAME_IS_REQUIRED | Description: Resource `name` can't be empty. ``` ### Examples ### bulkUpdateResources ```javascript import { resources } from '@wix/bookings'; async function bulkUpdateResources(resources,options) { const response = await resources.bulkUpdateResources(resources,options); }; ``` ### bulkUpdateResources (with elevated permissions) ```javascript import { resources } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function myBulkUpdateResourcesMethod(resources,options) { const elevatedBulkUpdateResources = auth.elevate(resources.bulkUpdateResources); const response = await elevatedBulkUpdateResources(resources,options); } ``` ### bulkUpdateResources (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 { resources } from '@wix/bookings'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { resources }, // Include the auth strategy and host as relevant }); async function bulkUpdateResources(resources,options) { const response = await myWixClient.resources.bulkUpdateResources(resources,options); }; ``` ---