Create Catalog API

Overview

Creates a new catalog in CleverTap to store product data. You can optionally define a custom schema and configure automatic ingestion from external feeds such as Google Merchant XML.

Method

POST

Endpoint

POST /v2/catalogs

Base URL

https://in1.api.clevertap.com/v2/catalogs

Region

Refer Region for more details.

Headers

The following headers must be included with every API request to ensure proper authentication and content 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

Request Parameters

The following table lists and describes the fields accepted by this API:

ParameterTypeRequiredDescription
catalogNamestringYesUnique name of the catalog. This name is used to identify the catalog in future operations.
catalogSchemaarrayYesList of fields that define the structure of items in the catalog. Each entry represents one field in the catalog.
catalogSchema.namestringYesName of the catalog field. This is how the attribute will be stored and referenced.
catalogSchema.typestringYesData type of the field. Supported values include string, number, and boolean.
catalogSchema.filterablebooleanNoIndicates whether this field can be used in filters when querying the catalog. Default is false if not specified.
fieldMappingsobjectNoMaps incoming source fields to catalog fields. Useful when the data source uses field names different from those in the catalog schema.
fieldMappings.sourceFieldstringNoName of the source field.
fieldMappings.catalogFieldstringNoName of the catalog field that the source field should map to.
descriptionstringNoShort description of the catalog and its purpose.
createdBystringYesEmail address of the user creating the catalog. Used for ownership and audit purposes.
recurringSyncConfigobjectNoConfiguration for automatically syncing catalog data from an external source.
recurringSyncConfig.syncFrequencystringNoFrequency of the catalog sync with the source. For example, DAILY, WEEKLY, or MONTHLY.
recurringSyncConfig.integrationTypestringNoMethod used to import data into the catalog. For example, FILE_BASED_UPLOAD.
recurringSyncConfig.sourceUrlstringNoURL of the external file or data source used for syncing.
recurringSyncConfig.fileFormatstringNoFormat of the source file. For example, CSV or JSON.

Example Request

The following is the sample request body for creating a catalog with custom attributes and a recurring sync configuration:

{
  "catalogName": "electronics_catalog",
  "catalogSchema": [
    {
      "name": "brand",
      "type": "string",
      "filterable": true
    },
    {
      "name": "price",
      "type": "number",
      "filterable": true
    },
    {
      "name": "category",
      "type": "string",
      "filterable": true
    },
    {
      "name": "in_stock",
      "type": "boolean"
    }
  ],
  "fieldMappings": {
    "manufacturer": "brand",
    "cost": "price"
  },
  "description": "Product catalog for electronics store",
  "createdBy": "[email protected]",
  "recurringSyncConfig": {
    "syncFrequency": "DAILY",
    "integrationType": "FILE_BASED_UPLOAD",
    "sourceUrl": "https://example.com/products/feed.csv",
    "fileFormat": "CSV"
  }
}
📘

Note The built-in fields identity, name, and imageUrl are always included and do not appear inside catalogSchema.

Example Response

The following is an example of a successful response when a new catalog is created.

{
  "id": 123,
  "catalogName": "electronics_catalog",
  "catalogSchema": [
    {
      "name": "brand",
      "type": "string",
      "filterable": true
    },
    {
      "name": "price",
      "type": "number",
      "filterable": true
    },
    {
      "name": "category",
      "type": "string",
      "filterable": true
    },
    {
      "name": "in_stock",
      "type": "boolean",
      "filterable": false
    }
  ],
  "fieldMappings": {
    "manufacturer": "brand",
    "cost": "price"
  },
  "description": "Product catalog for electronics store",
  "totalProducts": 0,
  "status": "ACTIVE",
  "createdAt": 1699564800,
  "createdBy": "[email protected]",
  "updatedBy": "[email protected]",
  "isActive": true, 
  "attributeCount": 4,
  "totalColumns": 7
}

Response Parameters

The response includes all request parameters along with the following additional response parameters:

ParameterTypeDescription
idintegerUnique identifier of the catalog.
totalProductsintegerTotal number of products currently available in the catalog.
statusstringCurrent status of the catalog, for example, ACTIVE or INACTIVE.
createdAtintegerTime when the catalog was created, in Unix timestamp format.
updatedBystringEmail address of the user who last updated the catalog.
isActivebooleanIndicates whether the catalog is currently active.
attributeCountintegerTotal number of attributes defined in the catalog schema.
totalColumnsintegerTotal number of columns available in the catalog, including system-defined fields.

Catalog Schema Constraints

A catalog can include 0 to 197 custom attributes defined in the catalogSchema.

Attribute names must:

  • Start with a letter or underscore (_)
  • Contain only alphanumeric characters, underscores (_), dashes (-), or spaces
  • The total number of columns, including 3 fixed attributes and all custom attributes, must not exceed 200.

Errors

The following table lists the possible errors that this API may return:

Error MessageDescription
CATALOG_INVALID_REQUESTThe request body is invalid or missing required fields.
CATALOG_NAME_CONFLICTA catalog with the given catalogName already exists.
AUTHENTICATION_FAILEDThe authentication token is missing or invalid.
AUTHORIZATION_FAILEDThe caller does not have permission to create catalogs.
INTERNAL_ERRORAn unexpected server-side error occurred.

CleverTap Ask AI Widget (CSP-Safe)