Deploy a version
curl --request PUT \
--url https://inference.studio.lyzr.ai/api/workflows/{id}/live \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"version_id": "<string>"
}
'import requests
url = "https://inference.studio.lyzr.ai/api/workflows/{id}/live"
payload = { "version_id": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({version_id: '<string>'})
};
fetch('https://inference.studio.lyzr.ai/api/workflows/{id}/live', 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://inference.studio.lyzr.ai/api/workflows/{id}/live",
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([
'version_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://inference.studio.lyzr.ai/api/workflows/{id}/live"
payload := strings.NewReader("{\n \"version_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<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://inference.studio.lyzr.ai/api/workflows/{id}/live")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"version_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inference.studio.lyzr.ai/api/workflows/{id}/live")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"version_id": "<string>",
"number": 3,
"message": "Add approval step",
"created_by": "<string>",
"created_at": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Versions
Deploy Version
Points production at a version, either the newest or an older one to roll back. This is the only call that changes what production runs: execute by workflow_id, webhook triggers, scheduled and manually triggered runs, and Execute Workflow nodes that call this workflow. Needs edit access.
PUT
/
workflows
/
{id}
/
live
Deploy a version
curl --request PUT \
--url https://inference.studio.lyzr.ai/api/workflows/{id}/live \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"version_id": "<string>"
}
'import requests
url = "https://inference.studio.lyzr.ai/api/workflows/{id}/live"
payload = { "version_id": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({version_id: '<string>'})
};
fetch('https://inference.studio.lyzr.ai/api/workflows/{id}/live', 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://inference.studio.lyzr.ai/api/workflows/{id}/live",
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([
'version_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://inference.studio.lyzr.ai/api/workflows/{id}/live"
payload := strings.NewReader("{\n \"version_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<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://inference.studio.lyzr.ai/api/workflows/{id}/live")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"version_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inference.studio.lyzr.ai/api/workflows/{id}/live")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"version_id": "<string>",
"number": 3,
"message": "Add approval step",
"created_by": "<string>",
"created_at": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}A workflow that has never had a version deployed keeps running its draft, so existing workflows are unaffected until you deploy a version. To roll back, deploy an older
version_id from List Versions.Authorizations
Lyzr API key. Studio session keys (agk_, ags_) and durable sk- keys are accepted. Required on every endpoint except GET /node-types and a webhook-triggered execute that carries X-Webhook-Secret.
Path Parameters
Workflow ID
Body
application/json
The version to deploy. It can be the newest version or an older one.