create-destination

Description

Creates a new destination using one of the pre-configured message templates (Journey, Interact, CDP, Generic). This command is used when you want to publish events using a standard message format to Kafka topics or databases.

Syntax

Windows:

CliTool.bat create-destination -f <path-to-json-file>

Linux:

./CliTool.sh create-destination -f <path-to-json-file>

Example Execution

Windows:

CliTool.bat create-destination -f "C:\destinations\create-journey-destination.json"

Linux:

./CliTool.sh create-destination -f /home/user/destinations/create-journey-destination.json

Sample Output

Success:

Destination created successfully with ID: 42

Error:

Error creating destination: Validation failed - Kafka cluster 'invalid-cluster' not found in Platform

JSON Payload Examples

Example 1: Journey Destination with Kafka Connector

{
  "name": "Customer Journey Events",
  "description": "Publishes journey events to HCL Journey via Kafka",
  "templateId": 1,
  "messageConfig": {
    "payloadEntrySourceCode": "ES-001"
  },
  "feedAttributeMapping": [
    {
      "feedId": 1,
      "attributes": {
        "profile": {
          "customerId": "CUSTOMER_ID",
          "customerName": "CUSTOMER_NAME",
          "email": "EMAIL_ADDRESS"
        },
        "tuple": {
          "eventId": "EVENT_ID",
          "timestamp": "EVENT_TIMESTAMP",
          "eventType": "EVENT_TYPE"
        }
      }
    }
  ],
  "connectorConfig": {
    "kafka": {
      "connectorType": "KAFKA",
      "topic": "journey-events-topic",
      "clusterName": "primary-kafka-cluster"
    }
  }
}

Example 2: Interact Destination with Kafka Connector

{
  "name": "Real-Time Offers to Interact",
  "description": "Sends real-time offer requests to HCL Interact",
  "templateId": 2,
  "messageConfig": {
    "audienceIdAttributeName": "ACCOUNTID",
    "campaignIdAttributeName": "offerCode",
    "customerKeyFieldName": "MSISDN",
    "dateTimeAttributeName" : "ts",
    "eventParamEventName": "event",
    "eventParamInboundChannelName": "inbound_channel",
    "eventParamInboundChannelValue": "hcl",
    "payloadChDebugValue": "false",
    "payloadGatewayValue": "InboundGateway",
    "payloadIcNameValue": "InteractRuntime"
  },
  "feedAttributeMapping": [
    {
      "feedId": 1,
      "attributes": {
        "profile": {
          "accountId": "ACCOUNT_ID",
          "msisdn": "MSISDN"
        },
        "tuple": {
          "eventId": "EVENT_ID",
          "offerCode": "OFFER_CODE"
        }
      }
    }
  ],
  "connectorConfig": {
    "kafka": {
      "connectorType": "KAFKA",
      "topic": "interact-offers-topic",
      "clusterName": "primary-kafka-cluster"
    }
  }
}

Example 3: Destination with Multiple Connectors (Kafka + Database)

{
  "name": "Multi-Connector Event Publisher",
  "description": "Publishes events to both Kafka and MariaDB database",
  "templateId": 1,
  "messageConfig": {
    "payloadEntrySourceCode": "ES-002"
  },
  "feedAttributeMapping": [
    {
      "feedId": "TransactionFeed",
      "attributes": {
        "profile": {
          "userId": "USER_ID",
          "userName": "USER_NAME"
        },
        "tuple": {
          "transactionId": "TRANSACTION_ID",
          "amount": "AMOUNT",
          "currency": "CURRENCY"
        }
      }
    }
  ],
  "connectorConfig": {
    "kafka": {
      "connectorType": "KAFKA",
      "topic": "transaction-events",
      "clusterName": "primary-kafka-cluster"
    },
    "db": {
      "connectorType": "MARIADB",
      "datasourceName": "detect_datasource",
      "databaseName": "detect_audit_db"
    }
  }
}

JSON Schema Breakdown

Root Level Fields

Field Type Required Description
name string Yes Unique name for the destination (e.g., "Customer Journey Events")
description string Yes Human-readable description of the destination's purpose
templateId integer Yes ID of the message template to use. Example IDs used across this document:
  1. Journey
  2. Interact
  3. CDP
  4. Generic
Use get-all-message-templates to see available templates.
messageConfig object Yes Template-specific configuration (key-value pairs). Required fields vary by template type. See [Message Config by Template].
feedAttributeMapping array No Optional array of feed-to-attribute mappings. Maps profile and event attributes from each feed to message template fields. May be omitted, null, or an empty array — in which case no feed-to-attribute mapping validation is performed. When provided, each entry's feedId must be unique and reference an enabled feed with at least one enabled feed parser mapping.
connectorConfig object Yes Connector configuration defining where to publish (Kafka, MariaDB, or multiple). At least one connector must be specified.

