Create search criteria

This API allows you to create a search criteria.

👍

Notes

  • Make sure that you have appropriate access control configured. For more information, see access group documentation.
  • The maximum number of PREFIX criteria you can create for a Customer entity per organization is two.
  • The maximum number of COMBINATION crtieria for an entiry per organization is five.

API endpoint:

{host}/api_gateway/cortex/v1/criteria

Request body parameters

Parameter Name (Parameters marked as * are required)TypeDescription
name*StringName of the search entity.
entityType*enumType of entity being searched ( TRANSACTION, CUSTOMER).
searchStrategyTypeStringDefines the search strategy type (COMBINATION, PREFIX).
fieldDefinitionsArrayList of field definitions used in the search.
fieldDefinitions[].fieldId*StringThe field to search on. For Customer, the supported standard fields are: firstName, lastName, email, mobile, cardnumber, externalId, and fullName.
For Transaction, the supported fields are: outlierStatus, billDate, billNumber, and storecode (additional field).
fieldDefinitions[].fieldAliasStringThe alias or display name of the field
fieldDefinitions[].fieldType*enumType of field (INDEXED, FILTERABLE).

If a field is INDEXED, the field need to be defined to get the results.
If the field is defined as FILTERABLE, then those are considered optional while searching.
For example, if fields A and B both are Indexed, then both A and B need to be passed.
If A is indexed and B is filterable then A alone will give results and A+B will give another set of results.

The maximum number of allowed filterable fields is five and the maximum number of indexable fields is six.
fieldDefinitions[].dataSourceDetails.fieldReference*StringApplicable when using custom fields or extended fields to search. Ex: extendedFields.ship_email, customFields.age. If you are using store code to search, use additionalFields.storecode (applicable for transaction).
fieldDefinitions[].dataType*StringData type of the field (e.g., STRING).
searchDataPolicyObjectDefines the data retention policy and expiration details for the search data.
searchDataPolicy.dataRetentionPolicy.unitStringTime unit for data retention. Only DAYS is the supported unit now.
searchDataPolicy.dataRetentionPolicy.valueIntegerDefines how many days before the custom-defined event (e.g., "CREATE") the data will be fetched. For example, if the value is 30 and the expireDataFrom is CREATE , data will be fetched from 30 days before the creation of the transaction. By default, retention period duration is 180 days. The maximum number of days supported for transaction search is 365 days, and for customer search, it is 1826 days.
Note: You need to make a bulk trigger API request to activate this.
searchDataPolicy.expireDataFromStringSpecifies the event from which the search data gets indexed. At present, only CREATE is supported.
curl --location 'https://eu.api.capillarytech.com/api_gateway/cortex/v1/criteria' \
--header 'X-CAP-API-AUTH-ORG-ID: 100737' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmVlcmFqLmpiNGFmODA0MDA5Y2IwMzZhNGNjZGMzMzQzMWVmOWFjOQ==' \
--header 'Cookie: _cfuvid=d6B6HLH6oGwJZ21oIncVwhv3KVFCQL1tV0M8y1Bz2L8-1740672713496-0.0.1.1-604800000' \
--data '{
    "name": "TransactionSearch3",
    "entityType": "TRANSACTION",
    "searchStrategyType": "COMBINATION",
    "fieldDefinitions": [
        {
            "fieldId": "billNumber",
            "fieldAlias": "billNumber",
            "fieldType": "INDEXED",
            "dataSourceDetails": {
                "fieldReference": "billNumber"
            },
            "dataType": "STRING"
        }
        
    ],
    "searchDataPolicy": {
        "dataRetentionPolicy": {
            "unit": "DAYS",
            "value": 10
        },
        "expireDataFrom": "CREATE"
    }
}'
curl --location 'https://eu.api.capillarytech.com/api_gateway/cortex/v1/criteria' \
--header 'X-CAP-API-AUTH-ORG-ID: 100737' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmVlcmFqLmRvYzpiNGFmODA0MDA5Y2IwMzZhNGNjZGMzMzQzMWVmOWFjOQ==' \
--header 'Cookie: _cfuvid=d6B6HLH6oGwJZ21oIncVwhv3KVFCQL1tV0M8y1Bz2L8-1740672713496-0.0.1.1-604800000' \
--data '{
    "name": "CustomerSearch1",
    "entityType": "CUSTOMER",
    "searchStrategyType": "COMBINATION",
    "fieldDefinitions": [
        {
            "fieldId": "firstName",
            "fieldAlias": "firstName",
            "fieldType": "INDEXED",
            "dataSourceDetails": {
                "fieldReference": "firstName"
            },
            "dataType": "STRING"
        },
 {
            "fieldId": "lastName",
            "fieldAlias": "lastName",
            "fieldType": "FILTERABLE",
            "dataSourceDetails": {
                "fieldReference": "lastName"
            },
            "dataType": "STRING"
        }

        
    ],
    "searchDataPolicy": {
        "dataRetentionPolicy": {
            "unit": "DAYS",
            "value": 10
        },
        "expireDataFrom": "CREATE"
    }
}'

