Change or pause an agent's routine
curl --request PATCH \
--url https://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"instructions": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"active": true
}
'import requests
url = "https://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId}"
payload = {
"name": "<string>",
"instructions": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"active": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
instructions: '<string>',
schedule: {kind: 'once', timezone: '<string>', at: 4503599627370495},
active: true
})
};
fetch('https://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId}', 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/personal-agents/{id}/routines/{routineId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'instructions' => '<string>',
'schedule' => [
'kind' => 'once',
'timezone' => '<string>',
'at' => 4503599627370495
],
'active' => true
]),
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://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"active\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"active\": true\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>",
"agentId": "<string>"
},
"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",
"workspaceId": "<string>",
"agentRevisionId": "<string>"
},
"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>",
"triggerContext": {
"kind": "calendar_meeting",
"eventId": "<string>",
"title": "<string>",
"start": 4503599627370495,
"end": 4503599627370495,
"attendeeDomains": [
"<string>"
],
"externalAttendees": 4503599627370495,
"link": "<string>"
}
}
}{
"request": {
"id": "<string>",
"agentId": "<string>",
"kind": "tool",
"status": "pending",
"requestedBy": {
"memberId": "<string>",
"name": "<string>"
},
"runId": "<string>",
"connectionId": "<string>",
"connectionName": "<string>",
"toolName": "<string>",
"toolTitle": "<string>",
"summary": "<string>",
"change": {
"routineId": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"instructions": "<string>",
"brief": "<string>",
"name": "<string>",
"active": true,
"toolPolicy": {
"connections": {},
"tools": {}
},
"memoryNote": "<string>",
"newRoutine": {
"name": "<string>",
"instructions": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
}
}
},
"decidedBy": {
"memberId": "<string>",
"name": "<string>"
},
"decidedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"canDecide": [
"deny"
],
"requestedByCaller": false
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}Agents
Change or pause an agent's routine
Send only the fields that change: name, instructions, schedule, or active to pause or resume. The owner’s change applies at once. A manager’s change becomes a request the owner must approve, answered with 202.
PATCH
/
v1
/
personal-agents
/
{id}
/
routines
/
{routineId}
Change or pause an agent's routine
curl --request PATCH \
--url https://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"instructions": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"active": true
}
'import requests
url = "https://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId}"
payload = {
"name": "<string>",
"instructions": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"active": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
instructions: '<string>',
schedule: {kind: 'once', timezone: '<string>', at: 4503599627370495},
active: true
})
};
fetch('https://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId}', 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/personal-agents/{id}/routines/{routineId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'instructions' => '<string>',
'schedule' => [
'kind' => 'once',
'timezone' => '<string>',
'at' => 4503599627370495
],
'active' => true
]),
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://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"active\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"schedule\": {\n \"kind\": \"once\",\n \"timezone\": \"<string>\",\n \"at\": 4503599627370495\n },\n \"active\": true\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>",
"agentId": "<string>"
},
"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",
"workspaceId": "<string>",
"agentRevisionId": "<string>"
},
"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>",
"triggerContext": {
"kind": "calendar_meeting",
"eventId": "<string>",
"title": "<string>",
"start": 4503599627370495,
"end": 4503599627370495,
"attendeeDomains": [
"<string>"
],
"externalAttendees": 4503599627370495,
"link": "<string>"
}
}
}{
"request": {
"id": "<string>",
"agentId": "<string>",
"kind": "tool",
"status": "pending",
"requestedBy": {
"memberId": "<string>",
"name": "<string>"
},
"runId": "<string>",
"connectionId": "<string>",
"connectionName": "<string>",
"toolName": "<string>",
"toolTitle": "<string>",
"summary": "<string>",
"change": {
"routineId": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"instructions": "<string>",
"brief": "<string>",
"name": "<string>",
"active": true,
"toolPolicy": {
"connections": {},
"tools": {}
},
"memoryNote": "<string>",
"newRoutine": {
"name": "<string>",
"instructions": "<string>",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
}
}
},
"decidedBy": {
"memberId": "<string>",
"name": "<string>"
},
"decidedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"canDecide": [
"deny"
],
"requestedByCaller": false
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}Authorizations
denApiKeybearerAuth
Path Parameters
Body
application/json
Was this page helpful?