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. Must be application/json.Yes
X-CleverTap-Account-IdCleverTap account ID associated with the catalog.Yes
X-CleverTap-PasscodeAPI passcode 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. One of string, number, boolean, date, datetime, array, object. Case-insensitive.
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.
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.syncFrequencystringNoSets how often the catalog syncs with the source. Accepted values are HOURLY, DAILY, WEEKLY, MONTHLY, CUSTOM, and NONE. NONE runs a single one-time import: CleverTap queues one upload job and leaves the sync disabled. |
recurringSyncConfig.integrationTypestringNoSets how data is imported. Accepted values are GOOGLE_MERCHANT, FILE_BASED_UPLOAD, CLOUD_BUCKET, and EXTERNAL_SOURCE_PULL.
recurringSyncConfig.sourceUrlstringNoURL of the external file or data source used for syncing.
recurringSyncConfig.fileFormatstringNoFormat of the source file. For example, CSV or JSON.
📘

Catalog Schema Constraints

  • A catalog can include 0 to 197 custom attributes in catalogSchema.
  • The total number of columns, 3 fixed fields plus all custom attributes, must not exceed 200.
  • The built-in fields identity, name, and imageUrl are always present and must not appear inside catalogSchema.
  • identity, name, image_url, and imageurl are reserved. Using any of them as a custom attribute name returns 400 with Attribute name 'X' is reserved and cannot be used.
  • Attribute names must be unique within the catalog. Comparison is case-insensitive, so Brand and brand collide and return 400 with Duplicate attribute name 'X' found in schema.

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,
  "updatedAt": 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.
updatedAtintegerWhen the catalog was last updated, in Unix epoch seconds.
recurringSyncConfigobject
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 (-), spaces, or parentheses ()
  • 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:

HTTP StatusDescription
400Validation failure, invalid JSON, or an empty body. The message names the failing field, for example, Validation failed: catalogName: Catalog name must be 1-255 characters. CleverTap codes 106 (invalid JSON) and 108 (invalid payload) may accompany this.
401Authentication failed, or the catalogs feature is not enabled on the account's plan.
403Catalog feature is not enabled for this account (CleverTap code 101).
409A non-deleted catalog with this catalogName already exists: 'X'. A name belonging to a deleted catalog is free to reuse.
413Request payload exceeds 100 KB (CleverTap code 105).
500Unexpected server-side error.
503The account is not ready to serve requests yet. Retry shortly.

Did this page help you?
CleverTap Ask AI Widget (CSP-Safe)