messageConfig Object (Template-Specific)

The messageConfig object contains key-value pairs that configure the message template. Required fields vary by template type.

Journey Template (templateId: 1)

Field Type Required Description
payloadEntrySourceCode string Yes Source code identifier for Journey entries (e.g., "ES-001", "ES-002")

Interact Template (templateId: 2)

Field Type Required Description
audienceIdAttributeName string Yes Name of the attribute containing audience/account ID
campaignIdAttributeName string Yes Name of the attribute containing campaign/offer code
customerKeyFieldName string Yes Customer identifier field name (e.g., "MSISDN", "CUSTOMER_ID")
dateTimeAttributeName string Yes Attribute name to pass the date information to Unica Interact.
eventParamEventName string Yes Event parameter name (typically "event")
eventParamInboundChannelName string Yes Inbound channel parameter name (typically "inbound_channel")
eventParamInboundChannelValue string Yes Inbound channel value (e.g., "hcl", "web", "mobile")
payloadChDebugValue string Yes Debug flag ("true" or "false")
payloadGatewayValue string Yes Gateway name for Interact (e.g., "InboundGateway")
payloadIcNameValue string Yes Interact runtime instance name

CDP Template (templateId: 3)

Field Type Required Description
phonyProducerServiceName string Yes Producer service identifier (e.g., "hcl-unica-detect-rts-event")
eventTypeId string Yes Event type identifier for CDP (e.g., "301", "302")

Generic Template (templateId: 4)

Field Type Required Description
producerServiceName string Yes Custom producer service identifier (e.g., "hcl-unica-detect-event")
(custom keys) string Varies Additional fields as defined in your generic template configuration

feedAttributeMapping Array

An optional array of objects that map feed attributes to message template fields. Each mapping defines which profile and event attributes to include for a specific feed.

Optional: The feedAttributeMapping field may be omitted, null, or an empty array ([]). When absent or empty, no feed-to-attribute mapping validation is performed and the destination is saved without any feed mappings.

When provided, the following rules apply:

  • Each feedId must be unique within the array — duplicates are rejected.
  • Each feedId must reference an existing, enabled feed application that has at least one enabled feed parser mapping.
  • Within a mapping, attributes object, its profile / tuple sub-maps are each individually optional. null or empty maps are accepted and skipped during validation.
  • Every non-blank value in the profile map must be a name of an attribute belonging to the customer's profile.
  • Every non-blank value in the tuple map must be a name of an attribute defined on the referenced feed (including its enriched attributes).

Array Item Schema:

Field Type Required Description
feedID string Yes ID of the feed this mapping applies to. Must reference an enabled feed configured in Detect. Each feedId must be unique within the array.
attributes object Yes Container for individually optional profile and tuple mappings.
attributes.profile object No Optional map of profile attributes. Keys are destination's field names; values must be attribute names of the customer profile associated with the feed. May be empty or null.
attributes.tuple object No Optional map of event tuple attributes. Keys are destination's field names; values must be attribute names defined on the referenced feed. May be empty or null.

Example Mapping:

{
  "feedId": 1,
  "attributes": {
    "profile": {
      "customerId": "CUSTOMER_ID",        // Template field: customerId ' Profile attribute: CUSTOMER_ID
      "customerName": "CUSTOMER_NAME",
      "email": "EMAIL_ADDRESS"
    },
    "tuple": {
      "eventId": "EVENT_ID",              // Template field: eventId ' Event attribute: EVENT_ID
      "timestamp": "EVENT_TIMESTAMP",
      "eventType": "EVENT_TYPE"
    }
  }
}

Understanding the Mapping:

  • Left side (keys): Field names to be sent to downstream system.
  • Right side (values): Attribute names from Detect profile or event feed
  • Profile attributes: Retrieved from customer profile storage (database tables)
  • Tuple attributes: Retrieved from the incoming event record (feed data) and defined enriched attributes for feed

connectorConfig Object

Defines where and how to publish destination messages. You can configure one or multiple connectors.

Field Type Required Description
kafka object Conditional Kafka connector configuration. Required if publishing to Kafka. See [Kafka Connector Schema].
db object Conditional Database connector configuration. Required if publishing to database. See [Database Connector Schema].
Note: At least one connector (kafka or db) must be specified. You can configure multiple connectors to publish to multiple destinations simultaneously.

Kafka Connector Schema

Field Type Required Description
connectorType string Yes Must be "KAFKA" (case-sensitive)
topic string Yes Kafka topic name where messages will be published (e.g., "journey-events"). Topic must pre-exist.
clusterName string Yes Name of the Kafka cluster configured in Platform. Use get-all-kafka-cluster-names to list available clusters.
groupId string No Consumer group ID. Always 'null'. Not used for destinations.

Example:

