Replace a flow campaign's steps
Replaces the whole flow: every step and every edge. A step left out of nodes is
deleted, unless leads have already reached it (step_in_use).
The step types, waits, merge tags and the rules every save checks are in Building a flow campaign.
Step ids are created by ReachBoost. Send an existing step with its id. Give a new
step a ref instead, any label unique in the request, and use that ref in edges.
The response returns every step with its id, and echoes ref next to each new step
this once. Send the id from then on.
Once a campaign has been published its structure is locked: send the same steps and
edges, and only their settings can change (structure_locked).
The flow builder in ReachBoost and this endpoint both replace the whole flow, so whichever saves last wins.
curl --request PUT \
--url https://app.reachboost.io/api/v1/workspaces/{workspace_uuid}/campaigns/{campaign_uuid}/flow \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"nodes": [
{
"ref": "invite",
"type": "connection_request",
"settings": {
"message_content": "Hi [[first_name]], great to meet you.",
"fallback_message": "Hi, great to meet you."
}
},
{
"ref": "thanks",
"type": "follow_up",
"settings": {
"message_content": "Thanks for connecting!",
"wait_before": {
"amount": 2,
"unit": "days"
}
}
},
{
"ref": "done",
"type": "end"
},
{
"ref": "gave_up",
"type": "end",
"settings": {
"wait_before": {
"amount": 3,
"unit": "weeks"
}
}
}
],
"edges": [
{
"from": "start",
"to": "invite",
"outcome": "next"
},
{
"from": "invite",
"to": "thanks",
"outcome": "accepted"
},
{
"from": "invite",
"to": "gave_up",
"outcome": "not_accepted"
},
{
"from": "thanks",
"to": "done",
"outcome": "replied"
},
{
"from": "thanks",
"to": "done",
"outcome": "not_replied"
}
]
}
'const options = {
method: 'PUT',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
nodes: [
{
ref: 'invite',
type: 'connection_request',
settings: {
message_content: 'Hi [[first_name]], great to meet you.',
fallback_message: 'Hi, great to meet you.'
}
},
{
ref: 'thanks',
type: 'follow_up',
settings: {
message_content: 'Thanks for connecting!',
wait_before: {amount: 2, unit: 'days'}
}
},
{ref: 'done', type: 'end'},
{
ref: 'gave_up',
type: 'end',
settings: {wait_before: {amount: 3, unit: 'weeks'}}
}
],
edges: [
{from: 'start', to: 'invite', outcome: 'next'},
{from: 'invite', to: 'thanks', outcome: 'accepted'},
{from: 'invite', to: 'gave_up', outcome: 'not_accepted'},
{from: 'thanks', to: 'done', outcome: 'replied'},
{from: 'thanks', to: 'done', outcome: 'not_replied'}
]
})
};
fetch('https://app.reachboost.io/api/v1/workspaces/{workspace_uuid}/campaigns/{campaign_uuid}/flow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.reachboost.io/api/v1/workspaces/{workspace_uuid}/campaigns/{campaign_uuid}/flow"
payload = {
"nodes": [
{
"ref": "invite",
"type": "connection_request",
"settings": {
"message_content": "Hi [[first_name]], great to meet you.",
"fallback_message": "Hi, great to meet you."
}
},
{
"ref": "thanks",
"type": "follow_up",
"settings": {
"message_content": "Thanks for connecting!",
"wait_before": {
"amount": 2,
"unit": "days"
}
}
},
{
"ref": "done",
"type": "end"
},
{
"ref": "gave_up",
"type": "end",
"settings": { "wait_before": {
"amount": 3,
"unit": "weeks"
} }
}
],
"edges": [
{
"from": "start",
"to": "invite",
"outcome": "next"
},
{
"from": "invite",
"to": "thanks",
"outcome": "accepted"
},
{
"from": "invite",
"to": "gave_up",
"outcome": "not_accepted"
},
{
"from": "thanks",
"to": "done",
"outcome": "replied"
},
{
"from": "thanks",
"to": "done",
"outcome": "not_replied"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://app.reachboost.io/api/v1/workspaces/{workspace_uuid}/campaigns/{campaign_uuid}/flow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"nodes\": [\n {\n \"ref\": \"invite\",\n \"type\": \"connection_request\",\n \"settings\": {\n \"message_content\": \"Hi [[first_name]], great to meet you.\",\n \"fallback_message\": \"Hi, great to meet you.\"\n }\n },\n {\n \"ref\": \"thanks\",\n \"type\": \"follow_up\",\n \"settings\": {\n \"message_content\": \"Thanks for connecting!\",\n \"wait_before\": {\n \"amount\": 2,\n \"unit\": \"days\"\n }\n }\n },\n {\n \"ref\": \"done\",\n \"type\": \"end\"\n },\n {\n \"ref\": \"gave_up\",\n \"type\": \"end\",\n \"settings\": {\n \"wait_before\": {\n \"amount\": 3,\n \"unit\": \"weeks\"\n }\n }\n }\n ],\n \"edges\": [\n {\n \"from\": \"start\",\n \"to\": \"invite\",\n \"outcome\": \"next\"\n },\n {\n \"from\": \"invite\",\n \"to\": \"thanks\",\n \"outcome\": \"accepted\"\n },\n {\n \"from\": \"invite\",\n \"to\": \"gave_up\",\n \"outcome\": \"not_accepted\"\n },\n {\n \"from\": \"thanks\",\n \"to\": \"done\",\n \"outcome\": \"replied\"\n },\n {\n \"from\": \"thanks\",\n \"to\": \"done\",\n \"outcome\": \"not_replied\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"nodes": [
{
"id": "8f1c2a4e-6d3b-4c1f-9a7e-2b5d8e0f1a3c",
"type": "connection_request",
"settings": {
"message_content": "Hi [[first_name]], great to meet you.",
"fallback_message": "Hi, great to meet you.",
"send_empty_connection_request": false
}
},
{
"id": "c47a9b1d-3e5f-4a2c-8b6d-0e9f7a1c2b4d",
"type": "end",
"settings": {}
},
{
"id": "5e2d7f9a-1b4c-4e8d-a3f6-9c0b2d4e6f8a",
"type": "end",
"settings": {
"wait_before": {
"amount": 3,
"unit": "weeks"
}
}
}
],
"edges": [
{
"from": "start",
"to": "8f1c2a4e-6d3b-4c1f-9a7e-2b5d8e0f1a3c",
"outcome": "next"
},
{
"from": "8f1c2a4e-6d3b-4c1f-9a7e-2b5d8e0f1a3c",
"to": "c47a9b1d-3e5f-4a2c-8b6d-0e9f7a1c2b4d",
"outcome": "accepted"
},
{
"from": "8f1c2a4e-6d3b-4c1f-9a7e-2b5d8e0f1a3c",
"to": "5e2d7f9a-1b4c-4e8d-a3f6-9c0b2d4e6f8a",
"outcome": "not_accepted"
}
]
}{
"error": "Invalid API key"
}{
"error": "Resource not found"
}{
"error": "Message cannot be blank.",
"errors": [
{
"code": "blank_message",
"message": "Message cannot be blank.",
"ref": "thanks",
"field": "settings.message_content"
}
]
}{
"error": "Rate limit exceeded. Please try again later.",
"code": "rate_limit_exceeded",
"retry_after": 17
}Path Parameters
Body
Response
The saved flow, with ref echoed next to each new step's id
curl --request PUT \
--url https://app.reachboost.io/api/v1/workspaces/{workspace_uuid}/campaigns/{campaign_uuid}/flow \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"nodes": [
{
"ref": "invite",
"type": "connection_request",
"settings": {
"message_content": "Hi [[first_name]], great to meet you.",
"fallback_message": "Hi, great to meet you."
}
},
{
"ref": "thanks",
"type": "follow_up",
"settings": {
"message_content": "Thanks for connecting!",
"wait_before": {
"amount": 2,
"unit": "days"
}
}
},
{
"ref": "done",
"type": "end"
},
{
"ref": "gave_up",
"type": "end",
"settings": {
"wait_before": {
"amount": 3,
"unit": "weeks"
}
}
}
],
"edges": [
{
"from": "start",
"to": "invite",
"outcome": "next"
},
{
"from": "invite",
"to": "thanks",
"outcome": "accepted"
},
{
"from": "invite",
"to": "gave_up",
"outcome": "not_accepted"
},
{
"from": "thanks",
"to": "done",
"outcome": "replied"
},
{
"from": "thanks",
"to": "done",
"outcome": "not_replied"
}
]
}
'const options = {
method: 'PUT',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
nodes: [
{
ref: 'invite',
type: 'connection_request',
settings: {
message_content: 'Hi [[first_name]], great to meet you.',
fallback_message: 'Hi, great to meet you.'
}
},
{
ref: 'thanks',
type: 'follow_up',
settings: {
message_content: 'Thanks for connecting!',
wait_before: {amount: 2, unit: 'days'}
}
},
{ref: 'done', type: 'end'},
{
ref: 'gave_up',
type: 'end',
settings: {wait_before: {amount: 3, unit: 'weeks'}}
}
],
edges: [
{from: 'start', to: 'invite', outcome: 'next'},
{from: 'invite', to: 'thanks', outcome: 'accepted'},
{from: 'invite', to: 'gave_up', outcome: 'not_accepted'},
{from: 'thanks', to: 'done', outcome: 'replied'},
{from: 'thanks', to: 'done', outcome: 'not_replied'}
]
})
};
fetch('https://app.reachboost.io/api/v1/workspaces/{workspace_uuid}/campaigns/{campaign_uuid}/flow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.reachboost.io/api/v1/workspaces/{workspace_uuid}/campaigns/{campaign_uuid}/flow"
payload = {
"nodes": [
{
"ref": "invite",
"type": "connection_request",
"settings": {
"message_content": "Hi [[first_name]], great to meet you.",
"fallback_message": "Hi, great to meet you."
}
},
{
"ref": "thanks",
"type": "follow_up",
"settings": {
"message_content": "Thanks for connecting!",
"wait_before": {
"amount": 2,
"unit": "days"
}
}
},
{
"ref": "done",
"type": "end"
},
{
"ref": "gave_up",
"type": "end",
"settings": { "wait_before": {
"amount": 3,
"unit": "weeks"
} }
}
],
"edges": [
{
"from": "start",
"to": "invite",
"outcome": "next"
},
{
"from": "invite",
"to": "thanks",
"outcome": "accepted"
},
{
"from": "invite",
"to": "gave_up",
"outcome": "not_accepted"
},
{
"from": "thanks",
"to": "done",
"outcome": "replied"
},
{
"from": "thanks",
"to": "done",
"outcome": "not_replied"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://app.reachboost.io/api/v1/workspaces/{workspace_uuid}/campaigns/{campaign_uuid}/flow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"nodes\": [\n {\n \"ref\": \"invite\",\n \"type\": \"connection_request\",\n \"settings\": {\n \"message_content\": \"Hi [[first_name]], great to meet you.\",\n \"fallback_message\": \"Hi, great to meet you.\"\n }\n },\n {\n \"ref\": \"thanks\",\n \"type\": \"follow_up\",\n \"settings\": {\n \"message_content\": \"Thanks for connecting!\",\n \"wait_before\": {\n \"amount\": 2,\n \"unit\": \"days\"\n }\n }\n },\n {\n \"ref\": \"done\",\n \"type\": \"end\"\n },\n {\n \"ref\": \"gave_up\",\n \"type\": \"end\",\n \"settings\": {\n \"wait_before\": {\n \"amount\": 3,\n \"unit\": \"weeks\"\n }\n }\n }\n ],\n \"edges\": [\n {\n \"from\": \"start\",\n \"to\": \"invite\",\n \"outcome\": \"next\"\n },\n {\n \"from\": \"invite\",\n \"to\": \"thanks\",\n \"outcome\": \"accepted\"\n },\n {\n \"from\": \"invite\",\n \"to\": \"gave_up\",\n \"outcome\": \"not_accepted\"\n },\n {\n \"from\": \"thanks\",\n \"to\": \"done\",\n \"outcome\": \"replied\"\n },\n {\n \"from\": \"thanks\",\n \"to\": \"done\",\n \"outcome\": \"not_replied\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"nodes": [
{
"id": "8f1c2a4e-6d3b-4c1f-9a7e-2b5d8e0f1a3c",
"type": "connection_request",
"settings": {
"message_content": "Hi [[first_name]], great to meet you.",
"fallback_message": "Hi, great to meet you.",
"send_empty_connection_request": false
}
},
{
"id": "c47a9b1d-3e5f-4a2c-8b6d-0e9f7a1c2b4d",
"type": "end",
"settings": {}
},
{
"id": "5e2d7f9a-1b4c-4e8d-a3f6-9c0b2d4e6f8a",
"type": "end",
"settings": {
"wait_before": {
"amount": 3,
"unit": "weeks"
}
}
}
],
"edges": [
{
"from": "start",
"to": "8f1c2a4e-6d3b-4c1f-9a7e-2b5d8e0f1a3c",
"outcome": "next"
},
{
"from": "8f1c2a4e-6d3b-4c1f-9a7e-2b5d8e0f1a3c",
"to": "c47a9b1d-3e5f-4a2c-8b6d-0e9f7a1c2b4d",
"outcome": "accepted"
},
{
"from": "8f1c2a4e-6d3b-4c1f-9a7e-2b5d8e0f1a3c",
"to": "5e2d7f9a-1b4c-4e8d-a3f6-9c0b2d4e6f8a",
"outcome": "not_accepted"
}
]
}{
"error": "Invalid API key"
}{
"error": "Resource not found"
}{
"error": "Message cannot be blank.",
"errors": [
{
"code": "blank_message",
"message": "Message cannot be blank.",
"ref": "thanks",
"field": "settings.message_content"
}
]
}{
"error": "Rate limit exceeded. Please try again later.",
"code": "rate_limit_exceeded",
"retry_after": 17
}
