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


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


getJourney()

getJourney(journeyId): Promise<Journey>

Get journey details by ID

Parameters

journeyId

string

Journey ID

Returns

Promise<Journey>

Journey details


getStatistics()

getStatistics(journeyId): Promise<JourneyStatistics>

Get journey statistics

Parameters

journeyId

string

Journey ID

Returns

Promise<JourneyStatistics>

Journey statistics


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


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?
includeAllVersions?

boolean

Returns

Promise<JourneyListItem[]>

List of journeys from all folders (deduplicated)


listJourneysWithDetailsFromParentSegment()

listJourneysWithDetailsFromParentSegment(parentSegmentId, 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

options?
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?
includeAllVersions?

boolean

Returns

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

Object with journeys array and folders array


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): Promise<string>

Resolve journey by name within a parent segment

Parameters

parentId

string

Parent segment ID

journeyName

string

Journey name to find

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


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