customer_resources_filters parameter to control which resources (property listings, reservations) are visible to the customer. Filters match against the custom_metadata you set on resources in customer_data.
How It Works
- Tag resources with
custom_metadata— when passingproperty_listingsorreservationsincustomer_data, include acustom_metadataobject with key-value pairs on each resource. - Set
customer_resources_filterswhen creating the portal — provide an array of filter objects that specify whichcustom_metadatavalues a resource must have to be visible. - Filtering is enforced server-side — the customer portal only returns resources whose
custom_metadatamatches all specified filters.
Filter Structure Reference
Each filter in thecustomer_resources_filters array is an object with the following fields:
| Field | Type | Description |
|---|---|---|
field | String | The custom_metadata field name to filter on. Must start with a letter or underscore and contain only alphanumeric characters and underscores. |
operation | String | The comparison operation. Currently only "=" (equals) is supported. |
value | String or Boolean | The value to compare against. |
Key Behaviors
- AND logic — when multiple filters are provided, a resource must match all of them to be visible.
- Exact match — the
=operation performs an exact match against thecustom_metadatavalue. - Server-side enforcement — filtering happens on the server. The customer portal API only returns matching resources.
- Field name rules — field names must match the regex
^[a-zA-Z_]\w*$(start with a letter or underscore, followed by alphanumeric characters or underscores).
Examples
Example 1: Filtering Property Listings by Region
Create property listings with aregion field in custom_metadata, then filter to show only European properties.
- JavaScript
- cURL
Example 2: Multiple Filters (AND Logic)
When you provide multiple filters, a resource must match all of them. Here, only property listings that are both premium and in Europe are shown.- JavaScript
- cURL
Example 3: Boolean Filters
Filter by a booleancustom_metadata value, such as showing only premium listings.
- JavaScript
- cURL
Example 4: Filtering Reservations
Filters also apply to reservations. Here, only reservations that are both premium and in Europe are shown.- JavaScript
- cURL
Verifying Filters
After creating a portal, you can verify the configured filters by retrieving the portal via the customer API. The response includescustomer_resources_filters in the portal configuration.