"kafka": {
  "connectorType": "KAFKA",
  "topic": "customer-events",
  "clusterName": "prod-kafka-cluster"
}

Validation:

  • Kafka cluster must exist in Platform configuration
  • Topic accessibility is validated during destination creation
  • Bootstrap servers are retrieved automatically from Platform cluster config

Database Connector Schema

Field Type Required Description
connectorType string Yes Must be "DB" (case-sensitive)
datasourceName string Yes Name of the datasource configured in Platform. Use get-all-datasource-names-for-logged-in-user to list available datasources.
databaseName string Yes Name of the specific database within the datasource (e.g., "detect_audit_db"). Must contain only alphanumeric characters and underscores. Pattern: ^[a-zA-Z_][a-zA-Z0-9_$]+$

Example:

"db": {
  "connectorType": "DB",
  "datasourceName": "detect_datasource",
  "databaseName": "event_audit_db"
}

Validation:

  • Datasource must exist in Platform and be accessible to user
  • Database connectivity is validated during destination creation
  • Database name must follow naming pattern (no special characters except underscore)

Complete JSON Schema Table (All Fields)

Field Path Type Required Validation Rules Description
name string Yes Non-blank, max 255 chars Destination name
description string Yes Non-blank Destination description
templateId integer Yes Must be valid template ID (1-4) Message template:
  1. Journey
  2. Interact
  3. CDP
  4. Generic
messageConfig object Yes Non-empty map Template-specific config (varies by templateId)
feedAttributeMapping array Yes Min 1 item Feed-to-attribute mappings
feedAttributeMapping [].feedId string Yes Non-blank Feed name (must exist in Detect)
feedAttributeMapping [].attributes object Yes Must contain profile and tuple Attribute mappings
feedAttributeMapping [].attributes.profile object Yes Non-empty map Profile attribute mappings (key=template field, value=profile attribute)
feedAttributeMapping [].attributes.tuple object Yes Non-empty map Event tuple attribute mappings (key=template field, value=event attribute)
connectorConfig object Yes At least one connector required Connector configuration
connectorConfig.kafka object Conditional Required if using Kafka Kafka connector config
connectorConfig.kafka.connectorType string Yes Must be "KAFKA" Connector type identifier
connectorConfig.kafka.topic string Yes Non-blank Kafka topic name
connectorConfig.kafka.clusterName string Yes Non-blank, must exist in Platform Kafka cluster name
connectorConfig.kafka.groupId string No Optional Consumer group ID
connectorConfig.db object Conditional Required if using database Database connector config
connectorConfig.db.connectorType string Yes Must be "MARIADB" Connector type identifier
connectorConfig.db.datasourceName string Yes Non-blank, must exist in Platform Datasource name
connectorConfig.db.databaseName string Yes Pattern: ^[a-zA-Z_][a-zA-Z0-9_$]+$ Database name (alphanumeric + underscore only)

Message Config by Template

Each message template requires different configuration fields in messageConfig:

Template ID 1: Journey

Config Key Required Example Value Description
payloadEntrySourceCode Yes "ES-001" Journey entry source identifier

Template ID 2: Interact

Config Key Required Example Value Description
audienceIdAttributeName Yes "ACCOUNTID" Audience identifier attribute
campaignIdAttributeName Yes "offerCode" Campaign/offer code attribute
customerKeyFieldName Yes "MSISDN" Customer key field
dateTimeAttributeName Yes "ts" DateTime parameter name
eventParamEventName Yes "event" Event parameter name
eventParamInboundChannelName Yes "inbound_channel" Channel parameter name
eventParamInboundChannelValue Yes "hcl" Channel value
payloadChDebugValue Yes "false" Debug flag (true/false)
payloadGatewayValue Yes "InboundGateway" Interact gateway name
payloadIcNameValue Yes "InteractRuntime" Interact instance name

Template ID 3: CDP

Config Key Required Example Value Description
phonyProducerServiceName Yes "hcl-unica-detect-rts-event" Producer service name
eventTypeId Yes "301" Event type identifier

Template ID 4: Generic

Custom templates may require different fields. Contact your Detect administrator for custom template configuration requirements.

Config Key Required Example Value Description
producerServiceName ✅ Yes "hcl-unica-detect-event" Producer service name
Important:
  1. Template IDs: Use get-all-message-templates to see available template IDs and names
  2. Connector Validation: During creation, Detect validates:
    • Kafka cluster exists and is reachable
    • Kafka topic is accessible
    • Database datasource exists and is connectable
    • Database name is valid and accessible
    • API endpoint is reachable (if specified)
  3. Multiple Connectors: You can specify multiple connectors (Kafka + Database, or all three)
  4. Attribute Mapping: Profile and tuple attribute names must match attributes defined in Detect profiles and feeds
  5. Feed Names: Must match feed application names configured in Detect