Response parameters

Parameter NameTypeDescription
data.idStringUnique identifier for the search criteria.
data.orgIdIntegerOrganization ID associated with the search.
data.nameStringName of the search entity.
data.searchStrategyTypeenumDefines the search strategy type (e.g., COMBINATION).
data.entityTypeenumType of entity being searched (e.g., TRANSACTION).
data.bulkJobStatusStringStatus of the bulk job (e.g., OPEN).
data.fieldDefinitionsArrayList of field definitions used in the search.
data.fieldDefinitions[].fieldIdStringUnique identifier for the field.
data.fieldDefinitions[].fieldAliasStringAlias name for the field.
data.fieldDefinitions[].fieldTypeenumType of field (e.g., INDEXED, FILTERABLE).
data.fieldDefinitions[].dataSourceDetails.fieldReferenceStringReference to the actual field in the data source.
data.dataFieldDefinitions[].dataTypeStringData type of the field (e.g., STRING, DATE).
data.searchDataPolicyObjectDefines policies for data retention.
data.searchDataPolicy.dataRetentionPolicy.unitStringTime unit for data retention (e.g., DAYS).
data.searchDataPolicy.dataRetentionPolicy.valueIntegerNumber of units for data retention (e.g., 10).
data.searchDataPolicy.expireDataFromStringDefines when the data expires (e.g., CREATE).
data.criteriaStatus.statusStringStatus of the criteria verification (e.g., VERIFICATION_IN_PROGRESS).
data.auditInfo.createdOnStringTimestamp of when the search entity was created.
data.auditInfo.createdByIntegerUser ID of the creator.
data.auditInfo.lastUpdatedOnStringTimestamp of the last update.
data.auditInfo.lastUpdatedByIntegerUser ID of the last updater.
errorsArrayList of errors encountered during processing (if any).
{
    "data": {
        "id": "67c091299e22382d75d405bc",
        "orgId": 100737,
        "name": "TransactionSearch3",
        "searchStrategyType": "COMBINATION",
        "entityType": "TRANSACTION",
        "fieldDefinitions": [
            {
                "fieldId": "billNumber",
                "fieldAlias": "billNumber",
                "fieldType": "INDEXED",
                "dataSourceDetails": {
                    "fieldReference": "billNumber"
                },
                "dataType": "STRING"
            }
        ],
        "dataFieldDefinitions": [
            {
                "fieldId": "billNumber",
                "fieldAlias": "billNumber",
                "fieldType": "DATA",
                "dataSourceDetails": {
                    "fieldReference": "billNumber"
                },
                "dataType": "STRING"
            },
            {
                "fieldId": "billDate",
                "fieldAlias": "billDate",
                "fieldType": "DATA",
                "dataSourceDetails": {
                    "fieldReference": "billDate"
                },
                "dataType": "DATE"
            }
        ],
        "searchDataPolicy": {
            "dataRetentionPolicy": {
                "unit": "DAYS",
                "value": 10
            },
            "expireDataFrom": "CREATE"
        },
        "criteriaStatus": {
            "status": "VERIFICATION_IN_PROGRESS"
        },
        "bulkJobStatus": "OPEN",
        "auditInfo": {
            "createdOn": "2025-02-27T16:22:01.911+00:00",
            "createdBy": 75155282,
            "lastUpdatedOn": "2025-02-27T16:22:01.911+00:00",
            "lastUpdatedBy": 75155282
        }
    },
    "errors": []
}

Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!