Create environment
curl --request POST \
--url https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--data '
{
"name": "<string>",
"alias": "<string>",
"cloneFromEnvironmentID": "<string>"
}
'import requests
url = "https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment"
payload = {
"name": "<string>",
"alias": "<string>",
"cloneFromEnvironmentID": "<string>"
}
headers = {
"authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', alias: '<string>', cloneFromEnvironmentID: '<string>'})
};
fetch('https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment', 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://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment",
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([
'name' => '<string>',
'alias' => '<string>',
'cloneFromEnvironmentID' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <api-key>"
],
]);
$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://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"alias\": \"<string>\",\n \"cloneFromEnvironmentID\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"alias\": \"<string>\",\n \"cloneFromEnvironmentID\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"alias\": \"<string>\",\n \"cloneFromEnvironmentID\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"alias": "<string>",
"isMain": true,
"releases": [
{
"name": "<string>",
"backupID": 123,
"createdAt": "<string>",
"versionID": "<string>",
"description": "<string>",
"autogenerated": true,
"createdByUserID": 123
}
],
"createdAt": "<string>",
"draftVersionID": "<string>",
"createdByUserID": 123,
"trafficPercentage": 50,
"nextReleaseNumber": 123,
"publishedVersionID": "<string>",
"draftVersionIDsHistory": [
"<string>"
],
"clonedFromMainAt": "<string>"
}
}Create environment
Create a new environment by cloning another environment. When alias is omitted, one is generated from name. When cloneFromEnvironmentID is omitted, the assistant’s main environment is used.
POST
/
v1alpha1
/
project
/
{projectID}
/
environment
Create environment
curl --request POST \
--url https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--data '
{
"name": "<string>",
"alias": "<string>",
"cloneFromEnvironmentID": "<string>"
}
'import requests
url = "https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment"
payload = {
"name": "<string>",
"alias": "<string>",
"cloneFromEnvironmentID": "<string>"
}
headers = {
"authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', alias: '<string>', cloneFromEnvironmentID: '<string>'})
};
fetch('https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment', 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://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment",
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([
'name' => '<string>',
'alias' => '<string>',
'cloneFromEnvironmentID' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <api-key>"
],
]);
$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://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"alias\": \"<string>\",\n \"cloneFromEnvironmentID\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"alias\": \"<string>\",\n \"cloneFromEnvironmentID\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"alias\": \"<string>\",\n \"cloneFromEnvironmentID\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"alias": "<string>",
"isMain": true,
"releases": [
{
"name": "<string>",
"backupID": 123,
"createdAt": "<string>",
"versionID": "<string>",
"description": "<string>",
"autogenerated": true,
"createdByUserID": 123
}
],
"createdAt": "<string>",
"draftVersionID": "<string>",
"createdByUserID": 123,
"trafficPercentage": 50,
"nextReleaseNumber": 123,
"publishedVersionID": "<string>",
"draftVersionIDsHistory": [
"<string>"
],
"clonedFromMainAt": "<string>"
}
}Authorizations
Voiceflow API key
Path Parameters
ID of the project that owns the environments.
Body
application/json
Response
201 - application/json
The newly created environment.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Required range:
0 <= x <= 100Was this page helpful?
⌘I