For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
      • Overview
        • Abandoned Carts
        • Carts
        • Channels
        • Checkouts
        • Currencies
        • Customer Segmentation
        • Geography
        • Infrastructure Hosting
        • Inventory
        • Orders
        • Order Operations
        • Pickup
        • Pickup Methods
        • Pickup Options
        • Pricing
        • Price Lists
        • Promotions
        • Promotion Settings
        • Redirects
        • Scripts
        • Settings
              • GETList Enabled Filters
              • PUTUpdate Enabled Filters
              • GETList Available Filters
              • GETList Contextual Filters
              • PUTUpsert Contextual Filters
        • Shipping
        • Sites
        • Subscribers
        • System Logs
        • Tax
        • Wishlists
      • Payments
  • GraphQL
    • Overview
  • MCP
    • Overview
Dev Portal
LogoLogo
RESTAdminManagementSettingsSearch Filters

Upsert Contextual Filters

PUT
https://api.bigcommerce.com/stores/:store_hash/v3/settings/search/filters/contexts
PUT
/stores/:store_hash/v3/settings/search/filters/contexts
$curl -X PUT https://api.bigcommerce.com/stores/store_hash/v3/settings/search/filters/contexts \
> -H "Accept: application/json" \
> -H "X-Auth-Token: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '[
> {},
> {}
>]'
200Updated
1{
2 "data": [
3 {
4 "context": {
5 "category_id": 12,
6 "channel_id": 3
7 },
8 "data": [
9 {
10 "collapsed_by_default": false,
11 "display_name": "Color Options",
12 "display_product_count": true,
13 "id": "filter_color_options",
14 "is_enabled": true,
15 "items_to_show": 10,
16 "sort_by": "option_values",
17 "type": "product"
18 },
19 {
20 "collapsed_by_default": true,
21 "display_name": "Price Range",
22 "display_product_count": false,
23 "id": "filter_price_range",
24 "is_enabled": true,
25 "items_to_show": 5,
26 "sort_by": "alpha",
27 "type": "price"
28 },
29 {
30 "collapsed_by_default": false,
31 "display_name": "Brands",
32 "display_product_count": true,
33 "id": "filter_brands",
34 "is_enabled": true,
35 "items_to_show": 15,
36 "sort_by": "item_count",
37 "type": "brand"
38 }
39 ]
40 }
41 ],
42 "meta": {}
43}

Upserts contextual filters for a particular channel or category.

Usage Notes

Contextual filters allow you to configure the enabled filters per channel or category, so that shoppers can filter by the most relevant criteria.

You can change the order of the filters on the live site by changing the order of the filters you send.

Was this page helpful?
Previous

List Contextual Filters

Next

Get Locale Settings

Built with

Authentication

X-Auth-Tokenstring
### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Information & Settings | modify | `store_v2_information` | | Information & Settings | read-only | `store_v2_information_read_only` | NOTE: Analytics endpoints require the Content (`store_v2_content` and `store_v2_content_read_only`) OAuth scope. ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

Path parameters

store_hashstringRequired
Permanent ID of the BigCommerce store.

Headers

AcceptstringRequiredDefaults to application/json

The MIME type of the response body.

Request

This endpoint expects a list of objects.
contextobjectOptional
datalist of objectsOptional

Response

OK
datalist of objects
metaobject
Response metadata.

OAuth scopes

UI NamePermissionParameter
Information & Settingsmodifystore_v2_information
Information & Settingsread-onlystore_v2_information_read_only

NOTE: Analytics endpoints require the Content (store_v2_content and store_v2_content_read_only) OAuth scope.

Authentication header

HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see our Guide to API Accounts.

Further reading

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see our Guide to API Accounts.

For a list of API status codes, see API Status Codes.