> 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 # SearchResources # Package: resources # Namespace: ResourcesService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/search-resources.md ## Permission Scopes: Read Bookings - Public Data: SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC ## Introduction Retrieves a list of resources matching the provided search criteria. --- ## REST API ### Schema ``` Method: searchResources Description: Retrieves a list of resources matching the provided search criteria. URL: https://www.wixapis.com/bookings/v2/resources/search Method: POST Method parameters: param name: search | type: CursorSearch - name: cursorPaging | type: CursorPaging | description: Cursor-based paging for result navigation. When requesting `cursor_paging.cursor`, `filter`, `sort`, or `search` can't be specified. - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object for narrowing search results. For example, to return only resources available at specific business locations: `"filter": {"single_resource.location_options.specific_location_options.business_locations.location_id": {"$in": ["location-id-1", "location-id-2"]}}`. Learn more about the filter format in the [supported filters article](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting.md). - name: sort | type: array | description: Array of sort objects specifying result order. For example, to sort by resource name in ascending order: `"sort": [{"fieldName": "name", "order": "ASC"}]`. Learn more about the sort format in the [supported filters article](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting.md). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC - name: aggregations | type: array | description: Aggregations for grouping data into categories (facets) and providing summaries for each category. For example, use aggregations to categorize search results by resource type, management type, or location availability. - ONE-OF: - name: value | type: ValueAggregation | description: Value aggregation configuration. - ONE-OF: - name: includeOptions | type: IncludeMissingValuesOptions | description: Options for including missing values in the aggregation results. - name: addToBucket | type: string | description: Custom bucket name for missing values. Default values: - string: `N/A` - int: `0` - bool: `false` - name: sortType | type: SortType | description: Whether to sort by number of matches or value of the field. - enum: - COUNT: Number of matches in the results. - VALUE: Alphabetically by the field value. - name: sortDirection | type: SortDirection | description: Whether to sort in ascending or descending order. - enum: - DESC: Descending order. - ASC: Ascending order. - name: limit | type: integer | description: Number of aggregations to return. Min: `1` Max: `250` Default: `10` - name: missingValues | type: MissingValues | description: Whether missing values should be included or excluded from the aggregation results. Default: `EXCLUDE` - enum: - EXCLUDE: Exclude missing values from the aggregation results. - INCLUDE: Include missing values in the aggregation results. - name: range | type: RangeAggregation | description: Range aggregation configuration. - name: buckets | type: array | description: List of range buckets defining the ranges for aggregation. During aggregation, each entity is placed in the first bucket where its value falls within the specified range bounds. - name: from | type: number | description: Inclusive lower bound of the range. Required if `to` isn't specified. - name: to | type: number | description: Exclusive upper bound of the range. Required if `from` isn't specified. - name: scalar | type: ScalarAggregation | description: Scalar aggregation configuration. - name: type | type: ScalarType | description: Operator for the scalar aggregation, for example `COUNT_DISTINCT`, `MIN`, `MAX`. - enum: - COUNT_DISTINCT: Total number of distinct values. - MIN: Minimum value. - MAX: Maximum value. - name: dateHistogram | type: DateHistogramAggregation | description: Date histogram aggregation configuration. - name: interval | type: Interval | description: Time interval for date histogram aggregation, for example `DAY`, `HOUR`, `MONTH`. - enum: - YEAR: Yearly interval - MONTH: Monthly interval - WEEK: Weekly interval - DAY: Daily interval - HOUR: Hourly interval - MINUTE: Minute interval - SECOND: Second interval - name: nested | type: NestedAggregation | description: Nested aggregation configuration. - name: nestedAggregations | type: array | description: Flattened list of aggregations where each next aggregation is nested within the previous 1. - ONE-OF: - name: value | type: ValueAggregation | description: Value aggregation configuration. Calculates the distribution of field values within the dataset. - name: range | type: RangeAggregation | description: Range aggregation configuration. Calculates counts within user-defined value ranges. - name: scalar | type: ScalarAggregation | description: Scalar aggregation configuration. Calculates single numerical metrics like count, min, max, sum, or average. - name: dateHistogram | type: DateHistogramAggregation | description: Date histogram aggregation configuration. Calculates counts within time intervals. - name: name | type: string | description: User-defined name of aggregation. Must be unique and will appear in aggregation results. - name: type | type: NestedAggregationType | description: Type of aggregation. Client must specify matching aggregation field below. - enum: - VALUE: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values. - RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. - SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into 1 key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`. - DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.). - name: fieldPath | type: string | description: Path to the field to aggregate by in dot notation. For example `name` or `locationOptions.businessLocations.locationId`. - name: name | type: string | description: Aggregation name, returned in `aggregations.results.name`. - name: type | type: AggregationType | description: Type of aggregation. Client must specify matching aggregation field below. - enum: - VALUE: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values. - RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. - SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into 1 key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`. - DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.). - NESTED: Flattened list of aggregations, where each aggregation is nested within previous 1. - name: fieldPath | type: string | description: Field to aggregate by. Use dot notation to specify a JSON path. For example `name` or `locationOptions.businessLocations.locationId`. - name: search | type: SearchDetails | description: Free text to match in searchable fields. - name: mode | type: Mode | description: Search mode. Defines the search logic for combining multiple terms in the `expression`. - enum: - OR: At least 1 of the search terms must be present. - AND: All search terms must be present. - name: expression | type: string | description: Search term or expression. - name: fields | type: array | description: Fields to search in. If the array is empty, all searchable fields are searched. Use dot notation to specify a JSON path. For example, `locationOptions.availableInAllLocations`. - name: fuzzy | type: boolean | description: Whether to enable the search function to use an algorithm to automatically find results that are close to the search expression, such as typos and declensions. - name: timeZone | type: string | description: Time zone in [IANA tz database format](https://en.wikipedia.org/wiki/Tz_database) or [ISO 8601 UTC offset format](https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC) for adjusting time fields in the specified filters and returned aggregation data. For example, `America/New_York`, `UTC`, or `+02:00`. Default: Time zone specified in the business [site properties](https://dev.wix.com/docs/rest/business-management/site-properties/properties/get-site-properties.md). Return type: SearchResourcesResponse - name: resources | type: array | description: Retrieved resources that match the search criteria specified in the request. Each resource includes all available information such as name, type, management details, location options, working hour schedules, and availability configurations. - 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: pagingMetadata | type: CursorPagingMetadata | description: Cursor-based paging metadata for navigating through search results. Contains navigation information including the current page cursor, whether additional results are available, and result counts. Use the `next` cursor to fetch subsequent pages. - name: count | type: integer | description: Number of items returned in the current response page. This count reflects the actual number of items in the current result set, which may be less than the requested limit if fewer items are available. - name: cursors | type: Cursors | description: Navigation cursors for moving between result pages. Contains `next` and `prev` cursor tokens for pagination. Use the `next` cursor to retrieve subsequent pages and `prev` cursor to go back to previous pages. Learn more about cursor paging in the [API Query Language guide](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_cursor-paging). - name: next | type: string | description: Cursor token for retrieving the next page of results. Use this token in subsequent requests to continue pagination forward. Value is `null` when on the last page of results. - name: prev | type: string | description: Cursor token for retrieving the previous page of results. Use this token to navigate backwards through result pages. Value is `null` when on the first page of results. - name: hasNext | type: boolean | description: Indicates whether additional results are available beyond the current page. - `true`: More results exist and can be retrieved using the `next` cursor. - `false`: This is the final page of results. - name: aggregationData | type: AggregationData | description: Aggregation results derived from the aggregations specified in the search request. Provides analytical summaries such as resource counts by type, location distribution, management type statistics, or custom groupings. Only populated when aggregations are included in the search criteria. - name: results | type: array | description: Array of aggregation results, each containing the aggregation metadata and its calculated values for the specified search criteria. - ONE-OF: - name: values | type: ValueResults | description: Value aggregation results. - name: results | type: array | description: Array of value aggregation results, each containing a field value and the count of entities with that value. - name: value | type: string | description: Value of the field. - name: count | type: integer | description: Count of entities with this value. - name: ranges | type: RangeResults | description: Range aggregation results. - name: results | type: array | description: Array of range aggregation results returned in the same order as requested, each containing range bounds and count of entities within that range. - name: from | type: number | description: Inclusive lower bound of the range. - name: to | type: number | description: Exclusive upper bound of the range. - name: count | type: integer | description: Count of entities in this range. - name: scalar | type: ScalarResult | description: Scalar aggregation results. - name: type | type: ScalarType | description: Type of scalar aggregation. - enum: - COUNT_DISTINCT: Total number of distinct values. - MIN: Minimum value. - MAX: Maximum value. - name: value | type: number | description: Value of the scalar aggregation. - name: groupedByValue | type: GroupByValueResults | description: Group by value aggregation results. - name: results | type: array | description: Array of nested value aggregation results, each containing a field value and the associated nested aggregation data. - name: value | type: string | description: Value of the field. - name: nestedResults | type: NestedAggregationResults | description: Nested aggregations result data. - ONE-OF: - name: values | type: ValueResults | description: Value aggregation results. - name: ranges | type: RangeResults | description: Range aggregation results. - name: scalar | type: ScalarResult | description: Scalar aggregation results. - name: name | type: string | description: User-defined name of aggregation, matches the one specified in request. - name: type | type: AggregationType | description: Type of aggregation that matches result. - enum: - VALUE: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values. - RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. - SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into 1 key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`. - DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.). - NESTED: Flattened list of aggregations, where each aggregation is nested within previous 1. - name: fieldPath | type: string | description: Path to the field to aggregate by in dot notation. For example `name` or `locationOptions.businessLocations.locationId`. - name: dateHistogram | type: DateHistogramResults | description: Date histogram aggregation results. - name: results | type: array | description: Array of date histogram aggregation results, each containing a date bucket and its count. - name: value | type: string | description: Date in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601). - name: count | type: integer | description: Count of documents in the bucket. - name: nested | type: NestedResults | description: Nested aggregation results. - name: results | type: array | description: Array of nested aggregation result groups, each containing multiple aggregation results. - name: results | type: Map | description: Map of nested aggregation results, keyed by aggregation name. - ONE-OF: - name: value | type: ValueResult | description: Value aggregation result. - name: value | type: string | description: Value of the field. - name: count | type: integer | description: Count of entities with this value. - name: range | type: RangeResult | description: Range aggregation result. - name: from | type: number | description: Inclusive lower bound of the range. - name: to | type: number | description: Exclusive upper bound of the range. - name: count | type: integer | description: Count of entities in this range. - name: scalar | type: ScalarResult | description: Scalar aggregation result. - name: value | type: number | description: Value of the scalar aggregation. - name: dateHistogram | type: ValueResult | description: Date histogram aggregation result. - name: name | type: string | description: User-defined name of aggregation as derived from search request. - name: type | type: AggregationType | description: Type of aggregation that must match specified kind as derived from search request. - name: fieldPath | type: string | description: Path to the field to aggregate by in dot notation. For example `name` or `locationOptions.businessLocations.locationId`. ``` ### Examples ### Search resources. Search resources, retrieving the ones that match the provided search term. ```curl curl -v -X POST \ 'https://www.wixapis.com/bookings/v2/resources/search' \ -H 'Authorization: ' \ -d '{ "search": { "search": { "fields": [ "name" ], "expression": "conference" } } }' ``` ### Search resources. Search resources, filtering by resource type and then calculating the number of resources by business location. ```curl curl -v -X POST \ 'https://www.wixapis.com/bookings/v2/resources/search' \ -H 'Authorization: ' \ -d '{ "search": { "aggregations": [ { "name": "Resource count by business location", "type": "NESTED", "nested": { "nestedAggregations": [ { "name": "resourceType", "type": "VALUE", "fieldPath": "type", "value": {} }, { "name": "locationId", "type": "VALUE", "fieldPath": "locationOptions.specificLocationOptions.businessLocations.locationId", "value": {} } ] } } ], "filter": { "type": { "$eq": "dd7790c7-f3ac-4821-accb-52ed385fd932" } }, "cursorPaging": { "limit": 0 } } }' ``` ### Search resources. Search resources, filtering by resource type and sorting by name. ```curl curl -v -X POST \ 'https://www.wixapis.com/bookings/v2/resources/search' \ -H 'Authorization: ' \ -d '{ "search": { "sort": [ { "field_name": "name" } ], "filter": { "type": { "$eq": "dd7790c7-f3ac-4821-accb-52ed385fd932" } } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.resources.ResourcesService.searchResources(search) Description: Retrieves a list of resources matching the provided search criteria. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: search Method parameters: param name: search | type: CursorSearch | required: true - name: cursorPaging | type: CursorPaging | description: Cursor-based paging for result navigation. When requesting `cursor_paging.cursor`, `filter`, `sort`, or `search` can't be specified. - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object for narrowing search results. For example, to return only resources available at specific business locations: `"filter": {"single_resource.location_options.specific_location_options.business_locations.location_id": {"$in": ["location-id-1", "location-id-2"]}}`. Learn more about the filter format in the [supported filters article](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting.md). - name: sort | type: array | description: Array of sort objects specifying result order. For example, to sort by resource name in ascending order: `"sort": [{"fieldName": "name", "order": "ASC"}]`. Learn more about the sort format in the [supported filters article](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting.md). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC - name: aggregations | type: array | description: Aggregations for grouping data into categories (facets) and providing summaries for each category. For example, use aggregations to categorize search results by resource type, management type, or location availability. - ONE-OF: - name: value | type: ValueAggregation | description: Value aggregation configuration. - ONE-OF: - name: includeOptions | type: IncludeMissingValuesOptions | description: Options for including missing values in the aggregation results. - name: addToBucket | type: string | description: Custom bucket name for missing values. Default values: - string: `N/A` - int: `0` - bool: `false` - name: sortType | type: SortType | description: Whether to sort by number of matches or value of the field. - enum: - COUNT: Number of matches in the results. - VALUE: Alphabetically by the field value. - name: sortDirection | type: SortDirection | description: Whether to sort in ascending or descending order. - enum: - DESC: Descending order. - ASC: Ascending order. - name: limit | type: integer | description: Number of aggregations to return. Min: `1` Max: `250` Default: `10` - name: missingValues | type: MissingValues | description: Whether missing values should be included or excluded from the aggregation results. Default: `EXCLUDE` - enum: - EXCLUDE: Exclude missing values from the aggregation results. - INCLUDE: Include missing values in the aggregation results. - name: range | type: RangeAggregation | description: Range aggregation configuration. - name: buckets | type: array | description: List of range buckets defining the ranges for aggregation. During aggregation, each entity is placed in the first bucket where its value falls within the specified range bounds. - name: from | type: number | description: Inclusive lower bound of the range. Required if `to` isn't specified. - name: to | type: number | description: Exclusive upper bound of the range. Required if `from` isn't specified. - name: scalar | type: ScalarAggregation | description: Scalar aggregation configuration. - name: type | type: ScalarType | description: Operator for the scalar aggregation, for example `COUNT_DISTINCT`, `MIN`, `MAX`. - enum: - COUNT_DISTINCT: Total number of distinct values. - MIN: Minimum value. - MAX: Maximum value. - name: dateHistogram | type: DateHistogramAggregation | description: Date histogram aggregation configuration. - name: interval | type: Interval | description: Time interval for date histogram aggregation, for example `DAY`, `HOUR`, `MONTH`. - enum: - YEAR: Yearly interval - MONTH: Monthly interval - WEEK: Weekly interval - DAY: Daily interval - HOUR: Hourly interval - MINUTE: Minute interval - SECOND: Second interval - name: nested | type: NestedAggregation | description: Nested aggregation configuration. - name: nestedAggregations | type: array | description: Flattened list of aggregations where each next aggregation is nested within the previous 1. - ONE-OF: - name: value | type: ValueAggregation | description: Value aggregation configuration. Calculates the distribution of field values within the dataset. - name: range | type: RangeAggregation | description: Range aggregation configuration. Calculates counts within user-defined value ranges. - name: scalar | type: ScalarAggregation | description: Scalar aggregation configuration. Calculates single numerical metrics like count, min, max, sum, or average. - name: dateHistogram | type: DateHistogramAggregation | description: Date histogram aggregation configuration. Calculates counts within time intervals. - name: name | type: string | description: User-defined name of aggregation. Must be unique and will appear in aggregation results. - name: type | type: NestedAggregationType | description: Type of aggregation. Client must specify matching aggregation field below. - enum: - VALUE: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values. - RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. - SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into 1 key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`. - DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.). - name: fieldPath | type: string | description: Path to the field to aggregate by in dot notation. For example `name` or `locationOptions.businessLocations.locationId`. - name: name | type: string | description: Aggregation name, returned in `aggregations.results.name`. - name: type | type: AggregationType | description: Type of aggregation. Client must specify matching aggregation field below. - enum: - VALUE: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values. - RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. - SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into 1 key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`. - DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.). - NESTED: Flattened list of aggregations, where each aggregation is nested within previous 1. - name: fieldPath | type: string | description: Field to aggregate by. Use dot notation to specify a JSON path. For example `name` or `locationOptions.businessLocations.locationId`. - name: search | type: SearchDetails | description: Free text to match in searchable fields. - name: mode | type: Mode | description: Search mode. Defines the search logic for combining multiple terms in the `expression`. - enum: - OR: At least 1 of the search terms must be present. - AND: All search terms must be present. - name: expression | type: string | description: Search term or expression. - name: fields | type: array | description: Fields to search in. If the array is empty, all searchable fields are searched. Use dot notation to specify a JSON path. For example, `locationOptions.availableInAllLocations`. - name: fuzzy | type: boolean | description: Whether to enable the search function to use an algorithm to automatically find results that are close to the search expression, such as typos and declensions. - name: timeZone | type: string | description: Time zone in [IANA tz database format](https://en.wikipedia.org/wiki/Tz_database) or [ISO 8601 UTC offset format](https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC) for adjusting time fields in the specified filters and returned aggregation data. For example, `America/New_York`, `UTC`, or `+02:00`. Default: Time zone specified in the business [site properties](https://dev.wix.com/docs/rest/business-management/site-properties/properties/get-site-properties.md). Return type: PROMISE - name: resources | type: array | description: Retrieved resources that match the search criteria specified in the request. Each resource includes all available information such as name, type, management details, location options, working hour schedules, and availability configurations. - 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: pagingMetadata | type: CursorPagingMetadata | description: Cursor-based paging metadata for navigating through search results. Contains navigation information including the current page cursor, whether additional results are available, and result counts. Use the `next` cursor to fetch subsequent pages. - name: count | type: integer | description: Number of items returned in the current response page. This count reflects the actual number of items in the current result set, which may be less than the requested limit if fewer items are available. - name: cursors | type: Cursors | description: Navigation cursors for moving between result pages. Contains `next` and `prev` cursor tokens for pagination. Use the `next` cursor to retrieve subsequent pages and `prev` cursor to go back to previous pages. Learn more about cursor paging in the [API Query Language guide](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_cursor-paging). - name: next | type: string | description: Cursor token for retrieving the next page of results. Use this token in subsequent requests to continue pagination forward. Value is `null` when on the last page of results. - name: prev | type: string | description: Cursor token for retrieving the previous page of results. Use this token to navigate backwards through result pages. Value is `null` when on the first page of results. - name: hasNext | type: boolean | description: Indicates whether additional results are available beyond the current page. - `true`: More results exist and can be retrieved using the `next` cursor. - `false`: This is the final page of results. - name: aggregationData | type: AggregationData | description: Aggregation results derived from the aggregations specified in the search request. Provides analytical summaries such as resource counts by type, location distribution, management type statistics, or custom groupings. Only populated when aggregations are included in the search criteria. - name: results | type: array | description: Array of aggregation results, each containing the aggregation metadata and its calculated values for the specified search criteria. - ONE-OF: - name: values | type: ValueResults | description: Value aggregation results. - name: results | type: array | description: Array of value aggregation results, each containing a field value and the count of entities with that value. - name: value | type: string | description: Value of the field. - name: count | type: integer | description: Count of entities with this value. - name: ranges | type: RangeResults | description: Range aggregation results. - name: results | type: array | description: Array of range aggregation results returned in the same order as requested, each containing range bounds and count of entities within that range. - name: from | type: number | description: Inclusive lower bound of the range. - name: to | type: number | description: Exclusive upper bound of the range. - name: count | type: integer | description: Count of entities in this range. - name: scalar | type: ScalarResult | description: Scalar aggregation results. - name: type | type: ScalarType | description: Type of scalar aggregation. - enum: - COUNT_DISTINCT: Total number of distinct values. - MIN: Minimum value. - MAX: Maximum value. - name: value | type: number | description: Value of the scalar aggregation. - name: groupedByValue | type: GroupByValueResults | description: Group by value aggregation results. - name: results | type: array | description: Array of nested value aggregation results, each containing a field value and the associated nested aggregation data. - name: value | type: string | description: Value of the field. - name: nestedResults | type: NestedAggregationResults | description: Nested aggregations result data. - ONE-OF: - name: values | type: ValueResults | description: Value aggregation results. - name: ranges | type: RangeResults | description: Range aggregation results. - name: scalar | type: ScalarResult | description: Scalar aggregation results. - name: name | type: string | description: User-defined name of aggregation, matches the one specified in request. - name: type | type: AggregationType | description: Type of aggregation that matches result. - enum: - VALUE: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values. - RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. - SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into 1 key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`. - DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.). - NESTED: Flattened list of aggregations, where each aggregation is nested within previous 1. - name: fieldPath | type: string | description: Path to the field to aggregate by in dot notation. For example `name` or `locationOptions.businessLocations.locationId`. - name: dateHistogram | type: DateHistogramResults | description: Date histogram aggregation results. - name: results | type: array | description: Array of date histogram aggregation results, each containing a date bucket and its count. - name: value | type: string | description: Date in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601). - name: count | type: integer | description: Count of documents in the bucket. - name: nested | type: NestedResults | description: Nested aggregation results. - name: results | type: array | description: Array of nested aggregation result groups, each containing multiple aggregation results. - name: results | type: Map | description: Map of nested aggregation results, keyed by aggregation name. - ONE-OF: - name: value | type: ValueResult | description: Value aggregation result. - name: value | type: string | description: Value of the field. - name: count | type: integer | description: Count of entities with this value. - name: range | type: RangeResult | description: Range aggregation result. - name: from | type: number | description: Inclusive lower bound of the range. - name: to | type: number | description: Exclusive upper bound of the range. - name: count | type: integer | description: Count of entities in this range. - name: scalar | type: ScalarResult | description: Scalar aggregation result. - name: value | type: number | description: Value of the scalar aggregation. - name: dateHistogram | type: ValueResult | description: Date histogram aggregation result. - name: name | type: string | description: User-defined name of aggregation as derived from search request. - name: type | type: AggregationType | description: Type of aggregation that must match specified kind as derived from search request. - name: fieldPath | type: string | description: Path to the field to aggregate by in dot notation. For example `name` or `locationOptions.businessLocations.locationId`. ``` ### Examples ### searchResources ```javascript import { resources } from '@wix/bookings'; async function searchResources(search) { const response = await resources.searchResources(search); }; ``` ### searchResources (with elevated permissions) ```javascript import { resources } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function mySearchResourcesMethod(search) { const elevatedSearchResources = auth.elevate(resources.searchResources); const response = await elevatedSearchResources(search); } ``` ### searchResources (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 searchResources(search) { const response = await myWixClient.resources.searchResources(search); }; ``` ---