Create an active OpenWork Cloud Automation
curl --request POST \
--url http://api.den.local/v1/cloud-automations \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"action": {
"kind": "agent",
"instructions": "<string>",
"model": {
"providerId": "<string>",
"modelId": "<string>",
"variant": "<string>"
}
}
}
'import requests
url = "http://api.den.local/v1/cloud-automations"
payload = {
"name": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"action": {
"kind": "agent",
"instructions": "<string>",
"model": {
"providerId": "<string>",
"modelId": "<string>",
"variant": "<string>"
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
schedule: {kind: 'once', timezone: '<string>', at: 4503599627370495},
action: {
kind: 'agent',
instructions: '<string>',
model: {providerId: '<string>', modelId: '<string>', variant: '<string>'}
}
})
};
fetch('http://api.den.local/v1/cloud-automations', 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 => "http://api.den.local/v1/cloud-automations",
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>',
'schedule' => [
'kind' => 'once',
'timezone' => '<string>',
'at' => 4503599627370495
],
'action' => [
'kind' => 'agent',
'instructions' => '<string>',
'model' => [
'providerId' => '<string>',
'modelId' => '<string>',
'variant' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://api.den.local/v1/cloud-automations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"action\": {\n \"kind\": \"agent\",\n \"instructions\": \"<string>\",\n \"model\": {\n \"providerId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"variant\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://api.den.local/v1/cloud-automations")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"action\": {\n \"kind\": \"agent\",\n \"instructions\": \"<string>\",\n \"model\": {\n \"providerId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"variant\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.den.local/v1/cloud-automations")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"action\": {\n \"kind\": \"agent\",\n \"instructions\": \"<string>\",\n \"model\": {\n \"providerId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"variant\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"automation": {
"id": "<string>",
"organizationId": "<string>",
"ownerMemberId": "<string>",
"name": "<string>",
"state": "active",
"currentRevisionId": "<string>",
"nextDueAt": 4503599627370495,
"latestRunAt": 4503599627370495,
"needsAttentionReason": {
"code": "owner_membership_lost",
"message": "<string>",
"occurredAt": 4503599627370495
},
"createdAt": 4503599627370495,
"updatedAt": 4503599627370495,
"archivedAt": 4503599627370495,
"latestSuccessfulRunId": "<string>",
"latestSuccessfulResult": "<unknown>"
},
"revision": {
"id": "<string>",
"automationId": "<string>",
"version": 123,
"instructions": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"model": {
"providerId": "<string>",
"modelId": "<string>",
"variant": "<string>"
},
"maximumRuntimeMs": 1805000,
"digest": "<string>",
"createdAt": 4503599627370495,
"action": {
"kind": "agent",
"instructions": "<string>",
"model": {
"providerId": "<string>",
"modelId": "<string>",
"variant": "<string>"
}
},
"executionTarget": "desktop"
},
"latestRun": {
"id": "<string>",
"automationId": "<string>",
"revisionId": "<string>",
"trigger": "scheduled",
"scheduledFor": 4503599627370495,
"idempotencyKey": "<string>",
"status": "queued",
"leaseOwner": "<string>",
"leaseExpiresAt": 4503599627370495,
"heartbeatAt": 4503599627370495,
"attemptCount": 1,
"executionTarget": "desktop",
"executionThread": {
"id": "<string>",
"threadKind": "automation",
"executionLocation": "desktop",
"automationId": "<string>",
"automationRunId": "<string>",
"engineKind": "<string>",
"nativeThreadId": "<string>",
"workspaceId": "<string>"
},
"providerId": "<string>",
"modelId": "<string>",
"startedAt": 4503599627370495,
"finishedAt": 4503599627370495,
"error": {
"code": "owner_membership_lost",
"message": "<string>",
"retryable": true
},
"resultSummary": "<string>",
"usage": {
"inputTokens": 4503599627370495,
"outputTokens": 4503599627370495,
"costMicros": 4503599627370495
},
"createdAt": 4503599627370495,
"updatedAt": 4503599627370495,
"modelVariant": "<string>",
"codemodeReceiptId": "<string>",
"validatedResult": "<unknown>"
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "unauthorized"
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}Automations
Create an active OpenWork Cloud Automation
Den schedules Automations and keeps durable run history. Automations created by Desktop run on the owner’s connected desktop; Automations created by Web run in OpenWork Cloud. If no desktop runner is connected when a desktop occurrence is due, that occurrence is recorded as missed. Creation makes an Automation active immediately and uses the owner’s current OpenWork Connect integrations. Deactivation stops future runs but does not cancel a run already in progress. This is the Web and Cloud Chat creation surface. Placement is fixed to OpenWork Cloud and the Automation can wake a stopped Cloud container without a desktop. Create only when the person explicitly asks to create or schedule it; there is no draft step.
POST
/
v1
/
cloud-automations
Create an active OpenWork Cloud Automation
curl --request POST \
--url http://api.den.local/v1/cloud-automations \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"action": {
"kind": "agent",
"instructions": "<string>",
"model": {
"providerId": "<string>",
"modelId": "<string>",
"variant": "<string>"
}
}
}
'import requests
url = "http://api.den.local/v1/cloud-automations"
payload = {
"name": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"action": {
"kind": "agent",
"instructions": "<string>",
"model": {
"providerId": "<string>",
"modelId": "<string>",
"variant": "<string>"
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
schedule: {kind: 'once', timezone: '<string>', at: 4503599627370495},
action: {
kind: 'agent',
instructions: '<string>',
model: {providerId: '<string>', modelId: '<string>', variant: '<string>'}
}
})
};
fetch('http://api.den.local/v1/cloud-automations', 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 => "http://api.den.local/v1/cloud-automations",
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>',
'schedule' => [
'kind' => 'once',
'timezone' => '<string>',
'at' => 4503599627370495
],
'action' => [
'kind' => 'agent',
'instructions' => '<string>',
'model' => [
'providerId' => '<string>',
'modelId' => '<string>',
'variant' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://api.den.local/v1/cloud-automations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"action\": {\n \"kind\": \"agent\",\n \"instructions\": \"<string>\",\n \"model\": {\n \"providerId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"variant\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://api.den.local/v1/cloud-automations")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"action\": {\n \"kind\": \"agent\",\n \"instructions\": \"<string>\",\n \"model\": {\n \"providerId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"variant\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.den.local/v1/cloud-automations")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"action\": {\n \"kind\": \"agent\",\n \"instructions\": \"<string>\",\n \"model\": {\n \"providerId\": \"<string>\",\n \"modelId\": \"<string>\",\n \"variant\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"automation": {
"id": "<string>",
"organizationId": "<string>",
"ownerMemberId": "<string>",
"name": "<string>",
"state": "active",
"currentRevisionId": "<string>",
"nextDueAt": 4503599627370495,
"latestRunAt": 4503599627370495,
"needsAttentionReason": {
"code": "owner_membership_lost",
"message": "<string>",
"occurredAt": 4503599627370495
},
"createdAt": 4503599627370495,
"updatedAt": 4503599627370495,
"archivedAt": 4503599627370495,
"latestSuccessfulRunId": "<string>",
"latestSuccessfulResult": "<unknown>"
},
"revision": {
"id": "<string>",
"automationId": "<string>",
"version": 123,
"instructions": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"model": {
"providerId": "<string>",
"modelId": "<string>",
"variant": "<string>"
},
"maximumRuntimeMs": 1805000,
"digest": "<string>",
"createdAt": 4503599627370495,
"action": {
"kind": "agent",
"instructions": "<string>",
"model": {
"providerId": "<string>",
"modelId": "<string>",
"variant": "<string>"
}
},
"executionTarget": "desktop"
},
"latestRun": {
"id": "<string>",
"automationId": "<string>",
"revisionId": "<string>",
"trigger": "scheduled",
"scheduledFor": 4503599627370495,
"idempotencyKey": "<string>",
"status": "queued",
"leaseOwner": "<string>",
"leaseExpiresAt": 4503599627370495,
"heartbeatAt": 4503599627370495,
"attemptCount": 1,
"executionTarget": "desktop",
"executionThread": {
"id": "<string>",
"threadKind": "automation",
"executionLocation": "desktop",
"automationId": "<string>",
"automationRunId": "<string>",
"engineKind": "<string>",
"nativeThreadId": "<string>",
"workspaceId": "<string>"
},
"providerId": "<string>",
"modelId": "<string>",
"startedAt": 4503599627370495,
"finishedAt": 4503599627370495,
"error": {
"code": "owner_membership_lost",
"message": "<string>",
"retryable": true
},
"resultSummary": "<string>",
"usage": {
"inputTokens": 4503599627370495,
"outputTokens": 4503599627370495,
"costMicros": 4503599627370495
},
"createdAt": 4503599627370495,
"updatedAt": 4503599627370495,
"modelVariant": "<string>",
"codemodeReceiptId": "<string>",
"validatedResult": "<unknown>"
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "unauthorized"
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}Body
application/json
Was this page helpful?
⌘I