Update conversation state
curl --request PUT \
--url https://general-runtime.voiceflow.com/state/user/{userID} \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--header 'projectID: <projectid>' \
--data '
{
"stack": [
{
"diagramID": "<string>",
"storage": {},
"variables": {},
"nodeID": "<string>",
"name": null,
"commands": [
{
"type": "<string>"
}
],
"dynamicCommands": {}
}
],
"variables": {},
"storage": {},
"turn": {}
}
'import requests
url = "https://general-runtime.voiceflow.com/state/user/{userID}"
payload = {
"stack": [
{
"diagramID": "<string>",
"storage": {},
"variables": {},
"nodeID": "<string>",
"name": None,
"commands": [{ "type": "<string>" }],
"dynamicCommands": {}
}
],
"variables": {},
"storage": {},
"turn": {}
}
headers = {
"projectID": "<projectid>",
"authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
projectID: '<projectid>',
authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
stack: [
{
diagramID: '<string>',
storage: {},
variables: {},
nodeID: '<string>',
name: null,
commands: [{type: '<string>'}],
dynamicCommands: {}
}
],
variables: {},
storage: {},
turn: {}
})
};
fetch('https://general-runtime.voiceflow.com/state/user/{userID}', 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://general-runtime.voiceflow.com/state/user/{userID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'stack' => [
[
'diagramID' => '<string>',
'storage' => [
],
'variables' => [
],
'nodeID' => '<string>',
'name' => null,
'commands' => [
[
'type' => '<string>'
]
],
'dynamicCommands' => [
]
]
],
'variables' => [
],
'storage' => [
],
'turn' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <api-key>",
"projectID: <projectid>"
],
]);
$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://general-runtime.voiceflow.com/state/user/{userID}"
payload := strings.NewReader("{\n \"stack\": [\n {\n \"diagramID\": \"<string>\",\n \"storage\": {},\n \"variables\": {},\n \"nodeID\": \"<string>\",\n \"name\": null,\n \"commands\": [\n {\n \"type\": \"<string>\"\n }\n ],\n \"dynamicCommands\": {}\n }\n ],\n \"variables\": {},\n \"storage\": {},\n \"turn\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("projectID", "<projectid>")
req.Header.Add("authorization", "<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))
}HttpResponse<String> response = Unirest.put("https://general-runtime.voiceflow.com/state/user/{userID}")
.header("projectID", "<projectid>")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"stack\": [\n {\n \"diagramID\": \"<string>\",\n \"storage\": {},\n \"variables\": {},\n \"nodeID\": \"<string>\",\n \"name\": null,\n \"commands\": [\n {\n \"type\": \"<string>\"\n }\n ],\n \"dynamicCommands\": {}\n }\n ],\n \"variables\": {},\n \"storage\": {},\n \"turn\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://general-runtime.voiceflow.com/state/user/{userID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["projectID"] = '<projectid>'
request["authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stack\": [\n {\n \"diagramID\": \"<string>\",\n \"storage\": {},\n \"variables\": {},\n \"nodeID\": \"<string>\",\n \"name\": null,\n \"commands\": [\n {\n \"type\": \"<string>\"\n }\n ],\n \"dynamicCommands\": {}\n }\n ],\n \"variables\": {},\n \"storage\": {},\n \"turn\": {}\n}"
response = http.request(request)
puts response.read_bodyUpdate conversation state
Replace the current state of the user’s conversation.
PUT
/
state
/
user
/
{userID}
Update conversation state
curl --request PUT \
--url https://general-runtime.voiceflow.com/state/user/{userID} \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--header 'projectID: <projectid>' \
--data '
{
"stack": [
{
"diagramID": "<string>",
"storage": {},
"variables": {},
"nodeID": "<string>",
"name": null,
"commands": [
{
"type": "<string>"
}
],
"dynamicCommands": {}
}
],
"variables": {},
"storage": {},
"turn": {}
}
'import requests
url = "https://general-runtime.voiceflow.com/state/user/{userID}"
payload = {
"stack": [
{
"diagramID": "<string>",
"storage": {},
"variables": {},
"nodeID": "<string>",
"name": None,
"commands": [{ "type": "<string>" }],
"dynamicCommands": {}
}
],
"variables": {},
"storage": {},
"turn": {}
}
headers = {
"projectID": "<projectid>",
"authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
projectID: '<projectid>',
authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
stack: [
{
diagramID: '<string>',
storage: {},
variables: {},
nodeID: '<string>',
name: null,
commands: [{type: '<string>'}],
dynamicCommands: {}
}
],
variables: {},
storage: {},
turn: {}
})
};
fetch('https://general-runtime.voiceflow.com/state/user/{userID}', 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://general-runtime.voiceflow.com/state/user/{userID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'stack' => [
[
'diagramID' => '<string>',
'storage' => [
],
'variables' => [
],
'nodeID' => '<string>',
'name' => null,
'commands' => [
[
'type' => '<string>'
]
],
'dynamicCommands' => [
]
]
],
'variables' => [
],
'storage' => [
],
'turn' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <api-key>",
"projectID: <projectid>"
],
]);
$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://general-runtime.voiceflow.com/state/user/{userID}"
payload := strings.NewReader("{\n \"stack\": [\n {\n \"diagramID\": \"<string>\",\n \"storage\": {},\n \"variables\": {},\n \"nodeID\": \"<string>\",\n \"name\": null,\n \"commands\": [\n {\n \"type\": \"<string>\"\n }\n ],\n \"dynamicCommands\": {}\n }\n ],\n \"variables\": {},\n \"storage\": {},\n \"turn\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("projectID", "<projectid>")
req.Header.Add("authorization", "<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))
}HttpResponse<String> response = Unirest.put("https://general-runtime.voiceflow.com/state/user/{userID}")
.header("projectID", "<projectid>")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"stack\": [\n {\n \"diagramID\": \"<string>\",\n \"storage\": {},\n \"variables\": {},\n \"nodeID\": \"<string>\",\n \"name\": null,\n \"commands\": [\n {\n \"type\": \"<string>\"\n }\n ],\n \"dynamicCommands\": {}\n }\n ],\n \"variables\": {},\n \"storage\": {},\n \"turn\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://general-runtime.voiceflow.com/state/user/{userID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["projectID"] = '<projectid>'
request["authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stack\": [\n {\n \"diagramID\": \"<string>\",\n \"storage\": {},\n \"variables\": {},\n \"nodeID\": \"<string>\",\n \"name\": null,\n \"commands\": [\n {\n \"type\": \"<string>\"\n }\n ],\n \"dynamicCommands\": {}\n }\n ],\n \"variables\": {},\n \"storage\": {},\n \"turn\": {}\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Voiceflow API key
Headers
ID of the target Voiceflow project.
ID or alias of the target environment.
Path Parameters
An ID which uniquely identifies the user having the conversation.
Maximum string length:
128Body
application/json
Hide child attributes
Hide child attributes
Response
200 - undefined
Was this page helpful?
⌘I