Skip to main content

Journey Engine - Journeys Publish

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint

/i/journey-engine/journeys/publish

Overview

Publish or unpublish a journey version. Publishing activates a version; unpublishing deactivates it.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions

  • Required permission: Update on the journey_engine feature

Request Parameters

Request body JSON:

  • journeyId (required): Journey definition ID
  • versionId (required): Journey version ID
  • status (optional): "active" or "draft" (defaults to active)

Examples

Publish a version

POST /i/journey-engine/journeys/publish
Content-Type: application/json

{
"journeyId": "67164f4a1f1bd90d6354430a",
"versionId": "67164f4a1f1bd90d6354430b",
"status": "active"
}

Unpublish a version (set to draft)

POST /i/journey-engine/journeys/publish
Content-Type: application/json

{
"journeyId": "67164f4a1f1bd90d6354430a",
"versionId": "67164f4a1f1bd90d6354430b",
"status": "draft"
}

Response

Success Response

{
"journeyDefinitionId": "67164f4a1f1bd90d6354430a",
"id": "67164f4a1f1bd90d6354430b",
"status": "active"
}

Response Fields

FieldTypeDescription
journeyDefinitionIdStringJourney definition ID from the request.
idStringJourney version ID from the request.
statusStringactive when publishing, draft when unpublishing.

Error Responses

  • 400: Invalid blocks or request
  • 404: Version not found
  • 500: Publish error

Behavior

  • Loads the target version and returns Version not found if it does not exist.
  • Validates version blocks before publishing. Invalid blocks return a 400 with the validation error message.
  • Updates the journey definition status to active when status=active or omitted; otherwise updates it to draft.
  • Publishing calls version activation, which sets all versions for the journey definition to draft, clears content queue entries for previously active versions, then marks the selected version active.
  • Unpublishing marks the selected version draft and clears its content queue.
  • Emits journey_published or journey_unpublished system log actions.
  • No related endpoints
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.journey_definitionEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.journey_versionsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.