Create desktop policy
curl --request POST \
--url https://api.openworklabs.com/v1/desktop-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"policyName": "<string>",
"policy": {
"allowCustomProviders": true,
"allowZenModel": true,
"allowMultipleWorkspaces": true,
"allowControlSettings": true,
"allowManageExtensions": true,
"allowBuiltInExtensions": true,
"allowAlphaUpdates": true,
"showWelcomePage": true,
"execution": {
"commands": "allow",
"blockedCommands": [],
"browserOrigins": [
"<string>"
],
"blockBrowserUploads": false
},
"onboardingPrompts": [
"<string>"
],
"onboardingPromptDescriptions": [
"<string>"
]
},
"priority": 500000,
"isEnabled": true,
"memberIds": [
"<string>"
],
"teamIds": [
"<string>"
],
"roles": []
}
'import requests
url = "https://api.openworklabs.com/v1/desktop-policies"
payload = {
"policyName": "<string>",
"policy": {
"allowCustomProviders": True,
"allowZenModel": True,
"allowMultipleWorkspaces": True,
"allowControlSettings": True,
"allowManageExtensions": True,
"allowBuiltInExtensions": True,
"allowAlphaUpdates": True,
"showWelcomePage": True,
"execution": {
"commands": "allow",
"blockedCommands": [],
"browserOrigins": ["<string>"],
"blockBrowserUploads": False
},
"onboardingPrompts": ["<string>"],
"onboardingPromptDescriptions": ["<string>"]
},
"priority": 500000,
"isEnabled": True,
"memberIds": ["<string>"],
"teamIds": ["<string>"],
"roles": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
policyName: '<string>',
policy: {
allowCustomProviders: true,
allowZenModel: true,
allowMultipleWorkspaces: true,
allowControlSettings: true,
allowManageExtensions: true,
allowBuiltInExtensions: true,
allowAlphaUpdates: true,
showWelcomePage: true,
execution: {
commands: 'allow',
blockedCommands: [],
browserOrigins: ['<string>'],
blockBrowserUploads: false
},
onboardingPrompts: ['<string>'],
onboardingPromptDescriptions: ['<string>']
},
priority: 500000,
isEnabled: true,
memberIds: ['<string>'],
teamIds: ['<string>'],
roles: []
})
};
fetch('https://api.openworklabs.com/v1/desktop-policies', 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://api.openworklabs.com/v1/desktop-policies",
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([
'policyName' => '<string>',
'policy' => [
'allowCustomProviders' => true,
'allowZenModel' => true,
'allowMultipleWorkspaces' => true,
'allowControlSettings' => true,
'allowManageExtensions' => true,
'allowBuiltInExtensions' => true,
'allowAlphaUpdates' => true,
'showWelcomePage' => true,
'execution' => [
'commands' => 'allow',
'blockedCommands' => [
],
'browserOrigins' => [
'<string>'
],
'blockBrowserUploads' => false
],
'onboardingPrompts' => [
'<string>'
],
'onboardingPromptDescriptions' => [
'<string>'
]
],
'priority' => 500000,
'isEnabled' => true,
'memberIds' => [
'<string>'
],
'teamIds' => [
'<string>'
],
'roles' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.openworklabs.com/v1/desktop-policies"
payload := strings.NewReader("{\n \"policyName\": \"<string>\",\n \"policy\": {\n \"allowCustomProviders\": true,\n \"allowZenModel\": true,\n \"allowMultipleWorkspaces\": true,\n \"allowControlSettings\": true,\n \"allowManageExtensions\": true,\n \"allowBuiltInExtensions\": true,\n \"allowAlphaUpdates\": true,\n \"showWelcomePage\": true,\n \"execution\": {\n \"commands\": \"allow\",\n \"blockedCommands\": [],\n \"browserOrigins\": [\n \"<string>\"\n ],\n \"blockBrowserUploads\": false\n },\n \"onboardingPrompts\": [\n \"<string>\"\n ],\n \"onboardingPromptDescriptions\": [\n \"<string>\"\n ]\n },\n \"priority\": 500000,\n \"isEnabled\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ],\n \"roles\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.openworklabs.com/v1/desktop-policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"policyName\": \"<string>\",\n \"policy\": {\n \"allowCustomProviders\": true,\n \"allowZenModel\": true,\n \"allowMultipleWorkspaces\": true,\n \"allowControlSettings\": true,\n \"allowManageExtensions\": true,\n \"allowBuiltInExtensions\": true,\n \"allowAlphaUpdates\": true,\n \"showWelcomePage\": true,\n \"execution\": {\n \"commands\": \"allow\",\n \"blockedCommands\": [],\n \"browserOrigins\": [\n \"<string>\"\n ],\n \"blockBrowserUploads\": false\n },\n \"onboardingPrompts\": [\n \"<string>\"\n ],\n \"onboardingPromptDescriptions\": [\n \"<string>\"\n ]\n },\n \"priority\": 500000,\n \"isEnabled\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ],\n \"roles\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/desktop-policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"policyName\": \"<string>\",\n \"policy\": {\n \"allowCustomProviders\": true,\n \"allowZenModel\": true,\n \"allowMultipleWorkspaces\": true,\n \"allowControlSettings\": true,\n \"allowManageExtensions\": true,\n \"allowBuiltInExtensions\": true,\n \"allowAlphaUpdates\": true,\n \"showWelcomePage\": true,\n \"execution\": {\n \"commands\": \"allow\",\n \"blockedCommands\": [],\n \"browserOrigins\": [\n \"<string>\"\n ],\n \"blockBrowserUploads\": false\n },\n \"onboardingPrompts\": [\n \"<string>\"\n ],\n \"onboardingPromptDescriptions\": [\n \"<string>\"\n ]\n },\n \"priority\": 500000,\n \"isEnabled\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ],\n \"roles\": []\n}"
response = http.request(request)
puts response.read_body{
"desktopPolicy": {}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"capability": "<string>"
}{
"error": "unauthorized"
}{
"error": "enterprise_plan_required",
"feature": "<string>",
"message": "<string>"
}{
"error": "forbidden",
"reason": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Desktop Policies
Create desktop policy
Creates a desktop policy from a policy document plus optional priority, enabled flag, and assignments to members, teams, or roles (owner, admin, member). Requires the Enterprise plan; referenced members and teams must belong to the organization.
POST
/
v1
/
desktop-policies
Create desktop policy
curl --request POST \
--url https://api.openworklabs.com/v1/desktop-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"policyName": "<string>",
"policy": {
"allowCustomProviders": true,
"allowZenModel": true,
"allowMultipleWorkspaces": true,
"allowControlSettings": true,
"allowManageExtensions": true,
"allowBuiltInExtensions": true,
"allowAlphaUpdates": true,
"showWelcomePage": true,
"execution": {
"commands": "allow",
"blockedCommands": [],
"browserOrigins": [
"<string>"
],
"blockBrowserUploads": false
},
"onboardingPrompts": [
"<string>"
],
"onboardingPromptDescriptions": [
"<string>"
]
},
"priority": 500000,
"isEnabled": true,
"memberIds": [
"<string>"
],
"teamIds": [
"<string>"
],
"roles": []
}
'import requests
url = "https://api.openworklabs.com/v1/desktop-policies"
payload = {
"policyName": "<string>",
"policy": {
"allowCustomProviders": True,
"allowZenModel": True,
"allowMultipleWorkspaces": True,
"allowControlSettings": True,
"allowManageExtensions": True,
"allowBuiltInExtensions": True,
"allowAlphaUpdates": True,
"showWelcomePage": True,
"execution": {
"commands": "allow",
"blockedCommands": [],
"browserOrigins": ["<string>"],
"blockBrowserUploads": False
},
"onboardingPrompts": ["<string>"],
"onboardingPromptDescriptions": ["<string>"]
},
"priority": 500000,
"isEnabled": True,
"memberIds": ["<string>"],
"teamIds": ["<string>"],
"roles": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
policyName: '<string>',
policy: {
allowCustomProviders: true,
allowZenModel: true,
allowMultipleWorkspaces: true,
allowControlSettings: true,
allowManageExtensions: true,
allowBuiltInExtensions: true,
allowAlphaUpdates: true,
showWelcomePage: true,
execution: {
commands: 'allow',
blockedCommands: [],
browserOrigins: ['<string>'],
blockBrowserUploads: false
},
onboardingPrompts: ['<string>'],
onboardingPromptDescriptions: ['<string>']
},
priority: 500000,
isEnabled: true,
memberIds: ['<string>'],
teamIds: ['<string>'],
roles: []
})
};
fetch('https://api.openworklabs.com/v1/desktop-policies', 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://api.openworklabs.com/v1/desktop-policies",
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([
'policyName' => '<string>',
'policy' => [
'allowCustomProviders' => true,
'allowZenModel' => true,
'allowMultipleWorkspaces' => true,
'allowControlSettings' => true,
'allowManageExtensions' => true,
'allowBuiltInExtensions' => true,
'allowAlphaUpdates' => true,
'showWelcomePage' => true,
'execution' => [
'commands' => 'allow',
'blockedCommands' => [
],
'browserOrigins' => [
'<string>'
],
'blockBrowserUploads' => false
],
'onboardingPrompts' => [
'<string>'
],
'onboardingPromptDescriptions' => [
'<string>'
]
],
'priority' => 500000,
'isEnabled' => true,
'memberIds' => [
'<string>'
],
'teamIds' => [
'<string>'
],
'roles' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.openworklabs.com/v1/desktop-policies"
payload := strings.NewReader("{\n \"policyName\": \"<string>\",\n \"policy\": {\n \"allowCustomProviders\": true,\n \"allowZenModel\": true,\n \"allowMultipleWorkspaces\": true,\n \"allowControlSettings\": true,\n \"allowManageExtensions\": true,\n \"allowBuiltInExtensions\": true,\n \"allowAlphaUpdates\": true,\n \"showWelcomePage\": true,\n \"execution\": {\n \"commands\": \"allow\",\n \"blockedCommands\": [],\n \"browserOrigins\": [\n \"<string>\"\n ],\n \"blockBrowserUploads\": false\n },\n \"onboardingPrompts\": [\n \"<string>\"\n ],\n \"onboardingPromptDescriptions\": [\n \"<string>\"\n ]\n },\n \"priority\": 500000,\n \"isEnabled\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ],\n \"roles\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.openworklabs.com/v1/desktop-policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"policyName\": \"<string>\",\n \"policy\": {\n \"allowCustomProviders\": true,\n \"allowZenModel\": true,\n \"allowMultipleWorkspaces\": true,\n \"allowControlSettings\": true,\n \"allowManageExtensions\": true,\n \"allowBuiltInExtensions\": true,\n \"allowAlphaUpdates\": true,\n \"showWelcomePage\": true,\n \"execution\": {\n \"commands\": \"allow\",\n \"blockedCommands\": [],\n \"browserOrigins\": [\n \"<string>\"\n ],\n \"blockBrowserUploads\": false\n },\n \"onboardingPrompts\": [\n \"<string>\"\n ],\n \"onboardingPromptDescriptions\": [\n \"<string>\"\n ]\n },\n \"priority\": 500000,\n \"isEnabled\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ],\n \"roles\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/desktop-policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"policyName\": \"<string>\",\n \"policy\": {\n \"allowCustomProviders\": true,\n \"allowZenModel\": true,\n \"allowMultipleWorkspaces\": true,\n \"allowControlSettings\": true,\n \"allowManageExtensions\": true,\n \"allowBuiltInExtensions\": true,\n \"allowAlphaUpdates\": true,\n \"showWelcomePage\": true,\n \"execution\": {\n \"commands\": \"allow\",\n \"blockedCommands\": [],\n \"browserOrigins\": [\n \"<string>\"\n ],\n \"blockBrowserUploads\": false\n },\n \"onboardingPrompts\": [\n \"<string>\"\n ],\n \"onboardingPromptDescriptions\": [\n \"<string>\"\n ]\n },\n \"priority\": 500000,\n \"isEnabled\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ],\n \"roles\": []\n}"
response = http.request(request)
puts response.read_body{
"desktopPolicy": {}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"capability": "<string>"
}{
"error": "unauthorized"
}{
"error": "enterprise_plan_required",
"feature": "<string>",
"message": "<string>"
}{
"error": "forbidden",
"reason": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
bearerAuthdenApiKey
Session token passed as Authorization: Bearer <session-token> for user-authenticated Den routes.
Body
application/json
Required string length:
1 - 255Show child attributes
Show child attributes
Required range:
0 <= x <= 1000000Maximum array length:
500Den TypeID with 'om_' prefix and a 26-character base32 suffix.
Required string length:
29Maximum array length:
500Den TypeID with 'tem_' prefix and a 26-character base32 suffix.
Required string length:
30Maximum array length:
10Available options:
owner, admin, member Response
Desktop policy created successfully.
Show child attributes
Show child attributes
Was this page helpful?