Skip to content

SDK API Reference / JourneySDK

Class: JourneySDK ​

Journey operations API

Methods ​

create() ​

create(request): Promise<Journey>

Create a new journey

Parameters ​

request ​

object

Journey creation request (JSON:API format)

Returns ​

Promise<Journey>

Created journey details


createActivation() ​

createActivation(journeyId, request): Promise<JourneyActivationStep>

Create a journey activation step. This creates a journey-local activation that is used within the journey context.

Workflow for embedded activations in journeys:

  1. Create the journey first (without activation step references)
  2. Create journey activations via this method
  3. Update the journey with activation step IDs

Parameters ​

journeyId ​

string

Journey ID

request ​

CreateJourneyActivationRequest

Activation creation request

Returns ​

Promise<JourneyActivationStep>

Created journey activation step


createVersion() ​

createVersion(journeyId): Promise<Journey>

Create a new draft version of a journey

Parameters ​

journeyId ​

string

Source journey ID to clone from

Returns ​

Promise<Journey>

Newly created journey (draft version)


getActivation() ​

getActivation(journeyId, journeyActivationStepId): Promise<JourneyActivationStep>

Get a journey activation step by ID

Parameters ​

journeyId ​

string

Journey ID

journeyActivationStepId ​

string

Journey activation step ID

Returns ​

Promise<JourneyActivationStep>

Journey activation step details


getBundle() ​

getBundle(bundleId): Promise<JourneyBundle>

Get journey bundle by ID

Parameters ​

bundleId ​

string

Journey bundle ID

Returns ​

Promise<JourneyBundle>

Bundle with all journey versions


getColumnMapping() ​

getColumnMapping(journeyId): Promise<JourneyColumnsResult>

Get column mapping for a journey table. Maps each column name to its corresponding stage, step, and type.

Parameters ​

journeyId ​

string

Journey ID

Returns ​

Promise<JourneyColumnsResult>

Column mapping with database/table info


getJourney() ​

getJourney(journeyId): Promise<Journey>

Get journey details by ID

Parameters ​

journeyId ​

string

Journey ID

Returns ​

Promise<Journey>

Journey details


getLatestJourneyId() ​

getLatestJourneyId(bundleId): Promise<string | undefined>

Get the authoritative latest journey ID from a bundle. Returns undefined if bundleId is missing or the fetch fails.

Parameters ​

bundleId ​

string | undefined

Returns ​

Promise<string | undefined>


getStatistics() ​

getStatistics(journeyId, options?): Promise<JourneyStatistics>

Get journey statistics

Parameters ​

journeyId ​

string

Journey ID

options? ​

Optional period filter (from/to dates)

from? ​

string

to? ​

string

Returns ​

Promise<JourneyStatistics>

Journey statistics


getTrafficData() ​

getTrafficData(journeyId, options?): Promise<JourneyTrafficData>

Get journey traffic data (Sankey charts). Activation data is automatically enriched with stage names from the journey.

Parameters ​

journeyId ​

string

Journey ID

options? ​

Chart type filter and period options

from? ​

string

limit? ​

number

to? ​

string

type? ​

"conversion" | "activation"

Returns ​

Promise<JourneyTrafficData>

Traffic data with conversion and/or activation Sankey charts


listActivations() ​

listActivations(journeyId): Promise<JourneyActivationStep[]>

List all activation steps for a journey

Parameters ​

journeyId ​

string

Journey ID

Returns ​

Promise<JourneyActivationStep[]>

List of journey activation steps


listActivationsFlat() ​

listActivationsFlat(journeyId): Promise<JourneyActivation[]>

List all activation steps for a journey in flattened format. Returns activations with activationParams merged to top level, compatible with ActivationResponse shape for consistent CLI output.

Parameters ​

journeyId ​

string

Journey ID

Returns ​

Promise<JourneyActivation[]>

Flattened journey activations


listJourneysFromParentSegment() ​

listJourneysFromParentSegment(parentSegmentId, rootFolderId?, options?): Promise<JourneyListItem[]>

List journeys across all folders in a parent segment

Uses the /entities/by-folder API for efficient single-call retrieval.

Parameters ​

parentSegmentId ​

string

Parent segment ID

rootFolderId? ​

string

Optional root folder ID (if already known, avoids extra API call)

options? ​

