Journey Engine - Versions Save
Endpoint
/i/journey-engine/versions/save
Ⓔ Enterprise Only
This API is available exclusively in Countly Enterprise.
Overview
Create a new journey version or update blocks for an existing version.
Authentication
- Authentication methods:
- API Key (parameter):
api_key=YOUR_API_KEY - Auth Token (parameter):
auth_token=YOUR_AUTH_TOKEN - Auth Token (header):
countly-token: YOUR_AUTH_TOKEN
- API Key (parameter):
Permissions
- Required permission:
Createon thejourney_enginefeature
Request Parameters
Request body JSON:
journeyDefinitionId(required): Journey definition IDappId(required): Application IDname(required for create): Version nameblocks(required): Block graph for the version_id(optional): Version ID for update case
Response
Success Response
{
"_id": "67164f4a1f1bd90d6354430b",
"journeyDefinitionId": "67164f4a1f1bd90d6354430a",
"version": 2,
"name": "v2",
"status": "draft",
"appId": "64afe321d5f9b2f77cb2c8ed",
"blocks": [
{
"id": "block_1",
"subType": "incoming-data"
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
_id | String | Journey version ID |
journeyDefinitionId | String | Journey definition ID |
version | Number | Version number |
name | String | Version name |
status | String | Version status |
appId | String | Application ID |
blocks | Array | Version block graph |
Error Responses
- HTTP 400
{
"result": "Invalid request"
}
- HTTP 500
{
"result": "Failed to update journey version"
}
- HTTP 500
{
"result": "Failed to create journey version"
}
Examples
Create new version
POST /i/journey-engine/versions/save
Content-Type: application/json
{
"journeyDefinitionId": "67164f4a1f1bd90d6354430a",
"appId": "64afe321d5f9b2f77cb2c8ed",
"name": "v2",
"blocks": [{"id": "block_1", "subType": "incoming-data"}]
}
Update version blocks
POST /i/journey-engine/versions/save
Content-Type: application/json
{
"_id": "67164f4a1f1bd90d6354430b",
"blocks": [{"id": "block_1", "subType": "incoming-data"}]
}
Behavior/Processing
- Parses request body JSON and returns
Invalid requestif it is empty. - If
_idis provided, updates onlyblocksfor that existing version and returns the request body. - If
_idis not provided, creates a new version forjourneyDefinitionId. - New version number is computed as the current maximum version number for the definition plus one.
- New versions are always created with status
draft.
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.journey_versions | Endpoint data source | Stores endpoint-related records this endpoint reads or modifies. |
Related Endpoints
- No related endpoints
Ⓔ Enterprise
This feature is part of Countly Enterprise.
Get Access:
Already a Customer? Use support portal if you have any questions
Last Updated
2026-04-18