Update conversation variables
curl --request PATCH \
--url https://general-runtime.voiceflow.com/state/user/{userID}/variables \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--header 'projectID: <projectid>' \
--data '{}'import requests
url = "https://general-runtime.voiceflow.com/state/user/{userID}/variables"
payload = {}
headers = {
"projectID": "<projectid>",
"authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
projectID: '<projectid>',
authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://general-runtime.voiceflow.com/state/user/{userID}/variables', 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}/variables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
]),
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}/variables"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", 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.patch("https://general-runtime.voiceflow.com/state/user/{userID}/variables")
.header("projectID", "<projectid>")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://general-runtime.voiceflow.com/state/user/{userID}/variables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["projectID"] = '<projectid>'
request["authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"stack": [
{
"diagramID": "<string>",
"storage": {},
"variables": {},
"nodeID": "<string>",
"name": null,
"commands": [
{
"type": "<string>"
}
],
"dynamicCommands": {}
}
],
"variables": {},
"storage": {},
"turn": {}
}Update conversation variables
Updates variables in the user’s state by merging with the properties in the request body.
PATCH
/
state
/
user
/
{userID}
/
variables
Update conversation variables
curl --request PATCH \
--url https://general-runtime.voiceflow.com/state/user/{userID}/variables \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--header 'projectID: <projectid>' \
--data '{}'import requests
url = "https://general-runtime.voiceflow.com/state/user/{userID}/variables"
payload = {}
headers = {
"projectID": "<projectid>",
"authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
projectID: '<projectid>',
authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://general-runtime.voiceflow.com/state/user/{userID}/variables', 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}/variables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
]),
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}/variables"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", 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.patch("https://general-runtime.voiceflow.com/state/user/{userID}/variables")
.header("projectID", "<projectid>")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://general-runtime.voiceflow.com/state/user/{userID}/variables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["projectID"] = '<projectid>'
request["authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"stack": [
{
"diagramID": "<string>",
"storage": {},
"variables": {},
"nodeID": "<string>",
"name": null,
"commands": [
{
"type": "<string>"
}
],
"dynamicCommands": {}
}
],
"variables": {},
"storage": {},
"turn": {}
}Authorizations
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
Response
200 - application/json
Hide child attributes
Hide child attributes
Was this page helpful?
⌘I