audienceKind is required for a composable audience; see resolveListingRootFolderId for why the fallback is not safe for one

audienceKind? ​

AudienceKind

includeAllVersions? ​

boolean

Returns ​

Promise<JourneyListItem[]>

List of journeys from all folders (deduplicated)


listJourneysWithDetailsFromParentSegment() ​

listJourneysWithDetailsFromParentSegment(parentSegmentId, rootFolderId?, options?): Promise<{ activationStepsById: Map<string, JourneyActivationStep>; journeys: Journey[]; }>

List journeys with full details across all folders in a parent segment. This is more efficient than listJourneysFromParentSegment + getJourney() for each.

Parameters ​

parentSegmentId ​

string

Parent segment ID

rootFolderId? ​

string

Root folder ID, if already known. Pass it whenever the caller has it — see resolveListingRootFolderId for why a composable audience depends on it.

options? ​

audienceKind is required for a composable audience

audienceKind? ​

AudienceKind

includeAllVersions? ​

boolean

Returns ​

Promise<{ activationStepsById: Map<string, JourneyActivationStep>; journeys: Journey[]; }>

Journeys and activation steps from all folders (deduplicated)


listJourneysWithFolders() ​

listJourneysWithFolders(parentSegmentId, rootFolderId?, options?): Promise<{ folders: object[]; journeys: JourneyListItem[]; }>

List journeys and folders from a parent segment in a single API call. Returns both journeys and folder name map for display purposes.

Parameters ​

parentSegmentId ​

string

Parent segment ID

rootFolderId? ​

string

Root folder ID (required)

options? ​
audienceKind? ​

AudienceKind

includeAllVersions? ​

boolean

Returns ​

Promise<{ folders: object[]; journeys: JourneyListItem[]; }>

Object with journeys array and folders array


listVersions() ​

listVersions(journeyId): Promise<{ bundleDescription: string | null; bundleId: string; bundleName: string; latestJourneyId: string; versions: JourneyVersionItem[]; }>

List all versions of a journey

Parameters ​

journeyId ​

string

Any journey ID within the bundle

Returns ​

Promise<{ bundleDescription: string | null; bundleId: string; bundleName: string; latestJourneyId: string; versions: JourneyVersionItem[]; }>

Bundle info and sorted version list


pause() ​

pause(journeyId): Promise<Journey>

Pause a journey and its activations

Parameters ​

journeyId ​

string

Journey ID

Returns ​

Promise<Journey>

Updated journey details


resolveJourneyId() ​

resolveJourneyId(parentId, journeyName, rootFolderId?, audienceKind?): Promise<string>

Resolve journey by name within a parent segment

Parameters ​

parentId ​

string

Parent segment ID

journeyName ​

string

Journey name to find

rootFolderId? ​

string

Root folder ID, if already known. Required in practice for a composable audience — see the note in the body.

audienceKind? ​

AudienceKind = 'complete'

Audience kind, to point the not-found error's helpText at the matching list command (tdx journey list vs tdx cas journey list). Defaults to 'complete' for callers that haven't resolved an audience kind yet.

Returns ​

Promise<string>

Journey ID if found


resume() ​

resume(journeyId): Promise<Journey>

Resume a paused journey

Parameters ​

journeyId ​

string

Journey ID

Returns ​

Promise<Journey>

Updated journey details


run() ​

run(journeyId): Promise<JourneyOnDemandExecution>

Trigger on-demand journey workflow execution

Parameters ​

journeyId ​

string

Journey ID

Returns ​

Promise<JourneyOnDemandExecution>

Execution details


update() ​

update(journeyId, request): Promise<Journey>

Update an existing journey

Parameters ​

journeyId ​

string

Journey ID

request ​

object

Journey update request (JSON:API format)

Returns ​

Promise<Journey>

Updated journey details


updateActivation() ​

updateActivation(journeyId, journeyActivationStepId, request): Promise<JourneyActivationStep>

Update an existing journey activation step's configuration.

Push matches an existing activation by name, so this is what makes a changed destination or column mapping under an unchanged name actually land.

Parameters ​

journeyId ​

string

Journey ID

journeyActivationStepId ​

string

Journey activation step ID

request ​

CreateJourneyActivationRequest

The activation's desired configuration, in full

Returns ​

Promise<JourneyActivationStep>