curl --request PATCH \
--url https://api.openworklabs.com/v1/personal-agents/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"monthlyBudgetMicros": 500000000000
}
'import requests
url = "https://api.openworklabs.com/v1/personal-agents/{id}"
payload = {
"name": "<string>",
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"monthlyBudgetMicros": 500000000000
}
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>',
brief: '<string>',
toolPolicy: {connections: {}, tools: {}},
monthlyBudgetMicros: 500000000000
})
};
fetch('https://api.openworklabs.com/v1/personal-agents/{id}', 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}",
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>',
'brief' => '<string>',
'toolPolicy' => [
'connections' => [
],
'tools' => [
]
],
'monthlyBudgetMicros' => 500000000000
]),
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}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"monthlyBudgetMicros\": 500000000000\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}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"monthlyBudgetMicros\": 500000000000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/personal-agents/{id}")
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 \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"monthlyBudgetMicros\": 500000000000\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": "<string>",
"organizationId": "<string>",
"ownerMemberId": "<string>",
"name": "<string>",
"state": "active",
"currentRevisionId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z",
"memberId": "<string>",
"pausedAt": "2023-11-07T05:31:56Z"
},
"revision": {
"id": "<string>",
"agentId": "<string>",
"version": 123,
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"defaultExecutionTarget": "desktop",
"monthlyBudgetMicros": 500000000000,
"digest": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
},
"routineCount": 4503599627370495,
"role": "owner",
"owner": {
"memberId": "<string>",
"name": "<string>"
},
"sharedWith": [],
"routines": [
{
"id": "<string>",
"name": "<string>",
"state": "active",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"nextDueAt": "2023-11-07T05:31:56Z",
"latestRun": {
"id": "<string>",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z"
}
}
],
"spend": {
"monthMicros": 4503599627370495,
"unpricedTokens": 4503599627370495,
"budgetMicros": 500000000000,
"ownerBudgetMicros": 500000000000,
"adminBudgetMicros": 500000000000,
"overBudget": true
},
"openRequestCount": 0,
"audience": {
"organization": false,
"autoAddOrganization": false,
"teams": []
},
"listed": true,
"canShare": true
}{
"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,
"connectorAccess": true
}
}{
"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>"
}Change an agent
An agent has an owner, a name, a brief that says how it works, and rules for which tools it can use. Every change to the brief or tool policy makes a new version. An agent does its work through routines. A routine is a Cloud Automation that belongs to the agent, so it also appears in the Automation capabilities; each run starts from the agent’s brief and can use only what the agent’s tool policy allows. The owner can share the agent with teammates. Managers can change who can collaborate. The owner must approve changes a manager proposes to the brief, tool policy or routines. Collaborators can use the agent and ask for changes. Runs started by a teammate are private. Scheduled runs use the owner’s accounts and share their results with the team. Send only what changes. A new brief or tool policy replaces the old one whole, makes the next version, and applies to the agent’s routines from their next run; a run already in progress keeps the version it started with. A rename alone keeps the version.
curl --request PATCH \
--url https://api.openworklabs.com/v1/personal-agents/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"monthlyBudgetMicros": 500000000000
}
'import requests
url = "https://api.openworklabs.com/v1/personal-agents/{id}"
payload = {
"name": "<string>",
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"monthlyBudgetMicros": 500000000000
}
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>',
brief: '<string>',
toolPolicy: {connections: {}, tools: {}},
monthlyBudgetMicros: 500000000000
})
};
fetch('https://api.openworklabs.com/v1/personal-agents/{id}', 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}",
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>',
'brief' => '<string>',
'toolPolicy' => [
'connections' => [
],
'tools' => [
]
],
'monthlyBudgetMicros' => 500000000000
]),
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}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"monthlyBudgetMicros\": 500000000000\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}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"monthlyBudgetMicros\": 500000000000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/personal-agents/{id}")
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 \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"monthlyBudgetMicros\": 500000000000\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": "<string>",
"organizationId": "<string>",
"ownerMemberId": "<string>",
"name": "<string>",
"state": "active",
"currentRevisionId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z",
"memberId": "<string>",
"pausedAt": "2023-11-07T05:31:56Z"
},
"revision": {
"id": "<string>",
"agentId": "<string>",
"version": 123,
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"defaultExecutionTarget": "desktop",
"monthlyBudgetMicros": 500000000000,
"digest": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
},
"routineCount": 4503599627370495,
"role": "owner",
"owner": {
"memberId": "<string>",
"name": "<string>"
},
"sharedWith": [],
"routines": [
{
"id": "<string>",
"name": "<string>",
"state": "active",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"nextDueAt": "2023-11-07T05:31:56Z",
"latestRun": {
"id": "<string>",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z"
}
}
],
"spend": {
"monthMicros": 4503599627370495,
"unpricedTokens": 4503599627370495,
"budgetMicros": 500000000000,
"ownerBudgetMicros": 500000000000,
"adminBudgetMicros": 500000000000,
"overBudget": true
},
"openRequestCount": 0,
"audience": {
"organization": false,
"autoAddOrganization": false,
"teams": []
},
"listed": true,
"canShare": true
}{
"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,
"connectorAccess": true
}
}{
"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>"
}Authorizations
Body
Response
Agent updated.
Was this page helpful?