curl --request POST \
--url https://inference.studio.lyzr.ai/api/workflows/{id}/share \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"access_level": "organisation",
"org_access_level": "read",
"shared_with": [
{
"email": "<string>",
"user_id": "<string>"
}
],
"shared_with_teams": [
{
"team_id": "t_9",
"access_level": "execute"
}
]
}
'import requests
url = "https://inference.studio.lyzr.ai/api/workflows/{id}/share"
payload = {
"access_level": "organisation",
"org_access_level": "read",
"shared_with": [
{
"email": "<string>",
"user_id": "<string>"
}
],
"shared_with_teams": [
{
"team_id": "t_9",
"access_level": "execute"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
access_level: 'organisation',
org_access_level: 'read',
shared_with: [{email: '<string>', user_id: '<string>'}],
shared_with_teams: [{team_id: 't_9', access_level: 'execute'}]
})
};
fetch('https://inference.studio.lyzr.ai/api/workflows/{id}/share', 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}/share",
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([
'access_level' => 'organisation',
'org_access_level' => 'read',
'shared_with' => [
[
'email' => '<string>',
'user_id' => '<string>'
]
],
'shared_with_teams' => [
[
'team_id' => 't_9',
'access_level' => 'execute'
]
]
]),
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}/share"
payload := strings.NewReader("{\n \"access_level\": \"organisation\",\n \"org_access_level\": \"read\",\n \"shared_with\": [\n {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ],\n \"shared_with_teams\": [\n {\n \"team_id\": \"t_9\",\n \"access_level\": \"execute\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://inference.studio.lyzr.ai/api/workflows/{id}/share")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"access_level\": \"organisation\",\n \"org_access_level\": \"read\",\n \"shared_with\": [\n {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ],\n \"shared_with_teams\": [\n {\n \"team_id\": \"t_9\",\n \"access_level\": \"execute\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inference.studio.lyzr.ai/api/workflows/{id}/share")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"access_level\": \"organisation\",\n \"org_access_level\": \"read\",\n \"shared_with\": [\n {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ],\n \"shared_with_teams\": [\n {\n \"team_id\": \"t_9\",\n \"access_level\": \"execute\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"group_id": "<string>",
"root_resource_id": "<string>",
"root_resource_type": "<string>",
"access_level": "private",
"org_access_level": "read",
"shared_with": [
{
"email": "<string>",
"user_id": "<string>",
"access_level": "read"
}
],
"shared_with_teams": [
{
"team_id": "t_9",
"access_level": "execute"
}
],
"agent_ids": [
"<string>"
],
"superflow_ids": [
"<string>"
],
"user_id": "<string>",
"user_email": "<string>",
"org_id": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Share Workflow
Shares a workflow with individual users, teams, or the whole organization. This action is owner-only. The call upserts the sharing group with the given access level and recipient lists. access_level sets the group tier (private, organisation, or public); org_access_level sets what an organization-wide share grants (read or write); shared_with and shared_with_teams grant read, write, or execute to a user or a team. The workflow’s referenced agent and sub-workflow IDs are flattened and forwarded so access can be mirrored to them. Credentials typed directly into a node are visible to anyone with read access, including in published versions, so use a credential from the picker in shared workflows.
curl --request POST \
--url https://inference.studio.lyzr.ai/api/workflows/{id}/share \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"access_level": "organisation",
"org_access_level": "read",
"shared_with": [
{
"email": "<string>",
"user_id": "<string>"
}
],
"shared_with_teams": [
{
"team_id": "t_9",
"access_level": "execute"
}
]
}
'import requests
url = "https://inference.studio.lyzr.ai/api/workflows/{id}/share"
payload = {
"access_level": "organisation",
"org_access_level": "read",
"shared_with": [
{
"email": "<string>",
"user_id": "<string>"
}
],
"shared_with_teams": [
{
"team_id": "t_9",
"access_level": "execute"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
access_level: 'organisation',
org_access_level: 'read',
shared_with: [{email: '<string>', user_id: '<string>'}],
shared_with_teams: [{team_id: 't_9', access_level: 'execute'}]
})
};
fetch('https://inference.studio.lyzr.ai/api/workflows/{id}/share', 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}/share",
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([
'access_level' => 'organisation',
'org_access_level' => 'read',
'shared_with' => [
[
'email' => '<string>',
'user_id' => '<string>'
]
],
'shared_with_teams' => [
[
'team_id' => 't_9',
'access_level' => 'execute'
]
]
]),
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}/share"
payload := strings.NewReader("{\n \"access_level\": \"organisation\",\n \"org_access_level\": \"read\",\n \"shared_with\": [\n {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ],\n \"shared_with_teams\": [\n {\n \"team_id\": \"t_9\",\n \"access_level\": \"execute\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://inference.studio.lyzr.ai/api/workflows/{id}/share")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"access_level\": \"organisation\",\n \"org_access_level\": \"read\",\n \"shared_with\": [\n {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ],\n \"shared_with_teams\": [\n {\n \"team_id\": \"t_9\",\n \"access_level\": \"execute\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inference.studio.lyzr.ai/api/workflows/{id}/share")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"access_level\": \"organisation\",\n \"org_access_level\": \"read\",\n \"shared_with\": [\n {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ],\n \"shared_with_teams\": [\n {\n \"team_id\": \"t_9\",\n \"access_level\": \"execute\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"group_id": "<string>",
"root_resource_id": "<string>",
"root_resource_type": "<string>",
"access_level": "private",
"org_access_level": "read",
"shared_with": [
{
"email": "<string>",
"user_id": "<string>",
"access_level": "read"
}
],
"shared_with_teams": [
{
"team_id": "t_9",
"access_level": "execute"
}
],
"agent_ids": [
"<string>"
],
"superflow_ids": [
"<string>"
],
"user_id": "<string>",
"user_email": "<string>",
"org_id": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"access_level": "organisation",
"org_access_level": "read",
"shared_with": [{"user_id": "u_1", "access_level": "write"}],
"shared_with_teams": [{"team_id": "t_9", "access_level": "execute"}]
}
team_id is a team’s group ID, which is not yet available from a public API. To share a workflow with a team, use the share panel in the Studio.
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
Share payload
The group tier.
private, organisation, public "organisation"
What an organization-wide share grants: read (view) or write (edit). Only used when access_level is organisation.
read, write "read"
Individual users and the access each one gets.
Show child attributes
Show child attributes
Teams and the access each one gets.
Show child attributes
Show child attributes
Response
OK
private, organisation, public, read, write, execute read, write Show child attributes
Show child attributes
Show child attributes
Show child attributes