Simulate a bot flow turn
Runs one turn of a flow without touching a real conversation — nothing is sent to a contact and nothing is stored.
It is stateless: pass the state from the previous response back in to continue, and supply graph to test an unpublished draft rather than what is live.
POST
/
api
/
v1
/
accounts
/
{account_id}
/
bot_flows
/
{id}
/
simulate
Simulate a bot flow turn
curl --request POST \
--url https://app.tied.com/api/v1/accounts/{account_id}/bot_flows/{id}/simulate \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"graph": {
"nodes": [
{
"id": "start",
"type": "message",
"data": {
"text": "Hi — what can we help with today?"
}
},
{
"id": "route",
"type": "choice",
"data": {
"options": [
{
"label": "Billing",
"next": "billing"
},
{
"label": "Technical",
"next": "tech"
}
]
}
}
],
"edges": [
{
"from": "start",
"to": "route"
}
]
},
"state": {},
"message": "Billing"
}
'import requests
url = "https://app.tied.com/api/v1/accounts/{account_id}/bot_flows/{id}/simulate"
payload = {
"graph": {
"nodes": [
{
"id": "start",
"type": "message",
"data": { "text": "Hi — what can we help with today?" }
},
{
"id": "route",
"type": "choice",
"data": { "options": [
{
"label": "Billing",
"next": "billing"
},
{
"label": "Technical",
"next": "tech"
}
] }
}
],
"edges": [
{
"from": "start",
"to": "route"
}
]
},
"state": {},
"message": "Billing"
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
graph: {
nodes: [
{
id: 'start',
type: 'message',
data: {text: 'Hi — what can we help with today?'}
},
{
id: 'route',
type: 'choice',
data: {
options: [{label: 'Billing', next: 'billing'}, {label: 'Technical', next: 'tech'}]
}
}
],
edges: [{from: 'start', to: 'route'}]
},
state: {},
message: 'Billing'
})
};
fetch('https://app.tied.com/api/v1/accounts/{account_id}/bot_flows/{id}/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://app.tied.com/api/v1/accounts/{account_id}/bot_flows/{id}/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"graph\": {\n \"nodes\": [\n {\n \"id\": \"start\",\n \"type\": \"message\",\n \"data\": {\n \"text\": \"Hi — what can we help with today?\"\n }\n },\n {\n \"id\": \"route\",\n \"type\": \"choice\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Billing\",\n \"next\": \"billing\"\n },\n {\n \"label\": \"Technical\",\n \"next\": \"tech\"\n }\n ]\n }\n }\n ],\n \"edges\": [\n {\n \"from\": \"start\",\n \"to\": \"route\"\n }\n ]\n },\n \"state\": {},\n \"message\": \"Billing\"\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.tied.com/api/v1/accounts/{account_id}/bot_flows/{id}/simulate"
payload := strings.NewReader("{\n \"graph\": {\n \"nodes\": [\n {\n \"id\": \"start\",\n \"type\": \"message\",\n \"data\": {\n \"text\": \"Hi — what can we help with today?\"\n }\n },\n {\n \"id\": \"route\",\n \"type\": \"choice\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Billing\",\n \"next\": \"billing\"\n },\n {\n \"label\": \"Technical\",\n \"next\": \"tech\"\n }\n ]\n }\n }\n ],\n \"edges\": [\n {\n \"from\": \"start\",\n \"to\": \"route\"\n }\n ]\n },\n \"state\": {},\n \"message\": \"Billing\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_access_token", "<api-key>")
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))
}{
"transcript": [
{
"role": "user",
"text": "Billing"
}
],
"state": {
"last_reply": "Billing",
"current_node_id": null
},
"status": "running"
}{
"error": "Resource could not be found"
}{
"error": "Resource could not be found"
}Authorizations
This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.
Path Parameters
The numeric ID of the bot flow.
Example:
1
Body
application/json
Was this page helpful?
⌘I
Simulate a bot flow turn
curl --request POST \
--url https://app.tied.com/api/v1/accounts/{account_id}/bot_flows/{id}/simulate \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"graph": {
"nodes": [
{
"id": "start",
"type": "message",
"data": {
"text": "Hi — what can we help with today?"
}
},
{
"id": "route",
"type": "choice",
"data": {
"options": [
{
"label": "Billing",
"next": "billing"
},
{
"label": "Technical",
"next": "tech"
}
]
}
}
],
"edges": [
{
"from": "start",
"to": "route"
}
]
},
"state": {},
"message": "Billing"
}
'import requests
url = "https://app.tied.com/api/v1/accounts/{account_id}/bot_flows/{id}/simulate"
payload = {
"graph": {
"nodes": [
{
"id": "start",
"type": "message",
"data": { "text": "Hi — what can we help with today?" }
},
{
"id": "route",
"type": "choice",
"data": { "options": [
{
"label": "Billing",
"next": "billing"
},
{
"label": "Technical",
"next": "tech"
}
] }
}
],
"edges": [
{
"from": "start",
"to": "route"
}
]
},
"state": {},
"message": "Billing"
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
graph: {
nodes: [
{
id: 'start',
type: 'message',
data: {text: 'Hi — what can we help with today?'}
},
{
id: 'route',
type: 'choice',
data: {
options: [{label: 'Billing', next: 'billing'}, {label: 'Technical', next: 'tech'}]
}
}
],
edges: [{from: 'start', to: 'route'}]
},
state: {},
message: 'Billing'
})
};
fetch('https://app.tied.com/api/v1/accounts/{account_id}/bot_flows/{id}/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://app.tied.com/api/v1/accounts/{account_id}/bot_flows/{id}/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"graph\": {\n \"nodes\": [\n {\n \"id\": \"start\",\n \"type\": \"message\",\n \"data\": {\n \"text\": \"Hi — what can we help with today?\"\n }\n },\n {\n \"id\": \"route\",\n \"type\": \"choice\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Billing\",\n \"next\": \"billing\"\n },\n {\n \"label\": \"Technical\",\n \"next\": \"tech\"\n }\n ]\n }\n }\n ],\n \"edges\": [\n {\n \"from\": \"start\",\n \"to\": \"route\"\n }\n ]\n },\n \"state\": {},\n \"message\": \"Billing\"\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.tied.com/api/v1/accounts/{account_id}/bot_flows/{id}/simulate"
payload := strings.NewReader("{\n \"graph\": {\n \"nodes\": [\n {\n \"id\": \"start\",\n \"type\": \"message\",\n \"data\": {\n \"text\": \"Hi — what can we help with today?\"\n }\n },\n {\n \"id\": \"route\",\n \"type\": \"choice\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Billing\",\n \"next\": \"billing\"\n },\n {\n \"label\": \"Technical\",\n \"next\": \"tech\"\n }\n ]\n }\n }\n ],\n \"edges\": [\n {\n \"from\": \"start\",\n \"to\": \"route\"\n }\n ]\n },\n \"state\": {},\n \"message\": \"Billing\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_access_token", "<api-key>")
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))
}{
"transcript": [
{
"role": "user",
"text": "Billing"
}
],
"state": {
"last_reply": "Billing",
"current_node_id": null
},
"status": "running"
}{
"error": "Resource could not be found"
}{
"error": "Resource could not be found"
}