Publish environment
curl --request POST \
--url https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment/{projectEnvironmentIDorAlias}/publish \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment/{projectEnvironmentIDorAlias}/publish"
payload = {
"name": "<string>",
"description": "<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>', description: '<string>'})
};
fetch('https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment/{projectEnvironmentIDorAlias}/publish', 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/{projectEnvironmentIDorAlias}/publish",
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>',
'description' => '<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/{projectEnvironmentIDorAlias}/publish"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<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/{projectEnvironmentIDorAlias}/publish")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment/{projectEnvironmentIDorAlias}/publish")
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 \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"projectEnvironment": {
"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>"
},
"projectEnvironmentRelease": {
"name": "<string>",
"backupID": 123,
"createdAt": "<string>",
"versionID": "<string>",
"description": "<string>",
"autogenerated": true,
"createdByUserID": 123
}
}
}Publish environment
Publish the target environment’s draft as its new published version. The environment can be targeted by ID or alias.
POST
/
v1alpha1
/
project
/
{projectID}
/
environment
/
{projectEnvironmentIDorAlias}
/
publish
Publish environment
curl --request POST \
--url https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment/{projectEnvironmentIDorAlias}/publish \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment/{projectEnvironmentIDorAlias}/publish"
payload = {
"name": "<string>",
"description": "<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>', description: '<string>'})
};
fetch('https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment/{projectEnvironmentIDorAlias}/publish', 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/{projectEnvironmentIDorAlias}/publish",
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>',
'description' => '<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/{projectEnvironmentIDorAlias}/publish"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<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/{projectEnvironmentIDorAlias}/publish")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://realtime-api.voiceflow.com/v1alpha1/project/{projectID}/environment/{projectEnvironmentIDorAlias}/publish")
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 \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"projectEnvironment": {
"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>"
},
"projectEnvironmentRelease": {
"name": "<string>",
"backupID": 123,
"createdAt": "<string>",
"versionID": "<string>",
"description": "<string>",
"autogenerated": true,
"createdByUserID": 123
}
}
}Authorizations
Voiceflow API key
Path Parameters
ID of the project that owns the environments.
ID or alias of the environment to publish.
Response
201 - application/json
The updated environment and created release.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Required range:
0 <= x <= 100Hide child attributes
Hide child attributes
Was this page helpful?
⌘I