Skip to main content

Entity Mapping API

Usageโ€‹

import { epilot } from '@epilot/sdk'

epilot.authorize(() => '<token>')
const { data } = await epilot.entityMapping.storeConfig(...)

Tree-shakeable importโ€‹

import { getClient, authorize } from '@epilot/sdk/entity-mapping'

const entityMappingClient = getClient()
authorize(entityMappingClient, () => '<token>')
const { data } = await entityMappingClient.storeConfig(...)

Operationsโ€‹

mappings

Schemas

storeConfigโ€‹

Store new MappingConfig

POST /v1/mappings

const { data } = await client.storeConfig(
{
with_id: 'example',
},
{
id: 'string',
source: {
type: 'journey',
config: {
journey_id: 'string'
}
},
targets: [
{
id: 'string',
name: 'string',
allow_failure: true,
target_schema: 'string',
target_unique: ['string'],
loop_config: {
source_path: 'string',
length: 'the length of the array'
},
conditionMode: 'oneOf',
conditions: [
{
_exists: {
source: 'string',
value: 'string'
},
_equals: {
source: 'string',
value: 'string'
},
_not_exists: {
source: 'string',
value: 'string'
},
_any_of: {
source: 'string',
value: 'string'
}
}
],
mapping_attributes: [
{
target: '_tags',
operation: {
_append: ['new', 'tags'],
_uniq: true
}
},
{
mode: 'copy_if_exists',
target: 'string',
value: {}
}
],
relation_attributes: [
{
target: 'string',
target_tags: ['string'],
target_tags_include_source: false,
override_with_source_filter: false,
source_filter: {
limit: 0,
schema: 'string',
attribute: 'string',
relation_tag: 'string',
tag: 'string',
self: false
},
related_to: {},
mode: 'append',
origin: 'system_recommendation'
}
],
linkback_relation_attribute: 'mapped_entities',
linkback_relation_tags: ['string']
}
],
created_at: '1970-01-01T00:00:00.000Z',
updated_at: '1970-01-01T00:00:00.000Z',
created_by: {
type: 'user',
org_id: 'string',
user_id: 'string'
},
last_updated_by: {
type: 'user',
org_id: 'string',
user_id: 'string'
},
org_id: '66',
version: 2
},
)
Response
{
"id": "string",
"source": {
"type": "journey",
"config": {
"journey_id": "string"
}
},
"targets": [
{
"id": "string",
"name": "string",
"allow_failure": true,
"target_schema": "string",
"target_unique": ["string"],
"loop_config": {
"source_path": "string",
"length": "the length of the array"
},
"conditionMode": "oneOf",
"conditions": [
{
"_exists": {
"source": "string",
"value": "string"
},
"_equals": {
"source": "string",
"value": "string"
},
"_not_exists": {
"source": "string",
"value": "string"
},
"_any_of": {
"source": "string",
"value": "string"
}
}
],
"mapping_attributes": [
{
"target": "_tags",
"operation": {
"_append": ["new", "tags"],
"_uniq": true
}
},
{
"mode": "copy_if_exists",
"target": "string",
"value": {}
}
],
"relation_attributes": [
{
"target": "string",
"target_tags": ["string"],
"target_tags_include_source": false,
"override_with_source_filter": false,
"source_filter": {
"limit": 0,
"schema": "string",
"attribute": "string",
"relation_tag": "string",
"tag": "string",
"self": false
},
"related_to": {},
"mode": "append",
"origin": "system_recommendation"
}
],
"linkback_relation_attribute": "mapped_entities",
"linkback_relation_tags": ["string"]
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"created_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"last_updated_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"org_id": "66",
"version": 2
}

getConfigโ€‹

Get latest version of a mapping config by id

GET /v1/mappings/{id}

const { data } = await client.getConfig({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"id": "string",
"source": {
"type": "journey",
"config": {
"journey_id": "string"
}
},
"targets": [
{
"id": "string",
"name": "string",
"allow_failure": true,
"target_schema": "string",
"target_unique": ["string"],
"loop_config": {
"source_path": "string",
"length": "the length of the array"
},
"conditionMode": "oneOf",
"conditions": [
{
"_exists": {
"source": "string",
"value": "string"
},
"_equals": {
"source": "string",
"value": "string"
},
"_not_exists": {
"source": "string",
"value": "string"
},
"_any_of": {
"source": "string",
"value": "string"
}
}
],
"mapping_attributes": [
{
"target": "_tags",
"operation": {
"_append": ["new", "tags"],
"_uniq": true
}
},
{
"mode": "copy_if_exists",
"target": "string",
"value": {}
}
],
"relation_attributes": [
{
"target": "string",
"target_tags": ["string"],
"target_tags_include_source": false,
"override_with_source_filter": false,
"source_filter": {
"limit": 0,
"schema": "string",
"attribute": "string",
"relation_tag": "string",
"tag": "string",
"self": false
},
"related_to": {},
"mode": "append",
"origin": "system_recommendation"
}
],
"linkback_relation_attribute": "mapped_entities",
"linkback_relation_tags": ["string"]
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"created_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"last_updated_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"org_id": "66",
"version": 2
}

deleteConfigโ€‹

Delete entity mapping config

DELETE /v1/mappings/{id}

const { data } = await client.deleteConfig({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"id": "string",
"source": {
"type": "journey",
"config": {
"journey_id": "string"
}
},
"targets": [
{
"id": "string",
"name": "string",
"allow_failure": true,
"target_schema": "string",
"target_unique": ["string"],
"loop_config": {
"source_path": "string",
"length": "the length of the array"
},
"conditionMode": "oneOf",
"conditions": [
{
"_exists": {
"source": "string",
"value": "string"
},
"_equals": {
"source": "string",
"value": "string"
},
"_not_exists": {
"source": "string",
"value": "string"
},
"_any_of": {
"source": "string",
"value": "string"
}
}
],
"mapping_attributes": [
{
"target": "_tags",
"operation": {
"_append": ["new", "tags"],
"_uniq": true
}
},
{
"mode": "copy_if_exists",
"target": "string",
"value": {}
}
],
"relation_attributes": [
{
"target": "string",
"target_tags": ["string"],
"target_tags_include_source": false,
"override_with_source_filter": false,
"source_filter": {
"limit": 0,
"schema": "string",
"attribute": "string",
"relation_tag": "string",
"tag": "string",
"self": false
},
"related_to": {},
"mode": "append",
"origin": "system_recommendation"
}
],
"linkback_relation_attribute": "mapped_entities",
"linkback_relation_tags": ["string"]
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"created_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"last_updated_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"org_id": "66",
"version": 2
}

getAllVersionsโ€‹

Get all version of MappingConfig

GET /v1/mappings/{id}/versions

const { data } = await client.getAllVersions({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"configs": [
{
"id": "string",
"source": {
"type": "journey",
"config": {
"journey_id": "string"
}
},
"targets": [
{
"id": "string",
"name": "string",
"allow_failure": true,
"target_schema": "string",
"target_unique": ["string"],
"loop_config": {
"source_path": "string",
"length": "the length of the array"
},
"conditionMode": "oneOf",
"conditions": [
{
"_exists": {
"source": "string",
"value": "string"
},
"_equals": {
"source": "string",
"value": "string"
},
"_not_exists": {
"source": "string",
"value": "string"
},
"_any_of": {
"source": "string",
"value": "string"
}
}
],
"mapping_attributes": [
{
"target": "_tags",
"operation": {
"_append": ["new", "tags"],
"_uniq": true
}
},
{
"mode": "copy_if_exists",
"target": "string",
"value": {}
}
],
"relation_attributes": [
{
"target": "string",
"target_tags": ["string"],
"target_tags_include_source": false,
"override_with_source_filter": false,
"source_filter": {
"limit": 0,
"schema": "string",
"attribute": "string",
"relation_tag": "string",
"tag": "string",
"self": false
},
"related_to": {},
"mode": "append",
"origin": "system_recommendation"
}
],
"linkback_relation_attribute": "mapped_entities",
"linkback_relation_tags": ["string"]
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"created_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"last_updated_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"org_id": "66",
"version": 2
}
]
}

storeNewVersionโ€‹

Store new version of MappingConfig

POST /v1/mappings/{id}/versions

const { data } = await client.storeNewVersion(
{
id: '123e4567-e89b-12d3-a456-426614174000',
},
{
id: 'string',
source: {
type: 'journey',
config: {
journey_id: 'string'
}
},
targets: [
{
id: 'string',
name: 'string',
allow_failure: true,
target_schema: 'string',
target_unique: ['string'],
loop_config: {
source_path: 'string',
length: 'the length of the array'
},
conditionMode: 'oneOf',
conditions: [
{
_exists: {
source: 'string',
value: 'string'
},
_equals: {
source: 'string',
value: 'string'
},
_not_exists: {
source: 'string',
value: 'string'
},
_any_of: {
source: 'string',
value: 'string'
}
}
],
mapping_attributes: [
{
target: '_tags',
operation: {
_append: ['new', 'tags'],
_uniq: true
}
},
{
mode: 'copy_if_exists',
target: 'string',
value: {}
}
],
relation_attributes: [
{
target: 'string',
target_tags: ['string'],
target_tags_include_source: false,
override_with_source_filter: false,
source_filter: {
limit: 0,
schema: 'string',
attribute: 'string',
relation_tag: 'string',
tag: 'string',
self: false
},
related_to: {},
mode: 'append',
origin: 'system_recommendation'
}
],
linkback_relation_attribute: 'mapped_entities',
linkback_relation_tags: ['string']
}
],
created_at: '1970-01-01T00:00:00.000Z',
updated_at: '1970-01-01T00:00:00.000Z',
created_by: {
type: 'user',
org_id: 'string',
user_id: 'string'
},
last_updated_by: {
type: 'user',
org_id: 'string',
user_id: 'string'
},
org_id: '66',
version: 2
},
)
Response
{
"id": "string",
"source": {
"type": "journey",
"config": {
"journey_id": "string"
}
},
"targets": [
{
"id": "string",
"name": "string",
"allow_failure": true,
"target_schema": "string",
"target_unique": ["string"],
"loop_config": {
"source_path": "string",
"length": "the length of the array"
},
"conditionMode": "oneOf",
"conditions": [
{
"_exists": {
"source": "string",
"value": "string"
},
"_equals": {
"source": "string",
"value": "string"
},
"_not_exists": {
"source": "string",
"value": "string"
},
"_any_of": {
"source": "string",
"value": "string"
}
}
],
"mapping_attributes": [
{
"target": "_tags",
"operation": {
"_append": ["new", "tags"],
"_uniq": true
}
},
{
"mode": "copy_if_exists",
"target": "string",
"value": {}
}
],
"relation_attributes": [
{
"target": "string",
"target_tags": ["string"],
"target_tags_include_source": false,
"override_with_source_filter": false,
"source_filter": {
"limit": 0,
"schema": "string",
"attribute": "string",
"relation_tag": "string",
"tag": "string",
"self": false
},
"related_to": {},
"mode": "append",
"origin": "system_recommendation"
}
],
"linkback_relation_attribute": "mapped_entities",
"linkback_relation_tags": ["string"]
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"created_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"last_updated_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"org_id": "66",
"version": 2
}

getConfigVersionโ€‹

Get specific version of a mapping config by id & version

GET /v1/mappings/{id}/versions/{version}

const { data } = await client.getConfigVersion({
id: '123e4567-e89b-12d3-a456-426614174000',
version: 1,
})
Response
{
"id": "string",
"source": {
"type": "journey",
"config": {
"journey_id": "string"
}
},
"targets": [
{
"id": "string",
"name": "string",
"allow_failure": true,
"target_schema": "string",
"target_unique": ["string"],
"loop_config": {
"source_path": "string",
"length": "the length of the array"
},
"conditionMode": "oneOf",
"conditions": [
{
"_exists": {
"source": "string",
"value": "string"
},
"_equals": {
"source": "string",
"value": "string"
},
"_not_exists": {
"source": "string",
"value": "string"
},
"_any_of": {
"source": "string",
"value": "string"
}
}
],
"mapping_attributes": [
{
"target": "_tags",
"operation": {
"_append": ["new", "tags"],
"_uniq": true
}
},
{
"mode": "copy_if_exists",
"target": "string",
"value": {}
}
],
"relation_attributes": [
{
"target": "string",
"target_tags": ["string"],
"target_tags_include_source": false,
"override_with_source_filter": false,
"source_filter": {
"limit": 0,
"schema": "string",
"attribute": "string",
"relation_tag": "string",
"tag": "string",
"self": false
},
"related_to": {},
"mode": "append",
"origin": "system_recommendation"
}
],
"linkback_relation_attribute": "mapped_entities",
"linkback_relation_tags": ["string"]
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"created_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"last_updated_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"org_id": "66",
"version": 2
}

executeMappingโ€‹

Execute entity mapping based on a config

POST /v1/mappings:execute

const { data } = await client.executeMapping(
{
preview_mode: true,
},
{
source_ref: {
entity_id: 'string',
entity_schema: 'submission'
},
targets: [
{
id: 'string',
name: 'string',
allow_failure: true,
target_schema: 'string',
target_unique: ['string'],
loop_config: {
source_path: 'string',
length: 'the length of the array'
},
conditionMode: 'oneOf',
conditions: [
{
_exists: {
source: 'string',
value: 'string'
},
_equals: {
source: 'string',
value: 'string'
},
_not_exists: {
source: 'string',
value: 'string'
},
_any_of: {
source: 'string',
value: 'string'
}
}
],
mapping_attributes: [
{
target: '_tags',
operation: {
_append: ['new', 'tags'],
_uniq: true
}
},
{
mode: 'copy_if_exists',
target: 'string',
value: {}
}
],
relation_attributes: [
{
target: 'string',
target_tags: ['string'],
target_tags_include_source: false,
override_with_source_filter: false,
source_filter: {
limit: 0,
schema: 'string',
attribute: 'string',
relation_tag: 'string',
tag: 'string',
self: false
},
related_to: {},
mode: 'append',
origin: 'system_recommendation'
}
],
linkback_relation_attribute: 'mapped_entities',
linkback_relation_tags: ['string']
}
]
},
)
Response
{
"mapped_entities": [
{
"_id": "string",
"_schema": "string",
"_title": "string",
"_org": "string",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"required": {}
}
],
"failures": [
{
"target": {
"id": "string",
"name": "string",
"allow_failure": true,
"target_schema": "string",
"target_unique": ["string"],
"loop_config": {
"source_path": "string",
"length": "the length of the array"
},
"conditionMode": "oneOf",
"conditions": [
{
"_exists": {
"source": "string",
"value": "string"
},
"_equals": {
"source": "string",
"value": "string"
},
"_not_exists": {
"source": "string",
"value": "string"
},
"_any_of": {
"source": "string",
"value": "string"
}
}
],
"mapping_attributes": [
{
"target": "_tags",
"operation": {
"_append": ["new", "tags"],
"_uniq": true
}
},
{
"mode": "copy_if_exists",
"target": "string",
"value": {}
}
],
"relation_attributes": [
{
"target": "string",
"target_tags": ["string"],
"target_tags_include_source": false,
"override_with_source_filter": false,
"source_filter": {
"limit": 0,
"schema": "string",
"attribute": "string",
"relation_tag": "string",
"tag": "string",
"self": false
},
"related_to": {},
"mode": "append",
"origin": "system_recommendation"
}
],
"linkback_relation_attribute": "mapped_entities",
"linkback_relation_tags": ["string"]
},
"error": {
"isSilent": true,
"message": "string"
}
}
],
"warnings": [
{
"explanation": "string",
"context": "string",
"id": "string"
}
]
}

searchConfigsโ€‹

Search mapping configs

POST /v1/mappings:search

const { data } = await client.searchConfigs(
null,
{
source: {
type: 'journey',
config: {
journey_id: 'string'
}
}
},
)
Response
{
"id": "string",
"source": {
"type": "journey",
"config": {
"journey_id": "string"
}
},
"targets": [
{
"id": "string",
"name": "string",
"allow_failure": true,
"target_schema": "string",
"target_unique": ["string"],
"loop_config": {
"source_path": "string",
"length": "the length of the array"
},
"conditionMode": "oneOf",
"conditions": [
{
"_exists": {
"source": "string",
"value": "string"
},
"_equals": {
"source": "string",
"value": "string"
},
"_not_exists": {
"source": "string",
"value": "string"
},
"_any_of": {
"source": "string",
"value": "string"
}
}
],
"mapping_attributes": [
{
"target": "_tags",
"operation": {
"_append": ["new", "tags"],
"_uniq": true
}
},
{
"mode": "copy_if_exists",
"target": "string",
"value": {}
}
],
"relation_attributes": [
{
"target": "string",
"target_tags": ["string"],
"target_tags_include_source": false,
"override_with_source_filter": false,
"source_filter": {
"limit": 0,
"schema": "string",
"attribute": "string",
"relation_tag": "string",
"tag": "string",
"self": false
},
"related_to": {},
"mode": "append",
"origin": "system_recommendation"
}
],
"linkback_relation_attribute": "mapped_entities",
"linkback_relation_tags": ["string"]
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"created_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"last_updated_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"org_id": "66",
"version": 2
}

queryMappingHistoryโ€‹

Get the Mapping History

GET /v1/mappings/history

const { data } = await client.queryMappingHistory({
from: 'example',
to: 'example',
targetEntityId: 'example',
sourceEntityId: 'example',
})
Response
{}

executeRelationsโ€‹

Execute relation mapping between source entity and target entities

POST /v1/relations:execute

const { data } = await client.executeRelations(
null,
{
source_ref: {
entity_id: 'string',
entity_schema: 'submission'
},
target: {
main_entity_ref: {
entity_id: 'string',
entity_schema: 'submission'
},
relation_attributes: [
{
target: 'string',
target_tags: ['string'],
target_tags_include_source: false,
override_with_source_filter: false,
source_filter: {
limit: 0,
schema: 'string',
attribute: 'string',
relation_tag: 'string',
tag: 'string',
self: false
},
related_to: {},
mode: 'append',
origin: 'system_recommendation'
}
],
linkback: {
attribute: 'mapped_entities',
relation_tags: ['string']
}
},
additional_relations: [
{
entity_id: 'string',
attribute: 'string'
}
]
},
)
Response
{
"relations": [
{
"source_entity_id": "string",
"target_entity_id": "string",
"relation_attr": "string",
"tags": ["string"]
}
]
}

getMappingConfigโ€‹

Get latest version of a mapping config by id V2

GET /v2/mappings/{id}

const { data } = await client.getMappingConfig({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"id": "string",
"source": {
"type": "journey",
"config": {
"journey_id": "string"
}
},
"targets": [
{
"id": "string",
"name": "string",
"allow_failure": true,
"target_schema": "string",
"target_unique": ["string"],
"loop_config": {
"source_path": "string",
"length": "the length of the array"
},
"conditionMode": "oneOf",
"conditions": [
{
"_exists": {
"source": "string",
"value": "string"
},
"_equals": {
"source": "string",
"value": "string"
},
"_not_exists": {
"source": "string",
"value": "string"
},
"_any_of": {
"source": "string",
"value": "string"
}
}
],
"mapping_attributes": [
{
"target": "_tags",
"operation": {
"_append": ["new", "tags"],
"_uniq": true
}
},
{
"mode": "copy_if_exists",
"target": "string",
"value": {}
}
],
"relation_attributes": [
{
"target": "string",
"target_tags": ["string"],
"target_tags_include_source": false,
"override_with_source_filter": false,
"source_filter": {
"limit": 0,
"schema": "string",
"attribute": "string",
"relation_tag": "string",
"tag": "string",
"self": false
},
"related_to": {},
"mode": "append",
"origin": "system_recommendation"
}
],
"linkback_relation_attribute": "mapped_entities",
"linkback_relation_tags": ["string"]
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"created_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"last_updated_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"org_id": "66",
"version": 2
}

putMappingConfigโ€‹

Stores new version of entity mapping config

PUT /v2/mappings/{id}

const { data } = await client.putMappingConfig(
{
id: '123e4567-e89b-12d3-a456-426614174000',
},
{
id: 'string',
source: {
type: 'journey',
config: {
journey_id: 'string'
}
},
targets: [
{
id: 'string',
name: 'string',
allow_failure: true,
target_schema: 'string',
target_unique: ['string'],
loop_config: {
source_path: 'string',
length: 'the length of the array'
},
conditionMode: 'oneOf',
conditions: [
{
_exists: {
source: 'string',
value: 'string'
},
_equals: {
source: 'string',
value: 'string'
},
_not_exists: {
source: 'string',
value: 'string'
},
_any_of: {
source: 'string',
value: 'string'
}
}
],
mapping_attributes: [
{
target: '_tags',
operation: {
_append: ['new', 'tags'],
_uniq: true
}
},
{
mode: 'copy_if_exists',
target: 'string',
value: {}
}
],
relation_attributes: [
{
target: 'string',
target_tags: ['string'],
target_tags_include_source: false,
override_with_source_filter: false,
source_filter: {
limit: 0,
schema: 'string',
attribute: 'string',
relation_tag: 'string',
tag: 'string',
self: false
},
related_to: {},
mode: 'append',
origin: 'system_recommendation'
}
],
linkback_relation_attribute: 'mapped_entities',
linkback_relation_tags: ['string']
}
],
created_at: '1970-01-01T00:00:00.000Z',
updated_at: '1970-01-01T00:00:00.000Z',
created_by: {
type: 'user',
org_id: 'string',
user_id: 'string'
},
last_updated_by: {
type: 'user',
org_id: 'string',
user_id: 'string'
},
org_id: '66',
version: 2
},
)
Response
{
"id": "string",
"source": {
"type": "journey",
"config": {
"journey_id": "string"
}
},
"targets": [
{
"id": "string",
"name": "string",
"allow_failure": true,
"target_schema": "string",
"target_unique": ["string"],
"loop_config": {
"source_path": "string",
"length": "the length of the array"
},
"conditionMode": "oneOf",
"conditions": [
{
"_exists": {
"source": "string",
"value": "string"
},
"_equals": {
"source": "string",
"value": "string"
},
"_not_exists": {
"source": "string",
"value": "string"
},
"_any_of": {
"source": "string",
"value": "string"
}
}
],
"mapping_attributes": [
{
"target": "_tags",
"operation": {
"_append": ["new", "tags"],
"_uniq": true
}
},
{
"mode": "copy_if_exists",
"target": "string",
"value": {}
}
],
"relation_attributes": [
{
"target": "string",
"target_tags": ["string"],
"target_tags_include_source": false,
"override_with_source_filter": false,
"source_filter": {
"limit": 0,
"schema": "string",
"attribute": "string",
"relation_tag": "string",
"tag": "string",
"self": false
},
"related_to": {},
"mode": "append",
"origin": "system_recommendation"
}
],
"linkback_relation_attribute": "mapped_entities",
"linkback_relation_tags": ["string"]
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"created_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"last_updated_by": {
"type": "user",
"org_id": "string",
"user_id": "string"
},
"org_id": "66",
"version": 2
}

Schemasโ€‹

SearchMappingReqโ€‹

type SearchMappingReq = {
source?: {
type?: "journey" | "entity"
config?: {
journey_id?: { ... }
} | {
entity_id: { ... }
entity_schema?: { ... }
}
}
}

MappingConfigsRespโ€‹

type MappingConfigsResp = {
configs: Array<{
id: string
source: {
type?: { ... }
config?: { ... }
}
targets: Array<{
id?: { ... }
name?: { ... }
allow_failure?: { ... }
target_schema: { ... }
target_unique?: { ... }
loop_config?: { ... }
conditionMode?: { ... }
conditions?: { ... }
mapping_attributes: { ... }
relation_attributes?: { ... }
linkback_relation_attribute?: { ... }
linkback_relation_tags?: { ... }
}>
created_at?: string // date-time
updated_at?: string // date-time
created_by?: {
type: { ... }
org_id?: { ... }
user_id?: { ... }
}
last_updated_by?: {
type: { ... }
org_id?: { ... }
user_id?: { ... }
}
org_id?: string
version?: number
}>
}

MappingConfigsโ€‹

type MappingConfigs = Array<{
id: string
source: {
type?: "journey" | "entity"
config?: {
journey_id?: { ... }
} | {
entity_id: { ... }
entity_schema?: { ... }
}
}
targets: Array<{
id?: string
name?: string
allow_failure?: boolean
target_schema: string
target_unique?: string[]
loop_config?: {
source_path?: { ... }
length?: { ... }
}
conditionMode?: "oneOf" | "anyOf" | "allOf"
conditions?: Array<{
_exists?: { ... }
_equals?: { ... }
_not_exists?: { ... }
_any_of?: { ... }
}>
mapping_attributes: Array<{
target: { ... }
operation: { ... }
origin?: { ... }
} | {
mode: { ... }
target: { ... }
value: { ... }
} | {
mode: { ... }
target: { ... }
source: { ... }
} | {
mode: { ... }
target: { ... }
source?: { ... }
value_json: { ... }
target_unique?: { ... }
}>
relation_attributes?: Array<{
target: { ... }
target_tags?: { ... }
target_tags_include_source?: { ... }
override_with_source_filter?: { ... }
source_filter?: { ... }
related_to?: { ... }
mode: { ... }
origin?: { ... }
}>
linkback_relation_attribute?: string
linkback_relation_tags?: string[]
}>
created_at?: string // date-time
updated_at?: string // date-time
created_by?: {
type: "user" | "internal_service"
org_id?: string
user_id?: string
}
last_updated_by?: {
type: "user" | "internal_service"
org_id?: string
user_id?: string
}
org_id?: string
version?: number
}>

MappingConfigโ€‹

type MappingConfig = {
id: string
source: {
type?: "journey" | "entity"
config?: {
journey_id?: { ... }
} | {
entity_id: { ... }
entity_schema?: { ... }
}
}
targets: Array<{
id?: string
name?: string
allow_failure?: boolean
target_schema: string
target_unique?: string[]
loop_config?: {
source_path?: { ... }
length?: { ... }
}
conditionMode?: "oneOf" | "anyOf" | "allOf"
conditions?: Array<{
_exists?: { ... }
_equals?: { ... }
_not_exists?: { ... }
_any_of?: { ... }
}>
mapping_attributes: Array<{
target: { ... }
operation: { ... }
origin?: { ... }
} | {
mode: { ... }
target: { ... }
value: { ... }
} | {
mode: { ... }
target: { ... }
source: { ... }
} | {
mode: { ... }
target: { ... }
source?: { ... }
value_json: { ... }
target_unique?: { ... }
}>
relation_attributes?: Array<{
target: { ... }
target_tags?: { ... }
target_tags_include_source?: { ... }
override_with_source_filter?: { ... }
source_filter?: { ... }
related_to?: { ... }
mode: { ... }
origin?: { ... }
}>
linkback_relation_attribute?: string
linkback_relation_tags?: string[]
}>
created_at?: string // date-time
updated_at?: string // date-time
created_by?: {
type: "user" | "internal_service"
org_id?: string
user_id?: string
}
last_updated_by?: {
type: "user" | "internal_service"
org_id?: string
user_id?: string
}
org_id?: string
version?: number
}

MappingConfigV2โ€‹

type MappingConfigV2 = {
id: string
source: {
type?: "journey" | "entity"
config?: {
journey_id?: { ... }
} | {
entity_id: { ... }
entity_schema?: { ... }
}
}
targets: Array<{
id?: string
name?: string
allow_failure?: boolean
target_schema: string
target_unique?: string[]
loop_config?: {
source_path?: { ... }
length?: { ... }
}
conditionMode?: "oneOf" | "anyOf" | "allOf"
conditions?: Array<{
_exists?: { ... }
_equals?: { ... }
_not_exists?: { ... }
_any_of?: { ... }
}>
mapping_attributes: Array<{
target: { ... }
operation: { ... }
origin?: { ... }
} | {
mode: { ... }
target: { ... }
value: { ... }
} | {
mode: { ... }
target: { ... }
source: { ... }
} | {
mode: { ... }
target: { ... }
source?: { ... }
value_json: { ... }
target_unique?: { ... }
}>
relation_attributes?: Array<{
target: { ... }
target_tags?: { ... }
target_tags_include_source?: { ... }
override_with_source_filter?: { ... }
source_filter?: { ... }
related_to?: { ... }
mode: { ... }
origin?: { ... }
}>
linkback_relation_attribute?: string
linkback_relation_tags?: string[]
}>
created_at?: string // date-time
updated_at?: string // date-time
created_by?: {
type: "user" | "internal_service"
org_id?: string
user_id?: string
}
last_updated_by?: {
type: "user" | "internal_service"
org_id?: string
user_id?: string
}
org_id?: string
version?: number
}

MappingConfigCommonFieldsโ€‹

type MappingConfigCommonFields = {
id: string
source: {
type?: "journey" | "entity"
config?: {
journey_id?: { ... }
} | {
entity_id: { ... }
entity_schema?: { ... }
}
}
targets: Array<{
id?: string
name?: string
allow_failure?: boolean
target_schema: string
target_unique?: string[]
loop_config?: {
source_path?: { ... }
length?: { ... }
}
conditionMode?: "oneOf" | "anyOf" | "allOf"
conditions?: Array<{
_exists?: { ... }
_equals?: { ... }
_not_exists?: { ... }
_any_of?: { ... }
}>
mapping_attributes: Array<{
target: { ... }
operation: { ... }
origin?: { ... }
} | {
mode: { ... }
target: { ... }
value: { ... }
} | {
mode: { ... }
target: { ... }
source: { ... }
} | {
mode: { ... }
target: { ... }
source?: { ... }
value_json: { ... }
target_unique?: { ... }
}>
relation_attributes?: Array<{
target: { ... }
target_tags?: { ... }
target_tags_include_source?: { ... }
override_with_source_filter?: { ... }
source_filter?: { ... }
related_to?: { ... }
mode: { ... }
origin?: { ... }
}>
linkback_relation_attribute?: string
linkback_relation_tags?: string[]
}>
created_at?: string // date-time
updated_at?: string // date-time
created_by?: {
type: "user" | "internal_service"
org_id?: string
user_id?: string
}
last_updated_by?: {
type: "user" | "internal_service"
org_id?: string
user_id?: string
}
}

Ownerโ€‹

type Owner = {
type: "user" | "internal_service"
org_id?: string
user_id?: string
}

ExecuteRelationsReqโ€‹

Build relations between a source entity and one or more target entities, dynamically identified

type ExecuteRelationsReq = {
source_ref: {
entity_id: string
entity_schema?: string
}
target?: {
main_entity_ref: {
entity_id: { ... }
entity_schema?: { ... }
}
relation_attributes: Array<{
target: { ... }
target_tags?: { ... }
target_tags_include_source?: { ... }
override_with_source_filter?: { ... }
source_filter?: { ... }
related_to?: { ... }
mode: { ... }
origin?: { ... }
}>
linkback?: {
attribute: { ... }
relation_tags: { ... }
}
}
additional_relations?: Array<{
entity_id: string
attribute: string
}>
}

ExecuteRelationsRespโ€‹

type ExecuteRelationsResp = {
relations?: Array<{
source_entity_id: string
target_entity_id: string
relation_attr: string
tags?: string[]
}>
}

NewRelationItemโ€‹

type NewRelationItem = {
source_entity_id: string
target_entity_id: string
relation_attr: string
tags?: string[]
}

RelationItemโ€‹

type RelationItem = {
entity_id: string
attribute: string
}

ExecuteMappingReqโ€‹

Pass either source or source_entity

type ExecuteMappingReq = {
source_ref: {
entity_id: string
entity_schema?: string
}
targets: Array<{
id?: string
name?: string
allow_failure?: boolean
target_schema: string
target_unique?: string[]
loop_config?: {
source_path?: { ... }
length?: { ... }
}
conditionMode?: "oneOf" | "anyOf" | "allOf"
conditions?: Array<{
_exists?: { ... }
_equals?: { ... }
_not_exists?: { ... }
_any_of?: { ... }
}>
mapping_attributes: Array<{
target: { ... }
operation: { ... }
origin?: { ... }
} | {
mode: { ... }
target: { ... }
value: { ... }
} | {
mode: { ... }
target: { ... }
source: { ... }
} | {
mode: { ... }
target: { ... }
source?: { ... }
value_json: { ... }
target_unique?: { ... }
}>
relation_attributes?: Array<{
target: { ... }
target_tags?: { ... }
target_tags_include_source?: { ... }
override_with_source_filter?: { ... }
source_filter?: { ... }
related_to?: { ... }
mode: { ... }
origin?: { ... }
}>
linkback_relation_attribute?: string
linkback_relation_tags?: string[]
}>
}

ExecuteMappingRespโ€‹

type ExecuteMappingResp = {
mapped_entities: Array<{
_id?: string
_schema?: string
_title?: string
_org?: string
_tags?: string[]
_created_at?: string
_updated_at?: string
required?: unknown
}>
failures?: Array<{
target?: {
id?: { ... }
name?: { ... }
allow_failure?: { ... }
target_schema: { ... }
target_unique?: { ... }
loop_config?: { ... }
conditionMode?: { ... }
conditions?: { ... }
mapping_attributes: { ... }
relation_attributes?: { ... }
linkback_relation_attribute?: { ... }
linkback_relation_tags?: { ... }
}
error?: {
isSilent?: { ... }
message?: { ... }
}
}>
warnings?: Array<{
explanation: string
context?: string
id?: string
}>
}

MappingFailureโ€‹

type MappingFailure = {
target?: {
id?: string
name?: string
allow_failure?: boolean
target_schema: string
target_unique?: string[]
loop_config?: {
source_path?: { ... }
length?: { ... }
}
conditionMode?: "oneOf" | "anyOf" | "allOf"
conditions?: Array<{
_exists?: { ... }
_equals?: { ... }
_not_exists?: { ... }
_any_of?: { ... }
}>
mapping_attributes: Array<{
target: { ... }
operation: { ... }
origin?: { ... }
} | {
mode: { ... }
target: { ... }
value: { ... }
} | {
mode: { ... }
target: { ... }
source: { ... }
} | {
mode: { ... }
target: { ... }
source?: { ... }
value_json: { ... }
target_unique?: { ... }
}>
relation_attributes?: Array<{
target: { ... }
target_tags?: { ... }
target_tags_include_source?: { ... }
override_with_source_filter?: { ... }
source_filter?: { ... }
related_to?: { ... }
mode: { ... }
origin?: { ... }
}>
linkback_relation_attribute?: string
linkback_relation_tags?: string[]
}
error?: {
isSilent?: boolean
message?: string
}
}

MappingWarningโ€‹

type MappingWarning = {
explanation: string
context?: string
id?: string
}

Entityโ€‹

type Entity = {
_id?: string
_schema?: string
_title?: string
_org?: string
_tags?: string[]
_created_at?: string
_updated_at?: string
required?: unknown
}

EntityRefโ€‹

type EntityRef = {
entity_id: string
entity_schema?: string
}

SourceConfigโ€‹

type SourceConfig = {
type?: "journey" | "entity"
config?: {
journey_id?: string
} | {
entity_id: string
entity_schema?: string
}
}

JourneyRefโ€‹

type JourneyRef = {
journey_id?: string
}

Loop_Index_Stringโ€‹

This string value will be replaced with the value of the loop index, when mapping in loop mode

type Loop_Index_String = "##LOOP_INDEX##"

TargetConfigโ€‹

type TargetConfig = {
id?: string
name?: string
allow_failure?: boolean
target_schema: string
target_unique?: string[]
loop_config?: {
source_path?: string
length?: number
}
conditionMode?: "oneOf" | "anyOf" | "allOf"
conditions?: Array<{
_exists?: {
source?: { ... }
value?: { ... }
}
_equals?: {
source?: { ... }
value?: { ... }
}
_not_exists?: {
source?: { ... }
value?: { ... }
}
_any_of?: {
source?: { ... }
value?: { ... }
}
}>
mapping_attributes: Array<{
target: string
operation: {
_set?: { ... }
_append?: { ... }
_prepend?: { ... }
_uniq?: { ... }
_retain_old_values?: { ... }
_copy?: { ... }
_template?: { ... }
_random?: { ... }
} | string | boolean | number | Record<string, unknown> | unknown[]
origin?: "system_recommendation" | "user_manually" | "entity_updating_system_recommendation"
} | {
mode: "copy_if_exists" | "append_if_exists" | "set_value"
target: string
value: unknown
} | {
mode: "copy_if_exists" | "append_if_exists" | "set_value"
target: string
source: string
} | {
mode: "copy_if_exists" | "append_if_exists" | "set_value"
target: string
source?: string
value_json: string
target_unique?: string[]
}>
relation_attributes?: Array<{
target: string
target_tags?: string[]
target_tags_include_source?: boolean
override_with_source_filter?: boolean
source_filter?: {
limit?: { ... }
schema?: { ... }
attribute?: { ... }
relation_tag?: { ... }
tag?: { ... }
self?: { ... }
}
related_to?: Record<string, unknown>
mode: "append" | "prepend" | "set"
origin?: "system_recommendation" | "user_manually" | "entity_updating_system_recommendation"
}>
linkback_relation_attribute?: string
linkback_relation_tags?: string[]
}

MapConditionโ€‹

type MapCondition = {
_exists?: {
source?: string
value?: string | number | object | object[]
}
_equals?: {
source?: string
value?: string | number | object | object[]
}
_not_exists?: {
source?: string
value?: string | number | object | object[]
}
_any_of?: {
source?: string
value?: string | number | object | object[]
}
}

ConditionNodeโ€‹

type ConditionNode = {
source?: string
value?: string | number | object | object[]
}

RelationAttributeโ€‹

type RelationAttribute = {
target: string
target_tags?: string[]
target_tags_include_source?: boolean
override_with_source_filter?: boolean
source_filter?: {
limit?: number
schema?: string
attribute?: string
relation_tag?: string
tag?: string
self?: boolean
}
related_to?: Record<string, unknown>
mode: "append" | "prepend" | "set"
origin?: "system_recommendation" | "user_manually" | "entity_updating_system_recommendation"
}

MappingAttributeV2โ€‹

type MappingAttributeV2 = {
target: string
operation: {
_set?: string | boolean | number | Record<string, unknown> | unknown[]
_append?: unknown
_prepend?: unknown
_uniq?: boolean | string[]
_retain_old_values?: boolean
_copy?: string
_template?: string
_random?: {
type: { ... }
} | {
type: { ... }
min?: { ... }
max?: { ... }
}
} | string | boolean | number | Record<string, unknown> | unknown[]
origin?: "system_recommendation" | "user_manually" | "entity_updating_system_recommendation"
}

AttributeOriginโ€‹

Origin of an attribute.

type AttributeOrigin = "system_recommendation" | "user_manually" | "entity_updating_system_recommendation"

OperationNodeโ€‹

Mapping operation nodes are either primitive values or operation node objects

type OperationNode = {
_set?: string | boolean | number | Record<string, unknown> | unknown[]
_append?: unknown
_prepend?: unknown
_uniq?: boolean | string[]
_retain_old_values?: boolean
_copy?: string
_template?: string
_random?: {
type: "uuid" | "nanoid"
} | {
type: "number"
min?: number
max?: number
}
} | string | boolean | number | Record<string, unknown> | unknown[]

OperationObjectNodeโ€‹

type OperationObjectNode = {
_set?: string | boolean | number | Record<string, unknown> | unknown[]
_append?: unknown
_prepend?: unknown
_uniq?: boolean | string[]
_retain_old_values?: boolean
_copy?: string
_template?: string
_random?: {
type: "uuid" | "nanoid"
} | {
type: "number"
min?: number
max?: number
}
}

PrimitiveJSONValueโ€‹

Represents any primitive JSON value

type PrimitiveJSONValue = string | boolean | number | Record<string, unknown> | unknown[]

RandomOperationโ€‹

type RandomOperation = {
type: "uuid" | "nanoid"
} | {
type: "number"
min?: number
max?: number
}

MappingAttributeโ€‹

type MappingAttribute = {
mode: "copy_if_exists" | "append_if_exists" | "set_value"
target: string
value: unknown
} | {
mode: "copy_if_exists" | "append_if_exists" | "set_value"
target: string
source: string
} | {
mode: "copy_if_exists" | "append_if_exists" | "set_value"
target: string
source?: string
value_json: string
target_unique?: string[]
}

MappingAttributeModeโ€‹

  • copy_if_exists - it replaces the target attribute with the source value - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute. - set_value - it sets a value to a predefined value. Must be used togethe
type MappingAttributeMode = "copy_if_exists" | "append_if_exists" | "set_value"

SetValueMapperโ€‹

type SetValueMapper = {
mode: "copy_if_exists" | "append_if_exists" | "set_value"
target: string
value: unknown
}

CopyValueMapperโ€‹

type CopyValueMapper = {
mode: "copy_if_exists" | "append_if_exists" | "set_value"
target: string
source: string
}

AppendValueMapperโ€‹

type AppendValueMapper = {
mode: "copy_if_exists" | "append_if_exists" | "set_value"
target: string
source?: string
value_json: string
target_unique?: string[]
}

MappingHistoryRespโ€‹

type MappingHistoryResp = {
results: Array<{
id: string
timestamp: string // ISO datetime
source_entity_snapshot: {
_id?: { ... }
_schema?: { ... }
_title?: { ... }
_org?: { ... }
_tags?: { ... }
_created_at?: { ... }
_updated_at?: { ... }
required?: { ... }
}
mapped_entities_snapshot: Array<{
_id?: { ... }
_schema?: { ... }
_title?: { ... }
_org?: { ... }
_tags?: { ... }
_created_at?: { ... }
_updated_at?: { ... }
required?: { ... }
}>
target_configs_snapshot: Array<{
id?: { ... }
name?: { ... }
allow_failure?: { ... }
target_schema: { ... }
target_unique?: { ... }
loop_config?: { ... }
conditionMode?: { ... }
conditions?: { ... }
mapping_attributes: { ... }
relation_attributes?: { ... }
linkback_relation_attribute?: { ... }
linkback_relation_tags?: { ... }
}>
}>
}

MappingHistoryEntryโ€‹

type MappingHistoryEntry = {
id: string
timestamp: string // ISO datetime
source_entity_snapshot: {
_id?: string
_schema?: string
_title?: string
_org?: string
_tags?: string[]
_created_at?: string
_updated_at?: string
required?: unknown
}
mapped_entities_snapshot: Array<{
_id?: string
_schema?: string
_title?: string
_org?: string
_tags?: string[]
_created_at?: string
_updated_at?: string
required?: unknown
}>
target_configs_snapshot: Array<{
id?: string
name?: string
allow_failure?: boolean
target_schema: string
target_unique?: string[]
loop_config?: {
source_path?: { ... }
length?: { ... }
}
conditionMode?: "oneOf" | "anyOf" | "allOf"
conditions?: Array<{
_exists?: { ... }
_equals?: { ... }
_not_exists?: { ... }
_any_of?: { ... }
}>
mapping_attributes: Array<{
target: { ... }
operation: { ... }
origin?: { ... }
} | {
mode: { ... }
target: { ... }
value: { ... }
} | {
mode: { ... }
target: { ... }
source: { ... }
} | {
mode: { ... }
target: { ... }
source?: { ... }
value_json: { ... }
target_unique?: { ... }
}>
relation_attributes?: Array<{
target: { ... }
target_tags?: { ... }
target_tags_include_source?: { ... }
override_with_source_filter?: { ... }
source_filter?: { ... }
related_to?: { ... }
mode: { ... }
origin?: { ... }
}>
linkback_relation_attribute?: string
linkback_relation_tags?: string[]
}>
}

MappingSourceโ€‹

type MappingSource = {
key: string
sub_properties?: Array<{
value: string
label: string
initial_target_value?: string
possible_target_types?: "string" | "date" | "datetime" | "boolean" | "number" | "image" | "file" | "address" | "email" | "phone" | "select" | "multiselect" | "payment" | "link" | "currency" | "sequence" | "relation" | "array"[]
raw?: boolean
}>
source_type: string
group?: string
possible_target_types?: "string" | "date" | "datetime" | "boolean" | "number" | "image" | "file" | "address" | "email" | "phone" | "select" | "multiselect" | "payment" | "link" | "currency" | "sequence" | "relation" | "array"[]
initial_relation?: {
target: string
target_tags?: string[]
target_tags_include_source?: boolean
override_with_source_filter?: boolean
source_filter?: {
limit?: { ... }
schema?: { ... }
attribute?: { ... }
relation_tag?: { ... }
tag?: { ... }
self?: { ... }
}
related_to?: Record<string, unknown>
mode: "append" | "prepend" | "set"
origin?: "system_recommendation" | "user_manually" | "entity_updating_system_recommendation"
}
title: string
sub_title?: string
repeatable?: boolean
target_settings?: {
allowed_ui_actions?: "schema-select" | "attribute-select" | "target-delete" | "target-add" | "target"[]
locked?: "each" | "first" | "system_recommendation"
isSingleTarget?: boolean
visibility?: {
mode: { ... }
if: { ... }
message?: { ... }
}
}
}

MappingSourcePropertyโ€‹

type MappingSourceProperty = {
value: string
label: string
initial_target_value?: string
possible_target_types?: "string" | "date" | "datetime" | "boolean" | "number" | "image" | "file" | "address" | "email" | "phone" | "select" | "multiselect" | "payment" | "link" | "currency" | "sequence" | "relation" | "array"[]
raw?: boolean
}

MappingSourceTargetTypeโ€‹

type MappingSourceTargetType = "string" | "date" | "datetime" | "boolean" | "number" | "image" | "file" | "address" | "email" | "phone" | "select" | "multiselect" | "payment" | "link" | "currency" | "sequence" | "relation" | "array"