Replace a draft journey graph
Atomically replaces all steps and edges and returns the graph with client_step_id_map. Exactly one trigger is required, and every edge must reference a submitted step. Only drafts can be replaced; handwritten cards require donor-backed subjects, while sponsorship journeys prohibit tag, update_field and handwritten-card steps. Requires journeys_manage or beta_features; records remain organization scoped.
curl --request POST \
--url https://api.gratona.com/v1/admin/journeys/{id}/steps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"steps": [
{
"type": "trigger",
"id": "<unknown>",
"config": {},
"sort_order": 0,
"position_x": 160,
"position_y": 80,
"position": {
"x": 160,
"y": 80
}
}
],
"edges": [
{
"source_step_id": "trigger",
"target_step_id": "welcome",
"branch_key": "yes",
"branch_label": "Yes",
"sort_order": 0
}
]
}
'import requests
url = "https://api.gratona.com/v1/admin/journeys/{id}/steps"
payload = {
"steps": [
{
"type": "trigger",
"id": "<unknown>",
"config": {},
"sort_order": 0,
"position_x": 160,
"position_y": 80,
"position": {
"x": 160,
"y": 80
}
}
],
"edges": [
{
"source_step_id": "trigger",
"target_step_id": "welcome",
"branch_key": "yes",
"branch_label": "Yes",
"sort_order": 0
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
steps: [
{
type: 'trigger',
id: '<unknown>',
config: {},
sort_order: 0,
position_x: 160,
position_y: 80,
position: {x: 160, y: 80}
}
],
edges: [
{
source_step_id: 'trigger',
target_step_id: 'welcome',
branch_key: 'yes',
branch_label: 'Yes',
sort_order: 0
}
]
})
};
fetch('https://api.gratona.com/v1/admin/journeys/{id}/steps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gratona.com/v1/admin/journeys/{id}/steps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'steps' => [
[
'type' => 'trigger',
'id' => '<unknown>',
'config' => [
],
'sort_order' => 0,
'position_x' => 160,
'position_y' => 80,
'position' => [
'x' => 160,
'y' => 80
]
]
],
'edges' => [
[
'source_step_id' => 'trigger',
'target_step_id' => 'welcome',
'branch_key' => 'yes',
'branch_label' => 'Yes',
'sort_order' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/journeys/{id}/steps"
payload := strings.NewReader("{\n \"steps\": [\n {\n \"type\": \"trigger\",\n \"id\": \"<unknown>\",\n \"config\": {},\n \"sort_order\": 0,\n \"position_x\": 160,\n \"position_y\": 80,\n \"position\": {\n \"x\": 160,\n \"y\": 80\n }\n }\n ],\n \"edges\": [\n {\n \"source_step_id\": \"trigger\",\n \"target_step_id\": \"welcome\",\n \"branch_key\": \"yes\",\n \"branch_label\": \"Yes\",\n \"sort_order\": 0\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gratona.com/v1/admin/journeys/{id}/steps")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"steps\": [\n {\n \"type\": \"trigger\",\n \"id\": \"<unknown>\",\n \"config\": {},\n \"sort_order\": 0,\n \"position_x\": 160,\n \"position_y\": 80,\n \"position\": {\n \"x\": 160,\n \"y\": 80\n }\n }\n ],\n \"edges\": [\n {\n \"source_step_id\": \"trigger\",\n \"target_step_id\": \"welcome\",\n \"branch_key\": \"yes\",\n \"branch_label\": \"Yes\",\n \"sort_order\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/journeys/{id}/steps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"steps\": [\n {\n \"type\": \"trigger\",\n \"id\": \"<unknown>\",\n \"config\": {},\n \"sort_order\": 0,\n \"position_x\": 160,\n \"position_y\": 80,\n \"position\": {\n \"x\": 160,\n \"y\": 80\n }\n }\n ],\n \"edges\": [\n {\n \"source_step_id\": \"trigger\",\n \"target_step_id\": \"welcome\",\n \"branch_key\": \"yes\",\n \"branch_label\": \"Yes\",\n \"sort_order\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 42,
"name": "Welcome new donors",
"description": "Example",
"entity_type": "donor",
"status": "draft",
"trigger_config": {},
"settings": {},
"enrolled_count": 12,
"completed_count": 3,
"can_edit_graph": false,
"can_activate": false,
"activation_blockers": [
"Add a trigger before activating this journey."
],
"created_by": 42,
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"steps": [
{
"id": 42,
"type": "trigger",
"config": {},
"position_x": 160,
"position_y": 80,
"sort_order": 0,
"summary": "Send welcome email"
}
],
"edges": [
{
"id": 42,
"source_step_id": 42,
"target_step_id": 42,
"branch_key": "Example",
"branch_label": "Example",
"sort_order": 0
}
],
"client_step_id_map": {}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Path Parameters
Journey ID in the authenticated organization.
42
Body
Response
Replace a draft journey graph completed.
Journey ID.
42
Journey name.
"Welcome new donors"
Optional journey description.
"Example"
Journey subject type; sponsorship availability follows the workspace lifecycle feature flag.
donor, trip_participant, entity, sponsorship "donor"
Journey lifecycle status.
draft, active, paused, archived "draft"
Step-type-specific configuration. Use the options endpoint for trigger events, filters, fields and templates. Trigger event filters.event_id must identify an available event in this organization.
Journey settings including favorite, allow_reentry and optional event_repeat_policy.
Lifetime enrolled count.
12
Completed goal count.
3
True only for draft journeys.
false
Whether all activation checks pass.
false
Reason activation is blocked.
Creating user ID.
42
Creation timestamp.
"2026-10-20T12:00:00Z"
Last update timestamp.
"2026-10-20T12:00:00Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Map from submitted client step IDs to newly persisted numeric step IDs.
curl --request POST \
--url https://api.gratona.com/v1/admin/journeys/{id}/steps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"steps": [
{
"type": "trigger",
"id": "<unknown>",
"config": {},
"sort_order": 0,
"position_x": 160,
"position_y": 80,
"position": {
"x": 160,
"y": 80
}
}
],
"edges": [
{
"source_step_id": "trigger",
"target_step_id": "welcome",
"branch_key": "yes",
"branch_label": "Yes",
"sort_order": 0
}
]
}
'import requests
url = "https://api.gratona.com/v1/admin/journeys/{id}/steps"
payload = {
"steps": [
{
"type": "trigger",
"id": "<unknown>",
"config": {},
"sort_order": 0,
"position_x": 160,
"position_y": 80,
"position": {
"x": 160,
"y": 80
}
}
],
"edges": [
{
"source_step_id": "trigger",
"target_step_id": "welcome",
"branch_key": "yes",
"branch_label": "Yes",
"sort_order": 0
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
steps: [
{
type: 'trigger',
id: '<unknown>',
config: {},
sort_order: 0,
position_x: 160,
position_y: 80,
position: {x: 160, y: 80}
}
],
edges: [
{
source_step_id: 'trigger',
target_step_id: 'welcome',
branch_key: 'yes',
branch_label: 'Yes',
sort_order: 0
}
]
})
};
fetch('https://api.gratona.com/v1/admin/journeys/{id}/steps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gratona.com/v1/admin/journeys/{id}/steps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'steps' => [
[
'type' => 'trigger',
'id' => '<unknown>',
'config' => [
],
'sort_order' => 0,
'position_x' => 160,
'position_y' => 80,
'position' => [
'x' => 160,
'y' => 80
]
]
],
'edges' => [
[
'source_step_id' => 'trigger',
'target_step_id' => 'welcome',
'branch_key' => 'yes',
'branch_label' => 'Yes',
'sort_order' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/journeys/{id}/steps"
payload := strings.NewReader("{\n \"steps\": [\n {\n \"type\": \"trigger\",\n \"id\": \"<unknown>\",\n \"config\": {},\n \"sort_order\": 0,\n \"position_x\": 160,\n \"position_y\": 80,\n \"position\": {\n \"x\": 160,\n \"y\": 80\n }\n }\n ],\n \"edges\": [\n {\n \"source_step_id\": \"trigger\",\n \"target_step_id\": \"welcome\",\n \"branch_key\": \"yes\",\n \"branch_label\": \"Yes\",\n \"sort_order\": 0\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gratona.com/v1/admin/journeys/{id}/steps")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"steps\": [\n {\n \"type\": \"trigger\",\n \"id\": \"<unknown>\",\n \"config\": {},\n \"sort_order\": 0,\n \"position_x\": 160,\n \"position_y\": 80,\n \"position\": {\n \"x\": 160,\n \"y\": 80\n }\n }\n ],\n \"edges\": [\n {\n \"source_step_id\": \"trigger\",\n \"target_step_id\": \"welcome\",\n \"branch_key\": \"yes\",\n \"branch_label\": \"Yes\",\n \"sort_order\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/journeys/{id}/steps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"steps\": [\n {\n \"type\": \"trigger\",\n \"id\": \"<unknown>\",\n \"config\": {},\n \"sort_order\": 0,\n \"position_x\": 160,\n \"position_y\": 80,\n \"position\": {\n \"x\": 160,\n \"y\": 80\n }\n }\n ],\n \"edges\": [\n {\n \"source_step_id\": \"trigger\",\n \"target_step_id\": \"welcome\",\n \"branch_key\": \"yes\",\n \"branch_label\": \"Yes\",\n \"sort_order\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 42,
"name": "Welcome new donors",
"description": "Example",
"entity_type": "donor",
"status": "draft",
"trigger_config": {},
"settings": {},
"enrolled_count": 12,
"completed_count": 3,
"can_edit_graph": false,
"can_activate": false,
"activation_blockers": [
"Add a trigger before activating this journey."
],
"created_by": 42,
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"steps": [
{
"id": 42,
"type": "trigger",
"config": {},
"position_x": 160,
"position_y": 80,
"sort_order": 0,
"summary": "Send welcome email"
}
],
"edges": [
{
"id": 42,
"source_step_id": 42,
"target_step_id": 42,
"branch_key": "Example",
"branch_label": "Example",
"sort_order": 0
}
],
"client_step_id_map": {}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}