Mark Attribute as Filterable API

Overview

Marks a specific catalog attribute as filterable or non-filterable.

Method

PATCH

Endpoint

PATCH /v2/catalogs/{catalogId}/schema/attributes/{attributeName}/filterable

Base URL

https://in1.api.clevertap.com/v2/catalogs/{catalogId}/schema/attributes/{attributeName}/filterable

Region

Refer Region for more details.

Headers

These headers must be included with every API request to ensure authentication and correct request handling.

HeaderDescriptionRequired
Content-TypeContent type of the request payload. Must be application/json.Yes
X-Account-IdCleverTap account ID associated with the catalog.Yes
X-CleverTap-TokenAPI token used to authenticate the request.Yes

Path Parameters

The following path parameters are required to identify the catalog attribute to update:

ParameterTypeRequiredDescription
catalogIdlongYesUnique identifier of the catalog.
attributeNamestringYesName of the attribute that needs to be updated.

Query Parameters

The following query parameters are required to update the attribute's filterable status:

ParameterTypeRequiredDescription
filterablebooleanYesSets whether the attribute can be used in filters. Accepted values are true or false.
updatedBystringYesEmail address of the user performing the update.

Example Request

The following is the sample request:

PATCH /v2/catalogs/123/schema/attributes/brand/filterable?filterable=true&[email protected]

Example Response

This example response indicates the catalog file has been accepted, and processing has started asynchronously.

{
  "id": 123,
  "catalogName": "electronics_catalog",
  "catalogSchema": [
    {
      "name": "brand",
      "type": "string",
      "filterable": true
    },
    {
      "name": "price",
      "type": "number",
      "filterable": true
    }
  ],
  "totalProducts": 1500,
  "status": "ACTIVE",
  "createdAt": 1699564800,
  "createdBy": "[email protected]",
  "updatedBy": "[email protected]",
  "isActive": true,
  "attributeCount": 2,
  "totalColumns": 5
}

Response Parameters

The response includes additional system-generated fields returned after the attribute is updated.

ParameterTypeDescription
idintegerUnique identifier of the catalog.
totalProductsintegerTotal number of products currently available in the catalog.
createdAtintegerTime when the catalog was created. The value is returned as a Unix timestamp.
createdBystringEmail address of the user who created the catalog.
isActivebooleanIndicates whether the catalog is currently active.
attributeCountintegerTotal number of attributes currently defined in the catalog.
totalColumnsintegerTotal number of columns available in the catalog, including system-defined fields.

Error Codes

The following error codes may be returned by this API:

Error CodeDescription
INVALID_REQUESTThe request is invalid or missing required parameters. For example, catalogId, attributeName, filterable, or updatedBy is missing or has an invalid value.
NOT_FOUNDThe specified catalog or attribute does not exist.
UPDATE_NOT_ALLOWEDThe attribute cannot be updated due to a business rule. For example, the catalog is inactive or locked.
UNAUTHORIZEDThe user is not authorized to perform this update.
FORBIDDENThe user does not have permission to modify this catalog.
INTERNAL_ERRORAn unexpected error occurred on the server. Try again later.

CleverTap Ask AI Widget (CSP-Safe)